I have a file in the Intel hex format, which was taken of from a pic16F1705 chip. I need to find a way to disassemble it into some form of human friendly programming language in order to make some modifications to it. I tried running it through a x86 and x64 dissembler, but in both cases I got an output, which looked like assembler code, but there were around 4000 bad lines in both cases. My question is how should I disassemble this file, so I can read it in some human friendly programming language and modify it?

0:  02 00                   add    al,BYTE PTR [eax]
2:  00 04 00                add    BYTE PTR [eax+eax*1],al
5:  00 fa                   add    dl,bh
7:  10 00                   adc    BYTE PTR [eax],al
9:  00 00                   add    BYTE PTR [eax],al
b:  80 31 0f                xor    BYTE PTR [ecx],0xf
e:  28 ff                   sub    bh,bh
10: 3f                      aas
11: ff                      (bad)
12: 3f                      aas
13: 7e 14                   jle    0x29
15: 80 31 20                xor    BYTE PTR [ecx],0x20
18: 00 7f 08                add    BYTE PTR [edi+0x8],bh
1b: a2 10 00 10 00          mov    ds:0x100010,al
20: f0 00 04 2e             lock add BYTE PTR [esi+ebp*1],al
24: 70 08                   jo     0x2e

These are some example lines of the output I get after running the hex through a x86/x64 dissembler.

  • you'll need to use a pic disassembler -- it's not x86 or x64. I know ida supports pic 16xx cpus and there's this disassembler (but I haven't tried it) github.com/fredimachado/PICHexDisassembler
    – broadway
    Dec 31 '17 at 14:55
  • I tried it using ida and got some results, so I will continue working from here. Thank you really much for your help!
    – Radi
    Dec 31 '17 at 15:10
  • iirc radare2 understands ihex format files i think i had a post but cant find it atm
    – blabb
    Dec 31 '17 at 15:12
  • Should work with radare2. Install radare2 from git and execute r2 ihex://filename
    – Megabeets
    Dec 31 '17 at 16:07
  • @blabb, this answer, I assume
    – Megabeets
    Dec 31 '17 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.