Your browser does not seem to support CSS. If images appear below, please disregard them.
It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
#17637 - 03/29/02 09:33 PM extracting files from .res  
Joined: Mar 2002
Posts: 143
olosoft Offline
Member
olosoft  Offline
Member

Joined: Mar 2002
Posts: 143
.
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 ****. MIDI.zip. i included the original midi for reference.

Sponsored Links
#17638 - 03/30/02 04:38 AM Re: extracting files from .res  
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage  Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
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
http://www.dollardns.net
#17639 - 04/03/02 03:10 AM Re: extracting files from .res  
Joined: Mar 2002
Posts: 143
olosoft Offline
Member
olosoft  Offline
Member

Joined: Mar 2002
Posts: 143
.
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 04:03 PM Re: extracting files from .res  
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage  Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
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
http://www.dollardns.net
#17641 - 05/16/02 11:53 PM Re: extracting files from .res  
Joined: Mar 2002
Posts: 256
ninjaneo Offline
UGN Security Staff
ninjaneo  Offline
UGN Security Staff

Joined: Mar 2002
Posts: 256
CA, USA
Umm.. olo You could output the file and just chop off the 4 first characters.. Thats wut microsoft would do...

Sponsored Links

Member Spotlight
Crime
Crime
SC, usa
Posts: 506
Joined: March 2002
Show All Member Profiles 
Forum Statistics
Forums45
Topics46,827
Posts81,997
Average Daily Posts10
Members2,159
Most Online1,567
Apr 25th, 2010
Latest Postings
Top Posters(All Time)
UGN Security 39,991
Gremelin 7,195
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
Ghost Likes: 1
Gremelin Likes: 4
Ice Likes: 1
unreal Likes: 1
Top Liked Users (30 Days)
No Data Found
Powered by UBB.threads™ PHP Forum Software 7.6.0
(Snapshot build 20160902)