7 years, 7 months ago.

How to find the entry point of a .bin file compiled for LPC1768?

Hi, For reverse engineering purpose, I want to know where the entry point of a .bin file is (which was compiled for LPC1768, by mbed online compiler). Can anyone tell me how does LPC1768 find the entry point (EP) to start after we pressed the reset button? Is the address of EP fixed (the same for all programs) or stored at somewhere (for example, a header structure) in the .bin file? Thanks

1 Answer

7 years, 7 months ago.

See for example: https://embeddedfreak.wordpress.com/2009/08/07/cortex-m3-interrupt-vector-table/, so first 4 bytes of the flash (= first 4 bytes of the bin) is the initial stack pointer, after that is the address of the reset handler.

Accepted Answer

Thank you so much. I have another problem. The first 16 bytes of my .bin file are: 00 80 00 10 0D 02 00 00 15 02 00 00 17 02 00 00. So, the address of the reset handler is 0000020D. But it is an odd number (similar to the next handlers). In my understanding, the address of an instruction is always an even number. Is it right? Has any wrong with my .bin or my understanding? Thank you

posted by Minh NN 11 Aug 2016

I don't know why that is, but it is consistent with what I have observed before with pointers to functions (in ARM, dunno if it is also true for other architectures). If I force a function to be at an address, and then print the pointer to that function, it is the address + 1.

So substract one to get the start I guess :).

posted by Erik - 11 Aug 2016