Hello to you all this is my first post and my first MASM program . but the copyfile does not work .... Why ?
if I put it befoer the lstrcpy it works but when it is after it does not ???? Please help .


.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\advapi32.lib
include \masm32\include\advapi32.inc

.data
msgcap db "FILE",0
torun dd 0
dest db "C:\test.exe",0

.code
start:
invoke GetCommandLine
invoke lstrcpy,addr torun,eax
mov edx,offset torun
repeater:
cmp byte ptr,0
je finish
cmp byte ptr,22h
je fixit
inc edx
jmp repeater
fixit:
mov byte ptr,0
inc edx
jmp repeater
finish:
invoke MessageBox,0,addr torun+1,addr msgcap,MB_OK
invoke CopyFile,addr torun+1,addr dest,FALSE
invoke ExitProcess,0
end start


Nice meeting you all . I have been reading this forum in a while and it was of a greate help to me ....
Posted on 2004-04-07 03:07:19 by Gangleri
386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\advapi32.lib
include \masm32\include\advapi32.inc

.data
msgcap db "FILE",0
dest db "C:\test.exe",0

.data?
torun dd ? ;buffer to store your string. need to be large enough to handle lengthy string or you may end up getting a buffer overflow.

.code
start:
invoke GetCommandLine
invoke lstrcpy,addr torun,eax
mov edx,offset torun
repeater:
cmp byte ptr,0
je finish
cmp byte ptr,22h
je fixit
inc edx
jmp repeater
fixit:
mov byte ptr,0
inc edx
jmp repeater
finish:
invoke MessageBox,0,addr torun+1,addr msgcap,MB_OK
invoke CopyFile,addr torun+1,addr dest,FALSE
invoke ExitProcess,0
end start
Posted on 2004-04-07 03:20:33 by smurf
thanks .... I'm still verry lame . LOL
Posted on 2004-04-07 03:36:08 by Gangleri