flat assembler
Message board for the users of flat assembler.

Index > Windows > How add large files

Author
Thread Post new topic Reply to topic
Nikolay Petrov



Joined: 22 Apr 2004
Posts: 101
Location: Bulgaria
Nikolay Petrov 17 Dec 2005, 23:39
Hi,
Is it possiblle to insert a large files in my compiled program?
for example:
Code:
format PE GUI 4.0
....
.code
.....
.data
file1 file "foo.bin" ;file size ~ 900 MB    
Thanks in advance
Post 17 Dec 2005, 23:39
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 18 Dec 2005, 00:01
Theoretically yes. First, you would need to enable assembler to use that much of memory (for command line fasm it's the "-m" switch). Don't know how Windows would perform with loading such program then, though.
Post 18 Dec 2005, 00:01
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 18 Dec 2005, 00:12
Mame32 for windows is about 35.8MB, and works with windows 95 upwards, so loading a file that big should be any problem, except for windows 3.1 Very Happy .
MadMatt
Post 18 Dec 2005, 00:12
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 18 Dec 2005, 01:27
Is that 35MB compressed with UPX or without?

[EDIT]
Well, I found out that the MAME.EXE for 0.102 (Win32 cmdline version) comes already packed by UPX (8.1 megs compressed). However, MAME claims to need 1Ghz and 128-256 megs of RAM just for half of the games to work. The new 0.102u4 version supports 3205 originals and 2688 clones (which is a lot, since 0.1 only supported 1/1000th of that). Too bad that they only use NASM. Rolling Eyes
[/EDIT]


Last edited by rugxulo on 19 Dec 2005, 23:31; edited 1 time in total
Post 18 Dec 2005, 01:27
View user's profile Send private message Visit poster's website Reply with quote
Nikolay Petrov



Joined: 22 Apr 2004
Posts: 101
Location: Bulgaria
Nikolay Petrov 18 Dec 2005, 02:41
Thanks Smile
I released a little memory and work it.
without performance problems.
Post 18 Dec 2005, 02:41
View user's profile Send private message Reply with quote
Plue



Joined: 15 Dec 2005
Posts: 151
Plue 18 Dec 2005, 07:50
Be aware that when Windows loads a program into memory it loads the entire executable before it starts running. Loading 900mb from any kind of storage but ram will take quite a lot of time.
Post 18 Dec 2005, 07:50
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 18 Dec 2005, 08:35
Does it really? Some EXEs have 600mb (usualy installers), and they load instanly. You only have to figure where to insert extra data (after all sections? Confused)
Post 18 Dec 2005, 08:35
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 18 Dec 2005, 11:45
rugxulo: I don't know
Nickolay: I thought the above was for 900kb Embarassed !! Stupid me, 900MB, WOW, you gonna include a dvd movie in your program or somethin'?!?!? Shocked
Post 18 Dec 2005, 11:45
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 18 Dec 2005, 11:46
AFIAK Windows only maps section into memory (that is: allocates the linear page addresses), without actually loading it all before it's really needed.
Post 18 Dec 2005, 11:46
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 19 Dec 2005, 14:09
So it is possible, but what is the real advantage? As I've seen from games, programs, etc. the data is in a separate file (files) and only iconic data in the main executable. Even installers use ~30KB pieces to load the REALLY-BIG (>1Gig) .cab or .dat files.
I can only think of not fragmenting HDD or RAM if this is the problem at hand, but no other advantage just that "its possible" Very Happy
Post 19 Dec 2005, 14:09
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi 23 Dec 2005, 14:36
ive tested including over 300mb file in data section and it was bitch to compile but worked ok... i suggest writing it to end of the executable and reading it from there... maybe you can write the lenght of data appended to executable to end of the file as dword...

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 23 Dec 2005, 14:36
View user's profile Send private message MSN Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 23 Dec 2005, 15:02
Maybe you can compile them separately and merge them together later. Assembler would not have to have the duty to insert data (in form of code) to the file.

I figured out where you can use it. You can make one big file that you run and it has an embedded player and video image file. Its protected from ripping because only the program embedded in the exe knows how and where to read the video.
Post 23 Dec 2005, 15:02
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 23 Dec 2005, 16:45
Madis731: It's no protection to riping. Nowadays we have musicdisks on demoscene ie. .exes with embedded (sometimes even crypted) music. And it's no special problem to rip it. Also you can always have some other program that works as camera Smile it will record what is shown on the screen to the .avi file.
Post 23 Dec 2005, 16:45
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.