flat assembler
Message board for the users of flat assembler.
Index
> Windows > copyfile to, not more! |
Author |
|
Reverend 19 Feb 2006, 01:16
Win32 Reference wrote: BOOL CopyFile( |
|||
19 Feb 2006, 01:16 |
|
XY2k 19 Feb 2006, 03:15
Thx Reverend, but the code is not complete. You must know, i´m a newbie and can only compile the source-code. Can u please make it finish with this names...look here --> Example:
Copy File C:\programmes\bla\xy.exe to C:\programmes\renamedfile.exe regards, XY2k |
|||
19 Feb 2006, 03:15 |
|
dead_body 19 Feb 2006, 09:18
Quote: Example: Code: push 0 Call label1 db "C:\programmes\renamedfile.exe ",0 label1: Call label2 db "C:\programmes\bla\xy.exe",0 label2: Call [CopyFile] it must work good, i think. |
|||
19 Feb 2006, 09:18 |
|
XY2k 19 Feb 2006, 12:50
Sorry it doesn´t work
Code: BOOL CopyFile( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists ); push 0 Call label1 db "C:\programmes\renamedfile.exe ",0 label1: Call label2 db "C:\programmes\bla\xy.exe",0 label2: Call [CopyFile] by compiling with cmd it say : copy.asm[1] BOOL CopyFile( error invalid expression And when i want only compile the second code: Code: push 0 Call label1 db "C:\programmes\renamedfile.exe ",0 label1: Call label2 db "C:\programmes\bla\xy.exe",0 label2: Call [CopyFile] It say: --> Call [CopyFile] "is undefined symbol" regards, XY2k |
|||
19 Feb 2006, 12:50 |
|
UCM 19 Feb 2006, 15:33
you need to do put it in a PE executable.
Code: include 'win32ax.inc' format PE console 4.0 .data label2 db 'C:\blah\blah.blah',0 label1 db 'C:\from.exe',0 .code start: invoke CopyFile, label1, label2, 0 invoke ExitProcess,0 .end start Edit: attached code that will process the command line it goes like this: cp FromFile ToFile
_________________ This calls for... Ultra CRUNCHY Man! Ta da!! *crunch* |
|||||||||||
19 Feb 2006, 15:33 |
|
XY2k 21 Feb 2006, 09:02
THX UCM...its work
|
|||
21 Feb 2006, 09:02 |
|
Flier-Mate 23 Jun 2023, 16:33
I got this error when use CopyFile Win32 API...... Is it not in Kernel32.dll, what does the error mean?
Quote: C:\Users\BOO\Projects>sfc /scanfile=c:\windows\system32\kernel32.dll
|
||||||||||
23 Jun 2023, 16:33 |
|
revolution 23 Jun 2023, 16:49
It means your source file is corrupted in some way.
|
|||
23 Jun 2023, 16:49 |
|
Flier-Mate 03 Jul 2023, 00:51
revolution wrote: It means your source file is corrupted in some way. Finally I found out why, because the correct API is "CopyFileA", not "CopyFile", but strange, both can compile without error. |
|||
03 Jul 2023, 00:51 |
|
revolution 03 Jul 2023, 04:58
The name matching is done at runtime. You can put any text you want for API names and it won't fail until you try to run it.
|
|||
03 Jul 2023, 04:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.