我可以使用go dlv exec/go-server对所有GO代码进行反编译吗?

发布于 2025-02-10 05:40:38 字数 657 浏览 3 评论 0原文

假设Windows系统使用Linux OS编辑了一个Go-Server文件,我可以使用GO DLV Exec ./go-Server对所有GO代码进行反编译吗?

当我尝试分解一些分数时,我在下面得到了消息,但是它没有打印代码,除了iDa之外,是否有任何方法对其进行反复编译,因为它太贵了,但是它太贵了。

(dlv) b main.main
Breakpoint 1 set at 0x845ecf for main.main() E:/Code/GoCode/go-server/main.go:10
(dlv) c
> main.main() D:/Go/main.go:10 (hits goroutine(1):1 total:1) (PC: 0x845ecf)
Warning: debugging optimized function
(dlv) n
> main.main() D:/Go/main.go:11 (PC: 0x845ee6)
Warning: debugging optimized function
(dlv) n
Config file: ./dev.json Load success!
> main.main() D:/Go/main.go:12 (PC: 0x845f00)
Warning: debugging optimized function

Supposed a go-server file was compiled by Windows system with linux OS, and Can I use Go dlv exec ./go-server to decompile all go code?

When I try to break some points, I got below message, but it didn't print the code, is there any way to decompile it except for IDA, cause it's too expensive to but it.

(dlv) b main.main
Breakpoint 1 set at 0x845ecf for main.main() E:/Code/GoCode/go-server/main.go:10
(dlv) c
> main.main() D:/Go/main.go:10 (hits goroutine(1):1 total:1) (PC: 0x845ecf)
Warning: debugging optimized function
(dlv) n
> main.main() D:/Go/main.go:11 (PC: 0x845ee6)
Warning: debugging optimized function
(dlv) n
Config file: ./dev.json Load success!
> main.main() D:/Go/main.go:12 (PC: 0x845f00)
Warning: debugging optimized function

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小糖芽 2025-02-17 05:40:38

不,DLV没有分解器,尽管与C或C ++相比,GO在运行时具有更多的元数据,但很难恢复编译过程,但最终您最终会在源代码中使用任何原始程序来自分解器。

我认为您要质疑的是,如果您可以从另一个主机上列出源代码列表,请注意,通常debuggers dom d d d o. ida),相反,编译器创建元数据,每种指令都及其行及其行,然后将每份指令引用到原始源代码文件,然后调试者可以加载此源代码文件并构建其功能,例如源代码级别从那里步入,您需要复制所有源代码到其文件系统某个地方的Linux计算机,并配置DLV以知道如何找到此源代码:

config替代路标

请记住,您需要与已编译的原始源代码同步维护可执行文件,否则调试器可能会显示错误的行偏移

No, dlv does not have a decompiler, although Go has much more metadata about the program at runtime in comparison with C or C++ it's very hard to revert the compilation process, it's unlikely you will end up with anything alike the original program in source code from a decompiler.

I think what you're questioning is that if you can debug with source code listing from another host, note that usually debuggers do not decompile the program (unless they're meant for debugging without source code, like IDA), instead compilers create metadata with references for each instruction to the original source code file along with its lines, then debuggers can load this source code file and build its features like source code level stepping from there, what you need is to copy all the source code to your Linux machine somewhere on its file system, and configure dlv to know how to locate this source code:

config substitute-path E:/Code/GoCode/go-server/ /home/user/somewhere/

Keep in mind that you need to maintain the executable in sync with the original source code it was compiled with, otherwise the debugger may display wrong line offsets

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文