logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
How to debug to find memory locations??

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jun 18, 2010 0:19    Post subject: How to debug to find memory locations?? Reply with quote

Ok, I have downloaded IDA Debugger Pro freeware edition.


Im trying to make heads n tails of it, and try to make my own simple plugins for nwnx.

I've set myself an easy task.
Make a plugin which will let me change the Servername from within the game.


So, I have opened up nwserver.exe in IDA, and it does alot of decompiling etc, and stuff, and leaves me there.

The top wee dropdown, has some settings.
When I set it to Name, and then browse through the accompaning dropdown, I am able to find aServername

Ok, So, I am assuming this is the name of a function or Subroutine, or possibly a value. Since the nwnserver doesnt seem to be actually running at the moment, I would hazard a guess that it is a placeholder possibly for the value that gets assigned for the server name.

407E4E - Appears to be the loc of the subroutine, while
407470+98f - This seems to be the name of the subroutine, IDA being helpful even tells me that it requires one parameter.

I will try adding an execution breakpoint round here, and see if when I change the servers name, if the execution count increases...
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jun 18, 2010 1:47    Post subject: Been having a look Reply with quote

Ok... Ive got an understanding of how to use c++ to write to memory locations etc, but my main crux at the minute, is how do you guys find the memory locations etc.

How on earth did you find the PlayerList memory location,
or the ChatHook code structure (that being said.... when I do a hex search for the Chat Hook hex string, it never finds it... yet the plugin works...)

Im sure I could develop something.... anything, regardless of how lame it is, if I but had a clue how to locate these memory locations etc.

Gonna have another go, this time, with cheatengine helping me.
Will use it to scan for memory location values, and see if any of them are static, or have pointers.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jun 18, 2010 2:28    Post subject: progress!! Reply with quote

I've managed to locate the subroutine which handles the 'maxclient' number.

Its sub_429110 and it sets the maxclient value to be equal to arg[0] - the first and only argument passed in.

Now... how does one turn this into useful information.

Im guessing that the sub_429110 is a static location. Hmmmm
Yeah... I know... set out to get server name, but then settled on server player amount.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group