UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
Su M Tu W Th F Sa
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Sponsored Links
Latest Postings
The History Thread...
by Cyrez
08/11/15 12:11 AM
Latest Reviews
Topic Options
Rate This Topic
#17637 - 03/29/02 01:33 PM extracting files from .res
olosoft Offline

Registered: 03/02/02
Posts: 143
Loc: .
ok. basicaly i have a vb app that has a resource file attached to it. the resource file contains a midi. now, i want the program to load, extract the midi to a file, and then play it. i currently have it save the file by opening a file for output as binary and the using the put# command to output whole string, array of bytes converted to sting, to the file at once.

my problem is that when vb outputs to the file, it automaticaly adds " \" to the beggining of the file, and when i compare the outputed midi to the original, it says they differ starting at the fourth character.

i have tried outputing one cell of the vector at a time. that didnt work because vb was adding that **** to the beggining of each character then. i tried the API create file and write file stuff, but it wasnt creating the file at all.

any help would be appreciated.
heres a zip with all the ****. i included the original midi for reference.

Sponsored Links
#17638 - 03/29/02 08:38 PM Re: extracting files from .res
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
with the Put statement you need to make sure the data is in a STRING variable. Not a variant/string or any other type. Just a STRING. If you must, use the CStr() function to convert the data to a string type. It will then save the data properly. Otherwise, it prepends variable type information so that when you load the data using the opposite of Put (I forget what) it will be loaded as the proper type.

As for the API - you probably wasn't using the CreateFile function with the CREATE_NEW flag set.
Domain Registration, Hosting, Management

#17639 - 04/02/02 07:10 PM Re: extracting files from .res
olosoft Offline

Registered: 03/02/02
Posts: 143
Loc: .
thanks SR, but, hrm, yea, the convert to string fuction didnt really work, kindof made it worse. lol. before at least the right characters were there, just seperated by 4 weird characters. now its all weird ****. ill try the API method again.

do you know of any other *simpler* way of attaching a file to the exe and then exporting it to a seperate file uppon execution?

oh, and one more thing. when i opened up my program with a hex editor, theres all the blank space in there, like, null characters. is there a way of compressing the exe to get rid of that space so that the exe will be smaller, yet still able to run? (i found out that you cant just delete it the hard way)

thanks again SR. i love you.

#17640 - 04/03/02 08:03 AM Re: extracting files from .res
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
You haven't been to my site for a very long time have you? I compress ALL my programs now to make the EXE's smaller. A 40KB VB EXE can easily be shrunk down to 12KB. Also, since it compresses - all plain text in the EXE file is no longer plain text. You may use the program to only optimize your EXE without compressing - or do both. It was written in assembler. To force you to visit my site, I'm not going to tell you where I got the program. Instead, you'll just have to go to my site's Recommended Links page and find out for yourself. heh
And uh, I know what I'm talking about here. If you do this:

Open File For Binary As #1
Put #1, , CStr(AnyVariable)
Close #1

It will properly save EXACTLY what's in that variable and nothing more and nothing less.
As for an alternative to using resource files, see if you can do something with PEBundle by the same guy who made the EXE compresser.
Domain Registration, Hosting, Management

#17641 - 05/16/02 04:53 PM Re: extracting files from .res
ninjaneo Offline
UGN Security Staff

Registered: 03/06/02
Posts: 256
Loc: CA, USA
Umm.. olo You could output the file and just chop off the 4 first characters.. Thats wut microsoft would do...


Featured Member
Registered: 02/28/02
Posts: 7193
Forum Stats
2154 Members
46 Forums
40682 Topics
75855 Posts

Max Online: 1567 @ 04/25/10 02:20 AM
Top Posters
UGN Security 33844
Gremelin 7193
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
Suri John, boa, claralobo, cdefgh368568, HushHush
2153 Registered Users
Who's Online
0 registered (), 283 Guests and 201 Spiders online.
Key: Admin, Global Mod, Mod
Latest News

  Get Firefox!
Get FireFox!