Originally Posted by
Cycoder
Way with Cheatengine ->
1) search the ingame variable for the zoomlevel of SetZoom(zoomlevel) like a singleplayer ammo/health cheat
2) set the debugger on the variable with "look what writes to this address"
3) look what function writes on the variable ingame if i change the zoomlevel with the zoom button ingame
4) show the adresse in memory viewer and click "select function"
5) voila, the SetZoom() function
6) Setzoom_Addy - BaseAddy = offset
Way with Ida Pro->
1) open Strings Window and Search for "SetZoom"
2) select the function from the SetZoom
3)
http://img850.imageshack.us/img850/5155/57316275.png
4) the functionaddy that shown in ida pro - baseaddy = offset
Your method of finding the function in IDA brings you to the lua wrapper function.
Code:
int __cdecl Script_SetZoom(int luaState)
{
int v2;
if ( lua_isnumber(luaState, 2) )
{
v2 = lua_tonumber(luaState, 2); // get lua argument (the actual zoom level)
sub_6DFF90(v2); // call real function with the correct zoom level, this is the function CE finds since this function access the variable responsible for the zoom level
}
else
{
luaL_error(luaState, "Usage: SetZoom(level)", v3);
}
return 0;
}
Edit: My paste is from an old 16357 build, yours is at 0x6E1F00 (-0x400000, so offset is 0x2E1F00)