flat assembler
Message board for the users of flat assembler.

Index > Windows > copy a file

Author
Thread Post new topic Reply to topic
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41
how would I use Fasm to Copy a file somewere, I want to make a basic install
that copies a file.

_________________
Want hosting for free for your asm project? You can PM me. (*.fasm4u.net)
Post 13 Apr 2009, 23:32
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
kernel32.dll has file functions.
do you want to copy a file from a to b?
or do you want to make installer which creates and fills file?

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 14 Apr 2009, 02:16
View user's profile Send private message Reply with quote
pal



Joined: 26 Aug 2008
Posts: 227
pal
I'm assuming you mean you have an executable file which in the resource data contains an array of other executable files yeah?

If your on Windows then you should use the resource APIs to get the file into memory, then write them using WriteFile etc.
Post 14 Apr 2009, 08:58
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41
@pal yeah, I want to excute a file.
@Bitshifter, yes from a to b
resource APIs to get the file into memory, then write them using WriteFile etc?
Post 14 Apr 2009, 14:40
View user's profile Send private message Visit poster's website Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:52; edited 1 time in total
Post 14 Apr 2009, 14:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17484
Location: In your JS exploiting you and your system
revolution
No need for the Nt prefix. Just use the normal documented MS API calls.

CreateFile
ReadFile
WriteFile
CloseHandle
Post 14 Apr 2009, 15:03
View user's profile Send private message Visit poster's website Reply with quote
pal



Joined: 26 Aug 2008
Posts: 227
pal
You misinterpreted what I said, what I meant is are you using resource data to store the files or what? EOF data etc? If you are using resource data you use the resource APIs e.g.

FindResource()
OpenRerouce()

And then use the APIs revolution mentioned.
Post 14 Apr 2009, 15:34
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41
thanks, sorry to bother
Post 14 Apr 2009, 15:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.