Reputation: 27
Is it possible to disassemble hex stm8 firmware?
Upvotes: 2
Views: 4226
Reputation: 302
gmtdisas is a tool you can use to disassemble binaries...
https://github.com/volbus/gmtdisas
It has very few dependencies and can be compiled for both windows ans linux easily.
Upvotes: 0
Reputation: 5921
This IDA Pro 6.6 plugin seems to work. https://github.com/derbroti/Stm8Ida
Assuming you're on Windows:
Open the VS2013 solution and build using IDA 6.6 SDK headers and libs. You will need to add idasdk66\include and idasdk66\module to the list of includes and idasdk66\lib\x86_win_vc_32 to the list of library locations in your project file.
Then copy the output, st8.w32 to: C:\Program Files (x86)\IDA 6.6\procs
Upvotes: 3
Reputation: 1019
Your file consist of two sections 8000-87FFh and 8800-BFFFh. Apparently first is bootloader, second is main programm. You can disassemble they separately.
I have tried to do the following:
naken_util.exe -disasm -stm8 ./fw.hex > ./fw.asm
Boot file begin with common IRQ table. Main file destine all IRQs to 886Bh where seems begin main()
function, and the first instruction is asm("sim")
that disable all IRQs.
Further you can use some more complex programm such as IDA and decomplie they to source if you need.
Upvotes: 2