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, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
Our Sponsors

Latest Postings
my old account still exists!
by Gizmo
08/19/08 02:27 PM
Burger King gone Wild!
by Gizmo
08/08/08 11:42 PM
PDX 2600
by rbcp
08/07/08 12:46 AM
The Pirate Bay- shut down?
by ZER0_DECEPTION
08/05/08 09:07 PM
Windows Events for Changing Access rights to a folder or a File
by Gizmo
08/05/08 12:32 PM
question about IE and CSS
by §intå×
08/04/08 08:51 PM
Server
by Gizmo
08/01/08 01:29 AM
Miss mash of urban ledgends told so well
by ZER0_DECEPTION
07/28/08 06:35 AM
Topic Options
#17637 - 03/29/02 04:33 PM extracting files from .res
olosoft Offline
Member

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 ****. MIDI.zip. i included the original midi for reference.

Top
Our Sponsors
Sponsor Our Sponsors

Top  
#17638 - 03/29/02 11: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
http://www.dollardns.net

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

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.

Top
#17640 - 04/03/02 11: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
http://www.dollardns.net

Top
#17641 - 05/16/02 07:53 PM Re: extracting files from .res
ninjaneo Offline
Microwavable Pillow Tosser

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

Top



Forum Stats
6911 Members
44 Forums
10414 Topics
45151 Posts

Max Online: 677 @ 06/30/07 10:06 PM
Top Posters
Gizmo 6927
UGN Security 3392
§intå× 3250
IceMyst 1449
SilentRage 1273
Ice 1146
pergesu 1134
Infinite 1039
jonconley 954
Girlie 903
Newest Members
byopc, cybermox, NiPah, mcscrwdy25, mobi
6910 Registered Users
Who's Online
0 Registered (), 8 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Latest News
Update Humpday - Aug 20, 2008
by Gizmo
Today at 01:48 AM
Update Humpday - Aug 14, 2008
by Gizmo
08/14/08 08:33 AM
Update Humpday - Aug 06, 2008
by Gizmo
08/06/08 08:05 AM
Update Humpday - Jul 30th, 2008
by Gizmo
07/31/08 11:17 AM
Photo Gallery Update
by Gizmo
07/25/08 05:14 AM


Donate

Get the Google FireFox Toolbar
Get Firefox!
Get FireFox!