Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 16:27

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Looking for an offset..
PostPosted: 25 Feb 2009 14:18 

Joined: 25 Feb 2009 13:21
Posts: 2
Im trying to add code from the game mohaas to mohaa

an example (gamex86.dll):

part 1
Code:
31145560 6A00                    push 00000000
31145562 685CA22131              push 3121A25C                        :"Leave the current team"
31145567 6A00                    push 00000000
31145569 6A00                    push 00000000
3114556B 6A01                    push 00000001
3114556D 6850A22131              push 3121A250                        :"leave_team"
31145572 B9B05B3231              mov ecx, 31325BB0
31145577 E834E4FEFF              call 311339B0
3114557C 6890551431              push 31145590
31145581 E8D0720600              call 311AC856
31145586 59                      pop ecx
31145587 C3                      ret


31145588 90                      nop
31145589 90                      nop
3114558A 90                      nop
3114558B 90                      nop
3114558C 90                      nop
3114558D 90                      nop
3114558E 90                      nop
3114558F 90                      nop
31145590 B9B05B3231              mov ecx, 31325BB0
31145595 E986E4FEFF              jmp 31133A20
3114559A 90                      nop
3114559B 90                      nop
3114559C 90                      nop
3114559D 90                      nop
3114559E 90                      nop
3114559F 90                      nop


part 2
Code:
3115ACB0 56                      push esi
3115ACB1 8BF1                    mov esi, ecx
3115ACB3 8B8664080000            mov eax, dword ptr [esi+00000864]
3115ACB9 85C0                    test eax, eax
3115ACBB 751D                    jne 3115ACDA
3115ACBD 6834BD2131              push 3121BD34                        :"You are not on a team"
3115ACC2 FF1530042531            call dword ptr [31250430]
3115ACC8 50                      push eax
3115ACC9 8B464C                  mov eax, dword ptr [esi+4C]
3115ACCC 50                      push eax
3115ACCD FF1538062531            call dword ptr [31250638]
3115ACD3 83C40C                  add esp, 0000000C
3115ACD6 5E                      pop esi
3115ACD7 C20400                  ret 0004

3115ACDA 56                      push esi
3115ACDB B990E52431              mov ecx, 3124E590
3115ACE0 E84B5CFAFF              call 31100930
3115ACE5 5E                      pop esi
3115ACE6 C20400                  ret 0004


3115ACE9 90                      nop
3115ACEA 90                      nop
3115ACEB 90                      nop
3115ACEC 90                      nop
3115ACED 90                      nop
3115ACEE 90                      nop
3115ACEF 90                      nop


thats all the code of the command "leave_team"

i found the second part bacause of the string "You are not on a team". im trying to get the second part of another command (addkills) but i could not find it.

any idea of how to get it?

http://www.2shared.com/file/4953911/4330503a/gamex86.html


Top
 Profile  
 
 
 Post subject: Re: Looking for an offset..
PostPosted: 25 Feb 2009 15:52 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
it's very simple, the following is an example for mohsh 2.15 (which differs from your files):
- 31145d70 is the function of the "addkills" command (you have already found it)
- at the middle of that function you notice a "mov ecx, offset" that in this case is the offset 31324ebc
- search the occurrencies of 31324ebc in the file and you will find a "mov dword ptr [31217D60], 31324EBC"
- now search the offset "31217D60 + 8" (31217D68) and you will find:
. "mov eax, 31160940"
. "mov dword ptr [31217D68], eax"
- the second function is just that 31160940


Top
 Profile  
 
 Post subject: Re: Looking for an offset..
PostPosted: 25 Feb 2009 16:39 

Joined: 25 Feb 2009 13:21
Posts: 2
thx! that "+ 8" works great now i can modify any command.

and about the version, your gamex86.dll is version 2.11 not 2.15...


Top
 Profile  
 
 Post subject: Re: Looking for an offset..
PostPosted: 25 Feb 2009 16:58 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
uhmmm the version was enough confusing, here I had the files of 2.11 so applied the 2.11->2.15 patch and the only thing which changed was the addition of 2 new pk3 files.
anyone the important thing is that you have found all the functions you needed :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC [ DST ]


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 post attachments in this forum

Search for: