You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, i want to ask :In MIPS architecture, somtines the disassemble result can parse the string addr in .rodata section, but somtimes the result just disassemble the instruction into the form like "lw $X, number($gp)".I know the $gp is the global pointer register, but how can i get the string addr?.
For example,when i disassembled a binary by using angr, i got block like this at addr 0x41f1a0:
but when i disassembled it using ida, i got the block like this:
.text:0041F1D8 la $v0, stderr
.text:0041F1DC la $a1, 0x440000 > .text:0041F1EC addiu $a1, (aPppdVersionS - 0x440000) # "pppd version %s\n"
As shown above,the angr can not get the string "aPppdVersionS " addr.At 0041F1EC, the angr disassembly result is "addiu $a1, $a1, -0x5eb4", if we go back up we can see that the $a1 is relevent to $gp.
But it is strange that in another binary, which i code by myself, angr can get the string addr in .rodata section.Here is the reuslt:
$gp register in MIPS is a "special" register: It points to a global area in memory (see here). Usually it is initialized to a concrete memory address at the beginning of each function. I believe that is the heuristic that IDA Pro relies on when it parses memory references that are calculated from $gp.
angr has implemented a similar (if not exactly the same) heuristic in CFGFast_process_block_arch_specific(). Take a look at that function. Or if you only need the value of $gp, take a look at func.info['gp'] where func is the Function object of the function that you care about. As you may already know, I had to implement this heuristic so that angr's memory reference discovery can yield reasonable results.
By the way, you can disable IDA's simplified displaying of memory references involving $gp by turning off "Prudent search of $gp" in Options -> General -> Analysis -> Processor specific analysis options.
First of all, i want to ask :In MIPS architecture, somtines the disassemble result can parse the string addr in .rodata section, but somtimes the result just disassemble the instruction into the form like "lw $X, number($gp)".I know the $gp is the global pointer register, but how can i get the string addr?.
For example,when i disassembled a binary by using angr, i got block like this at addr 0x41f1a0:
and the vex ir of the block is like this:
but when i disassembled it using ida, i got the block like this:
As shown above,the angr can not get the string "aPppdVersionS " addr.At 0041F1EC, the angr disassembly result is "addiu $a1, $a1, -0x5eb4", if we go back up we can see that the $a1 is relevent to $gp.
But it is strange that in another binary, which i code by myself, angr can get the string addr in .rodata section.Here is the reuslt:
angr vex result:
ida result
So,when the angr disassemble a mips binary with using $gp register,how can i get the string reference addrs?
Thanks!
The text was updated successfully, but these errors were encountered: