Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"jal" to the middle of another function's body in MIPS binary compiled with GCC, what can be the original C code?

25 views
Skip to first unread message

Михаил Сычёв

unread,
Sep 2, 2012, 6:08:30 AM9/2/12
to
Hi,

I am reverse engineering a playstation 1 binary written in C and compiled with a very old version of gcc(year 1997-1999, 2.9+). I spotted a very strange JAL instruction that leads to the middle of another function. I've checked that no code is being loaded or modified at runtime and this jump makes some sense. (The "callee" is a LZ77 decompress function which allocates memory for decompressed data and then decode data and "caller" uses static memory buffer and jumps to the middle of the function to pass the unneeded allocation.

I've thought of following things:
- This is some kind of clever optimisation by compiler (inlining?). But I haven't seen anything like this before.
- Definitely not a "goto" as gotos are limited to function scope.
- Using label as function? AFAIK it's possible to do in GCC but I don't see why anyone would do this.

So, anyone has any ideas?
0 new messages