|
|
|
#1
|
|||
|
|||
|
I didn't ask you to prove yourself. I was curious how would your version of that code look like. Also, how would eax go out of the boundaries, when : [1] it's stacked; [2] it only increases so far as bl is not 0; [3] eax gets restored, so nothing crashes; [4] the sub uses the pop'd eax...?
Yeah, I agree - god damn stack gave me so many headaches back in the days. And it still does. Pretty powerful thingie. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
(I pity people who have to learn ASM on a relatively sophisticated platform as the x86 CPU and DOS/Windows. Back in the microprocessor days, a Z80 was much easier to understand, not to mention the even simpler good old 65xx series.)
__________________
Joe Forster/STA For more information, see the FileForums forum rules and the PC Games forum FAQ! Don't contact me via E-mail or PM to ask for help with anything other than patches (or software in general) done by me, otherwise your request may be deleted without any reply! Homepage: http://sta.c64.org, E-mail: [email protected]; for attachments, send compressed (ZIP or RAR) files only, otherwise your E-mail will bounce back! |
|
#3
|
||||
|
||||
|
Quote:
cave: pushad ; preserve registers loop: ; loop begin mov bl, [eax+14] ; okay, eax supposedly on the stack cmp bl, 79 ; is bl = 79 je enemy ; if so, boing out of this routine cmp bl, 0 ; is bl = 0 (presumably end of string) je out ; if so, boing out inc eax ; incriment our pointer by 1 jmp loop ; loop << this is where u can cause a crash eax may be on stack, but the stack does have limits, and this could be reproduced by puting crap in eax out: popad ; restore the registers jmp back ; get out enemy: ; enemy portion popad ; restore registers sub [eax+538],ecx ; and do the mathy thing jmp back ; then get out back: flags not preserved, the sub [eax+538], ecx can adjust the flags Quote:
what i would do is check that the byte @ eax fits within an 'acceptable' character range, then i would do an lstrlen or so on it to calculate its length and work from that... its relatively safer.. like check it fits within 'a->z/0-9' or 'A->Z /0-9' then begin processing the game could act on the flags, from the code, so the cmp, etc can screw the flags, ideally what u want to do is to set the flags for when u handle the player portion, (where u set the flags to a good condition), and leave them as-is for the enemy portion.. such code could be like call check_ammo_amount ; this would be the code that you patch jz user_has_no_ammo etc.. where the flags are DEFINATELY important, it depends on how the game was coded, but its worth paying attention to.. and i guess u can pity me joe, cos i started out in the dos days, interrupts, 8 bit, 16 bit, pmode... all fun to learn though
__________________
bleh DO NOT PM me with questions, leave that in the forums...ESPECIALLY if i dont know you... Last edited by TippeX; 17-04-2007 at 08:28. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rainbow Six Vegas v1.04 Trainer Doesn't work | mfw41 | Game Trainers | 7 | 30-03-2007 22:13 |
| The best (and fun) NFS:Carbon trainer available | intoksicated | General Gaming | 3 | 22-12-2006 04:55 |
| Gothic 2 Trainer prb | Dark3lement | General Gaming | 3 | 17-08-2006 15:50 |