Hi im on tutorial no. 13 and im just playing around with it and making some changes to help me learn. Originally
all you are meant to be able to do is save a file as a different name but i wanted to make it so you could edit it as well. So i tried this...
invoke CreateFile,ADDR buffer,\
GENERIC_READ or GENERIC_WRITE ,\
FILE_SHARE_READ or FILE_SHARE_WRITE, NULL, CREATE_NEW,FILE_ATTRIBUTE_ARCHIVE, NULL
mov hFileWrite,eax
invoke MapViewOfFile,hMapFile,FILE_MAP_READ,0,0,0
mov pMemory,eax
new bit --> invoke SendMessage,hwndEdit,WM_GETTEXTLENGTH,NULL,NULL <--- Get no of characters 2 write
new bit --> invoke SendMessage,hwndEdit,WM_GETTEXT,eax,pMemory <--- Write text from edit box to memory
invoke GetFileSize,hFileRead,NULL
invoke WriteFile,hFileWrite,pMemory,eax,ADDR SizeWritten,NULL
invoke UnmapViewOfFile,pMemory
call CloseMapFile
invoke CloseHandle,hFileWrite
invoke SetWindowText,hWnd,ADDR AppName
invoke EnableMenuItem,hMenu,IDM_OPEN,MF_ENABLED
invoke EnableMenuItem,hMenu,IDM_SAVE,MF_GRAYED
but is crashes, anyone got any ideas?
Thanks,
Simon :confused:
all you are meant to be able to do is save a file as a different name but i wanted to make it so you could edit it as well. So i tried this...
invoke CreateFile,ADDR buffer,\
GENERIC_READ or GENERIC_WRITE ,\
FILE_SHARE_READ or FILE_SHARE_WRITE, NULL, CREATE_NEW,FILE_ATTRIBUTE_ARCHIVE, NULL
mov hFileWrite,eax
invoke MapViewOfFile,hMapFile,FILE_MAP_READ,0,0,0
mov pMemory,eax
new bit --> invoke SendMessage,hwndEdit,WM_GETTEXTLENGTH,NULL,NULL <--- Get no of characters 2 write
new bit --> invoke SendMessage,hwndEdit,WM_GETTEXT,eax,pMemory <--- Write text from edit box to memory
invoke GetFileSize,hFileRead,NULL
invoke WriteFile,hFileWrite,pMemory,eax,ADDR SizeWritten,NULL
invoke UnmapViewOfFile,pMemory
call CloseMapFile
invoke CloseHandle,hFileWrite
invoke SetWindowText,hWnd,ADDR AppName
invoke EnableMenuItem,hMenu,IDM_OPEN,MF_ENABLED
invoke EnableMenuItem,hMenu,IDM_SAVE,MF_GRAYED
but is crashes, anyone got any ideas?
Thanks,
Simon :confused:
Dunno but it's time to download a debugger ;)
how do u mean?
Simon
Simon
http://home.t-online.de/home/Ollydbg/
Note : debuggers *often* prevents asking "why does it crash ?"
;)
Note : debuggers *often* prevents asking "why does it crash ?"
;)
ah, ok thanks.
:alright:
:alright:
SoftIce Is Better, if you can find it :grin:
SoftIce is NOT free! OllyDbg is a great free debugger....
You Have a reason.:cool:
In This Way do you know how to compile the masm programs to use with the OllyDbg like the tute in the masm32 pakage for softice by Lord Lucifer or is any way to make the OllyDbg to show the symbols and the source code. Thanks
In This Way do you know how to compile the masm programs to use with the OllyDbg like the tute in the masm32 pakage for softice by Lord Lucifer or is any way to make the OllyDbg to show the symbols and the source code. Thanks