flat assembler
Message board for the users of flat assembler.
Index
> Windows > Problem with a patching tool |
Author |
|
randomdude 02 Jun 2012, 11:09
hi
im writing a little tool for patching a binary file the problem is that for patching it, i need to click the Patch button twice the first time i click Patch it says 'Successfully patched' but nothing is changed in the file, and the second time it patches it correctly what can be wrong?
|
|||||||||||
02 Jun 2012, 11:09 |
|
randomdude 02 Jun 2012, 11:40
oh lol what a stupid mistake i did
thanks for the fast reply Code: .btn_patch: invoke SendMessage,[id_checkip],BM_GETCHECK,0,0 cmp eax,BST_CHECKED je .patchipcheckbox mov byte[FileBuffer+112166h],0ebh jmp .patchfile .patchipcheckbox: mov byte[FileBuffer+112166h],75h .patchfile: invoke CreateFile,FileName,GENERIC_WRITE,0,0,4,FILE_ATTRIBUTE_NORMAL,0 test eax,eax jz .patch_error invoke WriteFile,eax,FileBuffer,[nSize],BytesWritten,0 test eax,eax jz .patch_error invoke MessageBox,0,patched,patchedcap,MB_ICONINFORMATION+MB_OK jmp .closehandle .patch_error: invoke MessageBox,0,patcherror,errorcap,MB_ICONERROR+MB_OK jmp .closehandle its working fine now, thanks |
|||
02 Jun 2012, 11:40 |
|
Fixit 12 Dec 2012, 00:52
I like your code and would like to use it with Masm.
I can convert most of the code but not all. Could you help me ? Thanks. |
|||
12 Dec 2012, 00:52 |
|
typedef 19 Jul 2014, 18:09
I hate intertwining GUI calls with their counterparts like this:
Code: if(!createFIle(...)) MessageBox(...) else if(!xxxFile(...)) closeFile(...); MessageBox(...) Just make a fucking function that does everything Code: str_error = ""; function doWork(params) { if !CreateFile,... str_error = "failed to open file"; return -1; ... etc return status_code; } ; then if(!doWork()) { MessageBox(0,str_errror,...) } Clear and concise. |
|||
19 Jul 2014, 18:09 |
|
questlima 27 Aug 2014, 14:56
typedef wrote: I hate intertwining GUI calls with their counterparts like this: now i get to learn how to write to patch programs:LOL with FASM and yes i always uses if else statement this is great stuff, i have learned how to write that special *f... function*:LOL neatly thanks guys _________________ Linux command are not what you intended to learn but your were forced to learn it, without it you will be like a sitting duck on your beautiful newly installed Linux desktop:) |
|||
27 Aug 2014, 14:56 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.