Posted: Fri Dec 18, 2015 9:26 pm Post subject: Find previous dynamic call target?
I've found the code that accesses a certain variable, and that code is reached by a jump from an unknown location. When looking at the stack trace, the first return address is for a dynamic call (call eax).
What I want to do is find the value of eax in the dynamic call that eventually leads to my breakpoint in the code that accesses the variable. The dynamic call is used hundreds of times between the one call that leads to the relevant code section. I've tried Dissect Code to find the jump origin with no success.
Is there a way to store the value of eax each time that call is taken so I know the most recent call target when my breakpoint gets hit? (I have no idea how much code is between the dynamic call and my breakpoint)
Is there another way of finding what function is being called dynamically to reach the code that accesses the variable?
Well, you know the general value of EAX from where the instruction you found is located.
You could inject at the CALL statement to find all occurrences of EAX between that address and minus X.
Or execute the following Lua and set a breakpoint on the CALL statement.
Code:
values={}
function debugger_onBreakpoint()
values[EAX] = EAX
debug_continueFromBreakpoint(co_run)
return 1
end
Let it run during your action, then run the following.
Code:
local myinstruction = 0x12345678
local closest = 0
for a in pairs(values) do
if a < myinstruction and a > closest then
closest = a
end
end
print(string.format("%X",closest))
Let it run and it will tell you the address thats jumps/calls to GIVEN code. Very Informative.
But if you know its a "call" just Find the "ret" at the bottom of the code and toggle breakpoint on the "ret" then use...
Memory Viewer>Debug>Step to return after the call.
Both ways have their ups and downs. But you really should always run a dissect code if your hacking a game. Just makes everything smoother and allows you better place injections. Especially when you need to use registers to add custom code. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum