作者ptta (ptta)
看板Programming
标题请问如何在binary code找到source code里的常数?
时间Tue Aug 19 13:00:37 2014
各位网友您好,
请问一下我有以下的8051 C source code
i2c_write_reg(0x0a, 0x01, 0x28);
i2c_read_reg(0x0a, 0x22);
但是我在compiled之後,在binary code(也就是机械码)中,很难找到
诸如0A 01 28或是0A 22这样的十六进位数。
请问有什麽方法,可以在compiled之後仍然可以找到这些常数呢?
感谢您的帮忙~
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 220.137.8.75
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Programming/M.1408424439.A.75D.html
1F:→ suhorng: 像这种的你要 disassemble 去看位置 140.112.16.150 08/19 14:15
2F:→ suhorng: 这种十之八九会变成指令 140.112.16.150 08/19 14:15
3F:推 KAOKAOKAO: 8051的这个工具支援asm嵌入组语吗? 118.169.35.235 08/19 21:57
4F:→ MasterChang: 8051是单晶片吧? 180.177.57.230 08/20 06:13
5F:→ ptta: 是单晶片,有支援嵌入式asm(keil c) 42.70.47.3 08/20 07:42
6F:推 bxxl: 你先去找assembly code翻成什麽,再去查 114.45.136.64 08/20 22:33
7F:→ bxxl: instruction set format, 就能手动翻译 114.45.136.64 08/20 22:35
8F:→ bxxl: 出机器码, 除非栏位刚好是byte aligned 114.45.136.64 08/20 22:36
9F:→ bxxl: 不然应该是无法直接看出,因为一个byte之内 114.45.136.64 08/20 22:36
10F:→ bxxl: 可能有部份bit是opcode,部份是常数 114.45.136.64 08/20 22:37