Little Fighter Empire - Forums
Read/Write - Save Progress - Printable Version

+- Little Fighter Empire - Forums (https://lf-empire.de/forum)
+-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7)
+--- Forum: [2.0] Exe Editing (https://lf-empire.de/forum/forumdisplay.php?fid=43)
+--- Thread: Read/Write - Save Progress (/showthread.php?tid=3495)

Pages: 1 2 3


RE: Read/Write - Save Progress - Boop - 05-15-2011

Really? o.0. This is probably one of the most organized things ever o.0. The dll framework on the other hand, that thing is so unsorted it's not even funny...

There are 3 .inc files. One of them is .hax, that just has the functions to patch the game. ReadWriteLF2.inc, that has all the constants and stuff that you need for the read write stuff, you need that file. Patches.inc , that includes the two patches you need.

Code:
invoke JmpPatch,0042DF46h,addr stageSelect

in 2.0a that is 0042DEE4.

the jump constants for 2.0a are:
Code:
Stg_r1 dd 0042DEF1h Stg_r2 dd 0042DEF7h

Code:
invoke CallPatch,00438A4Dh, addr Stage_Up
that is 0043895Ch in 2.0a. You need the WriteMem thing to write NOP to 00438961. No further changes are needed for patches.inc since it's a CallPatch.

Then you just need to copy all the CreateThread/SetupFiles etc in DLLEntryPoint and you are done...

PS: Are you EdL from lff? You guys never credit anything I do :(, it makes me sad :(.


RE: Read/Write - Save Progress - Yinseko - 05-15-2011

thnx, thats enough info ^^ i'll try

yep, but um....every1 know that almost all thing bout dll thats your project and you're very famous person :)
it's really problem, that no one can force each creator to credit whatever he used
btw i'm doing some video tutes for users and stay credit your work as well ^_^


RE: Read/Write - Save Progress - Boop - 05-15-2011

Ah right, I should have been more clear. You don't need to include hax.inc. The dll framework already has a file with all those definitions.


RE: Read/Write - Save Progress - Yinseko - 05-15-2011

sry, that my mistale that i stay use hax ><
now clear and remove it.



upd:
1 more thing...
when i try to use old dll, it create "progress" stuff (saved data, right?)
but after try to add this to my dll, thats create nothing
game crashes after try to select stage or just click "fight!" x)

cuz when i did this for dll, function of reading exe bitmaps from folder... stop works xD
looks like that stage select method conflicts with dll that i use.
thats doesnt work, but i'll stil try more =D
tnx for basic information! ^^


RE: Read/Write - Save Progress - Boop - 05-15-2011

I've attached the updated source for 2.0a. If the file isn't getting made then it sounds like SetupFiles isn't getting run.
Code:
DllEntryPoint proc hInstDLL:DWORD, reason:DWORD, unused:DWORD mov eax,reason .if eax == DLL_PROCESS_ATTACH ; Called when our dll loaded mov eax,offset SetupFiles invoke CreateThread, 0, 0, eax, 0, 0, addr ThreadID invoke CloseHandle,eax call DLLStartup ; Memory patches and jmp patches .endif ret DllEntryPoint endp

Are you sure that your DllEntryPoint looks like that?




RE: Read/Write - Save Progress - Yinseko - 05-15-2011

your dll works perfectly!! i test it on clear and patched exe.
but i cant combine this with mine dll >_<

basic code (Click to View)
if i load game with that - select of stages still crash game.

but if i use this:
your code (Click to View)
then game crashes instantly after loading screen.

this methods have different entry point and i have not enouth expirience to solve that asm problem.
can you tell any idea bout this one, please? ._.''


RE: Read/Write - Save Progress - Boop - 05-15-2011

Code:
DllEntryPoint proc hInstDLL:DWORD, reason:DWORD, unused:DWORD mov eax,reason .if eax == DLL_PROCESS_ATTACH ; Called when our dll loaded invoke VirtualAlloc, NULL, 4000, MEM_COMMIT,PAGE_READWRITE mov memAlloc,eax invoke VirtualAlloc, NULL, 20000, MEM_COMMIT,PAGE_READWRITE mov solAlloc,eax mov eax,offset SetupFiles invoke CreateThread, 0, 0, eax, 0, 0, addr ThreadID invoke CloseHandle,eax call DLLStartup ; Memory patches and jmp patches .endif ret DllEntryPoint endp



RE: Read/Write - Save Progress - Yinseko - 05-15-2011

oh. thanks to you ^^
now works correctly!
i'll learn it)

but....hm.
i'm intersested in 1 more thing bout this...
can the number of opened stages still saved in file, after game closed?
for example, at another time to play (i guess thats can be usefull, if stage mode is too long for fast finish)



RE: Read/Write - Save Progress - Boop - 05-15-2011

I don't really know what you mean.

Are you talking about saving sub stage progress? Like 3-4? I don't think there is a good interface for that. What if you want to start from the beginning? How would tell lf2 to let you start from there? I don't think this is useful, but you can try to figure out how this works and do it your self.


RE: Read/Write - Save Progress - Yinseko - 05-15-2011

nope. not substages.
i mean stage 1, stage 2 and e.c.t
when player finish stage 1, game opens stage 2 for play.
and if player exit LF, he can run it again later, and progress still there - player will see 2 avaliable stages, because he finish 1st stage before.
progress still keep in "progress" file, such after game closed\started again.

question was born, because player lost his progress if game closed.
for some projects thats good, but not for anyone ^^'