Best method for finding where a register value is set
Users browsing this thread: 1 Guest(s)

What is the easiest method for finding where a certain register is set for a given function? I'm monitoring a function where T0 has a value of 8033FF00, and A1 starts at 8032FF00. A1 increases bit by bit until it hits 8033FF00 and then jumps out of the function. I need to find where T0 is initially set to 8033FF00, but I can't seem to back track through the function to find it. I have tried using the register change tool in nemu, but the issue is T0 is constantly being written/read to from various functions all the time. I have also tried just searching for 8033FF00 but it doesn't come up with anything. Does anyone have any advice as far as finding where registers are initially set?

Since T0 is a temporary register, the code should almost definitely be setting it to that 8033FF00 value somewhere within the function's body, and probably right before the loop starts. If the function is huge and the loop is getting branched to from an unknown location, I would put breakpoints on all the branch instructions in the function and check the value of T0 at each one.
(This post was last modified: 14-06-2016, 03:48 PM by shygoo.)

I think it's definitely being branched to from somewhere, but I don't know where it is. So would following some branches after this code possibly lead back to the initial function that branched to this area in the first place?

alternatively, there are also register change breakpoints in nemu that work.

Best method for finding where a register value is set
Users browsing this thread: 1 Guest(s)


  EN ・日本語