When I want to Copy a File, only paar lines get copyed
perhaps there is an error ?

_____________________________________________________________________
INVOKE CreateFile, ADDR filepath, GENERIC_READ OR GENERIC_WRITE, NULL, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
MOV h_file, EAX

[...]

INVOKE CloseHandle, h_file
INVOKE CopyFile, ADDR keylogfilepath, ADDR keylogfilepathtemp, FALSE

INVOKE CreateFile, ADDR filepath, GENERIC_READ OR GENERIC_WRITE, NULL, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
MOV h_file, EAX
????????????????????????????????????????????????????????????????????

P.S. Perhaps it get to quick opened and closed ?
Posted on 2003-04-13 05:15:24 by Forginforcer
Here is a quick example for the CopyFile function:




.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

.data
ExistingFileName db 'Copyfile.asm',0
NewFileName db 'C:\windows\Newfile.asm',0
msg db 'Success!',0
capt db 'CopyFile',0
.code
start:
invoke CopyFile,addr ExistingFileName,addr NewFileName,TRUE
or eax,eax
jz @f
invoke MessageBox,0,addr msg,addr capt,MB_OK
@@:
invoke ExitProcess,0
end start



Forginforcer,can you post your complete source file?

Regards,

Vortex
Posted on 2003-04-13 07:33:07 by Vortex
I Already tryed to use sleep, but ther problem ist still present
Posted on 2003-04-13 07:33:51 by Forginforcer
That is the complete source.
I is in a buttonclick funktion.

with button 1 the file get opened with attribut always and with button 2 the file get closed an copyed.
But only 600 Bytes.
Posted on 2003-04-13 07:36:32 by Forginforcer
Hi, why I cant the the label @f ? - Only @ ??? :rolleyes: :confused:
Posted on 2003-04-13 07:37:35 by Forginforcer
Forginforcer,

jmp @f means jump to the nearest next anonymous label (f-forward)

Regards,

Vortex
Posted on 2003-04-13 07:46:15 by Vortex
It it wrong to specify the whole path at the existingfileatribut ?
I have choosen FALSE, so the file get rewritet in every case.
Posted on 2003-04-13 08:20:24 by Forginforcer
It depends on your intention.
Posted on 2003-04-13 11:28:45 by Vortex