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 
 
Linux->Windows ports
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Wart



Joined: 13 Jun 2012
Posts: 44

PostPosted: Tue Aug 07, 2012 2:05    Post subject: Reply with quote

You can start with my demo mod (2 posts above). Maybe you can figure out what's wrong
Back to top
View user's profile Send private message
Wart



Joined: 13 Jun 2012
Posts: 44

PostPosted: Wed Aug 08, 2012 10:30    Post subject: Reply with quote

Any update?
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Aug 16, 2012 21:48    Post subject: Reply with quote

Preloading haks/tlks from nwnx connect.

Any chance for that?
Back to top
View user's profile Send private message
Wart



Joined: 13 Jun 2012
Posts: 44

PostPosted: Fri Aug 24, 2012 3:26    Post subject: Reply with quote

Any update for the name plugin?
Back to top
View user's profile Send private message
Wart



Joined: 13 Jun 2012
Posts: 44

PostPosted: Mon Sep 10, 2012 12:02    Post subject: Reply with quote

Any update for the name plugin?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Mon Sep 10, 2012 22:42    Post subject: Reply with quote

I don't really have a suitable environment to be testing this since I'm running visual studio 2012 and windows 8 64bit. Ingame nothing happens when the functions are called, server crashes when player deallocation takes place which will happen on any 64bit environment passing plugin-allocated memory back to nwserver AFAIK. Logfile doesnt indicate any errors either. Sad
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Wart



Joined: 13 Jun 2012
Posts: 44

PostPosted: Mon Sep 10, 2012 23:55    Post subject: Reply with quote

Seems just like me.
Back to top
View user's profile Send private message
drake127



Joined: 26 Jan 2010
Posts: 28

PostPosted: Wed Sep 12, 2012 19:20    Post subject: Reply with quote

After some investigation, I probably managed to find correct malloc and free functions which should be used inside nwserver.exe. Should you need to allocate memory which will be later freed by nwserver (or deallocate memory allocated by nwserver), you have to use these functions, otherwise the application will most likely crash.

I am not 100% certain but these seem to be the correct ones:
Code:
void * (__cdecl *pmalloc)(size_t cb) = 0x00602657;
void (__cdecl *pfree)(void * cb) = 0x0060256E;
I don't know where I can find names plugin so I cannot confirm whether this will help. If somebody has configured environment, where he or she can try it, I would be glad. I do not have NWNX2 for Windows installed so it would take me quite some time to test it.

Good thing is, this can be tested with any heap buffer (descriptions, names, variables, ...) so I think that if it is not already done, it has quite some advantages.

In other versions of nwserver.exe you can try to look for these signatures (if CRT remains the same):
Code:
free begins at: 55 8B EC 6A FF 68 00 6F
malloc begins at: FF 35 68 F8 EE 05 FF 74


Edit: I tested it with GetDescription and it seems that it does not leak and does not crash either. If somebody want to help with actual implementation, send me PM.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1014
Location: Russia

PostPosted: Fri Sep 14, 2012 14:31    Post subject: Reply with quote

Valgav wrote:
Preloading haks/tlks from nwnx connect.

Any chance for that?
Yes, there is a chance for that.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Wart



Joined: 13 Jun 2012
Posts: 44

PostPosted: Sun Nov 18, 2012 7:09    Post subject: Reply with quote

Any update for the name plugin?
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
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
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