View previous topic :: View next topic |
Author |
Message |
addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Fri Aug 01, 2008 23:49 Post subject: Plugin Dev: sorting out the gameobject array.... |
|
|
So umm.... I got a lot of admiration for those folks who figured out the various address offsets needed to do one functionality or another in NWN through the NWNX plugin system, and what values take on which significance by the NWN engine.
So you guys figure this stuff out with asym debuggers, the madhook lib, or what?
I'm interested in tearing into the NWN's mem so I can get my project off the ground, but all my software engineering experience is mainly with code in human readable form (non-compiled), but I can kind of see what is going on here just tracing through the core NWNX source codes. Hats off to the Avlis folks - impressive
Can anyone give me a pointer in the right direction to at least the *tools* to get started on this? I'm pretty sure I can figure the other half out myself, I hope I never actually collected much in the way of programs that chart out memory, dissassemblers, reverse engineering aids, etc..
My assembly is pretty weak, limited to a course I had my 3rd year towards my CS degree in college which was, uh, a decade ago. Hope its like riding a bike... At least Intel still has their specification up. |
|
Back to top |
|
|
addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Sun Aug 03, 2008 1:19 Post subject: |
|
|
Spent some time reading about the specifications of PE files...
Seems like I need to modify the code image segment... ah, now to find where..... |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Sun Aug 03, 2008 2:56 Post subject: |
|
|
The essential tool for reverse engineering is IDA (interactive disassembler). I would also suggest reading anything on reverse engineering itself.
An IM conversation would be more helpful, but I won't be online until the middle of the next week.
Have fun disassembling!
By the way, what are you trying to achieve? |
|
Back to top |
|
|
addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Sun Aug 03, 2008 17:27 Post subject: |
|
|
I'll have to get IDA and see what I can read up, and I have instant messengers... all of them. Pidgin user here (formerly gaim). I think any help even conceptual or theoretical could help.
So basically what I'm really after is just improving skills, but the topic of choice is tackling the too many instructions error encountered in NWN. I understand that script re-assignment onto various objects within the game are a known workd around. Some server maintainers (with mods over 100 MB, etc..) have expressed that some of their script chains have grown large and this method is giving them performance drawbacks as well as code-clutter.
I'm not exactly sure which solution I should go for or what the final result will look like. There could be a script call ClearInstructionCount(), or perhaps the limit for TMI could be raised itself to a higher value (or perhaps even de-facto by affecting the rate it increments).
It seems like a challenging project, but I feel up to the task |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Mon Aug 04, 2008 0:10 Post subject: |
|
|
Acaos already did this, with the aptly named tmi plugin. You can reset the instruction limit on the fly, up to a fairly obscene number. It's linux only, atm, afaik, however, but it might be a good place to start.
Funky |
|
Back to top |
|
|
addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Mon Aug 04, 2008 17:08 Post subject: |
|
|
That's great. Then I guess I can focus my efforts on a port instead
p.s. although the linux may look a bit differently in memory so looks like I got some debugging ahead. Looks like he didn't go after the image base but plays the memory game |
|
Back to top |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Wed Aug 06, 2008 23:50 Post subject: |
|
|
Yes, NWNx plugins all modify the code in memory. That's the benefit of plugins -- if you decide you want stock functionality, rather than using a hex editor, just put a file in the NWN folder and restart the server. It also allows MUCH easier hooking of functions (as opposed to direct code modification).
Good luck _________________ Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/
<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.
<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for? |
|
Back to top |
|
|
addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Thu Nov 27, 2008 5:45 Post subject: |
|
|
This thread is now horribly old, and horribly misnamed, but I'm posting in it because its the same conversation.
I've been playing around with IDA from time to time over the past few months when I've had time, and I believe the TMI trigger is happening at:
Code: |
.text:005BD1AC jge loc_5BF535
|
With the jump occuring when the script reaches too many instructions, and the jump not occurring if the instruction count is fine.
I'm still new to assembly, I've been studying hard and hell I have a computer science degree but you know we're a bunch of C-weenies these days so I'm delvin into our roots here.
I'm probably wrong, but it would be cool if anyone out there wanted to check my work. Not like you have to, but it would be a cool foundation for a proper windows TMI plugin. I think the Linux one posted writes to the memory segment/stack where this one would write to the instruction segment (presumably via the hooking routines like from madhook or something). |
|
Back to top |
|
|
|