Previous Thread
Next Thread
Print Thread
Rate Thread
#17637 03/29/02 02:33 PM
Joined: Mar 2002
Posts: 143
olosoft Offline OP
Member
OP 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.

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
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
Joined: Mar 2002
Posts: 143
olosoft Offline OP
Member
OP 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.

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
-----------
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. smile 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
Joined: Mar 2002
Posts: 256
Likes: 1
UGN Security Staff
Offline
UGN Security Staff
Joined: Mar 2002
Posts: 256
Likes: 1
Umm.. olo You could output the file and just chop off the 4 first characters.. Thats wut microsoft would do...


Link Copied to Clipboard
Member Spotlight
Posts: 43
Joined: November 2002
Forum Statistics
Forums41
Topics33,840
Posts68,858
Average Daily Posts1
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Where and how do you torrent?
by danni75 - 03/01/24 05:58 AM
Animation,
by JohanKaariainen - 08/15/19 01:18 AM
Blackbeard.....
by Gremelin - 10/03/18 07:02 PM
my old account still exists!
by Crime - 08/10/18 02:47 PM
Okay WTF?
by HenryMiring - 09/27/17 01:45 AM
The History Thread...
by Gremelin - 08/11/17 12:11 PM
My friend NEEDS your HELP!
by Lena01 - 07/21/17 12:06 AM
I'm having fun with this guy.
by gabithompson730 - 07/20/17 01:50 AM
I want to upgrade my phone
by gabithompson730 - 07/20/17 01:49 AM
Doom 3
by Cyrez - 09/11/14 08:58 PM
Amazon Gift Card Generator/KeyGen?te
by Gecko666 - 08/22/14 09:21 AM
AIM scene 99-03
by lavos - 09/02/13 08:06 AM
Planetside 2
by Crime - 03/04/13 07:10 AM
Beta Testers Wanted
by Crime - 03/04/13 06:55 AM
Hello Everyone
by Gremelin - 02/12/12 06:01 PM
Tracfone ESN Generator
by Zanvin Green - 01/18/12 01:31 PM
Python 3 issue
by Testing - 12/17/11 09:28 PM
tracfone airtime
by Drache86 - 07/30/11 03:37 AM
Backdoors and the Infinite
by ZeroCoolStar - 07/10/11 03:52 AM
HackThisZIne #12 Releaseed!
by Pipat2 - 04/28/11 09:20 PM
gang wars? l33t-wars?
by Gremelin - 04/28/11 05:56 AM
Consolidate Forums
by diggin2deep - 04/21/11 10:02 AM
LAN Hacking Noob
by Gremelin - 03/12/11 12:42 AM
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
unreal 1
Crime 1
Ice 1
Dartur 1
Powered by UBB.threads™ PHP Forum Software 7.7.5