Little Fighter Empire - Forums

Full Version: Some ASM issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings.
I'm currently working on combining Alkarter's Exe with Silva's and folks DLL, at least for simpliest features.
It's kinda funny work with that btw i'm not really expirienced with asm-olly tracking.

Today i got stuck with reworking 4xxx state.

First of all, state have same adress as in origianl lf2 exe, and initiated like
Code:
invoke JmpPatch, 0041F5FCh, addr State8xxx

and failed.
to figure out what goes wrong i even completly rewrite State8xxx procedure about 10 times -.-
and then i found some strange things
ok, here is procs code

Code:
State8xxx proc

CMP EAX,1F40h ; 8000
JL SHORT state4xxx ;
CMP EAX,2328h ; 9000
JGE SHORT exit1 ;
jmp SHORT exit2 ;

exit1: jmp dword ptr [Transform1] ;
exit2: jmp dword ptr [Transform3] ;

state4xxx:

CMP EAX, 0FA0h ; 4000
JL SHORT exit1  
MOV ECX,DWORD PTR DS:[452980h] ; wtf
LEA EDX,DWORD PTR DS:[EAX-0FA0h] ; calculating ID, 4xxx-4000=ID
XOR EAX,EAX ; comparing for same ID as already owned
CMP DWORD PTR DS:[452990h],EAX
JLE SHORT sector3

sector1:
MOV ESI,DWORD PTR DS:[ECX]
CMP DWORD PTR DS:[ESI+6F4h],EDX
JE SHORT sector2      
MOV ESI,DWORD PTR DS:[452980h]
ADD EAX,1
ADD ECX,4
CMP EAX,DWORD PTR DS:[452990h]
JL SHORT sector1   ; repeating till reach ~1F, then JE works
JMP SHORT sector3

sector2:
MOV ECX,DWORD PTR DS:[452980h]  
MOV ECX,DWORD PTR DS:[ECX+EAX*4]
MOV EAX,DWORD PTR DS:[EBX+EDI*4+3ECh]
MOV DWORD PTR DS:[EAX+368h],ECX

sector3:
MOV EDX,DWORD PTR DS:[EBX+EDI*4+3ECh]
MOV DWORD PTR DS:[EDX+70h],0 ; base frame after transform, usualy 0
MOV EAX,DWORD PTR DS:[EBX+EDI*4+3ECh]
MOV DWORD PTR DS:[EAX+318h],0h ; adding +140 frame count for 8xxx, and here +0 for 4xxx
MOV EAX,DWORD PTR DS:[EBX+EDI*4+3ECh]
jmp Transform2 ; back to regular code

State8xxx endp

and header

Code:
Transform1 dd 0041F675h
Transform2 dd 0041F67Ch
Transform3 dd 0041F60Ah

Everything works fine till i'm trying to change original
Code:
LEA EDX,DWORD PTR DS:[EAX-1F40h]
to 4xxx fixed
Code:
LEA EDX,DWORD PTR DS:[EAX-0FA0h]

Then game just works like everything after that LEA doesnt exist.
Character using 4xxx just dissapearing like next: 1000, dunno why, cause testing it just show me "Sector 3" doesnt effect anymore.
Any advice either ideas how to fix that strange character dissapearing?
After spending a lot of hours i just have no any else point to resolve it xO
Can you translate these code to C ? I hardly read your asm code.
I wrote a tutorial about translation, you can take a look.
maybe i'll try.... C is completly unknown thing to me.
Even now i feel easier to read asm..

and update:
send sources to friend...
and he told that he got everything works fine O_O
really, i got crash (regular exe launch) and character dissapear (while launched through debugger)... and he just got it works fine ><
now that dissapointment
Ok guys, forget it.
Trouble cause my stupidness.
4xxx just somewhere was already used.
~shame.

btw even now it works only time to times..
Wanna ask one question and i guess somebody already know its kinda solution.

In original LF2 either Alkarter's there is something like Coord-verification. Even if i'm trying to change anything thro Cheat Engine about X-coords, it's every time resets back with "exchange" ASM command
Code:
xchg [esi+10],eax
It's used in several places, by the way just doing kinda same thing.
Attempt to freeze or NOP value just prevents characters from moving by X-coord.

Does anyone found a way to bypass this trouble?
Can't manipulate with coordinates
It's because you are modifying the int version of the position which is not the "real" position. The real position is stored as a double. See the spreadsheet.

https://docs.google.com/spreadsheet/ccc?...BYVE#gid=0
Hm, what the int version used for then...?
At sheet in "usage" col it's "integer version of the real x position", kinda no real info  :p

Oh, and ty Silva ^^ glad to see u~
Using int to calculate coordinate can prevent from losing accuracy.
I think this is most possible answer.