我可以使用go dlv exec/go-server对所有GO代码进行反编译吗?
假设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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,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