show default_exception_vsr addr for eCos #520
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add another magic to try to get default_exception_vsr address in eCos firmware (mipsel), for this address may be helpful for locating the base_addr.
Currently, the eCos magic will try to match the following code in the firmware.
In my recent analysis on an eCos mipsel firmware. I need to figure out the load base_addr of the firmware. The address
0x80000200
shown above is not really helpful. Finally I used a small trick to figure out the base_addr (0x80040000
).When I looked the firmware again, there is a code snippet (maybe) related to
hal_mon_init
. As we can see, the address of__default_exception_vsr
is0x80040224
. From my perspective, it's helpful for locating the base_addr. (Page Align:0x80040224 & ~((1<<12)-1) = 0x80040000
)So I add this magic to match it. In addition, I manually test against 10 eCos firmwares approximately, and all work well. By the way, all the eCos firmwares I find are mipsel endian, so only add the little endian magic.
$ binwalk RGS200-12P.bin DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 0 0x0 eCos kernel exception handler, architecture: MIPSEL, exception vector table base address: 0x80000200 128 0x80 eCos kernel exception handler, architecture: MIPSEL, exception vector table base address: 0x80000200 300 0x12C eCos vector table initialization handler, architecture: MIPSEL, default exception vector table base address: 0x80040224, hal_vsr_table base address: 0x80000200 # ...