| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Oct 14, 2007 6:34 pm Post subject: two C++ questions |
|
|
My first question is how do I embed files into an application. For example an installer embeds all the files into the program and then copies them into your hd. Or in a music player it can embed certain files and then play them. How would I do that.
My second question is how do i save certain files like mp3 files into another file. Or, that's not really good phrasing so I'll just give an example. In maplestory it has wz files, but in the wz files are the animation, which of course would be so you can't edit them. But how would I do something like that?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sun Oct 14, 2007 6:47 pm Post subject: |
|
|
Resources.
WZ is basically an archive. (Example is rar/zip.)
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Oct 14, 2007 7:34 pm Post subject: |
|
|
| As Sponge said, your first one would be resource files. A small example, you could import a DLL into a resource file as a 'BIN' resource. Then extract it using FindResource, LoadResource, LockResource, CreateFile and WriteFile (CloseHandle too for the open resource handle). I can write a small example if you need one.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Oct 14, 2007 7:37 pm Post subject: |
|
|
Sure.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Oct 14, 2007 8:37 pm Post subject: |
|
|
Here ya go.
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sun Oct 14, 2007 9:17 pm Post subject: |
|
|
| That's the most portable solution, one disadvantage is when anti virus programs see you have an executable embed as a resource, they will be suspicious of you. A better one would be to embed as an object file at link-time but different compilers use different object file formats.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Oct 14, 2007 9:49 pm Post subject: |
|
|
| appalsap wrote: | | That's the most portable solution, one disadvantage is when anti virus programs see you have an executable embed as a resource, they will be suspicious of you. A better one would be to embed as an object file at link-time but different compilers use different object file formats. |
Depends on the file being extracted from the exe. Most virus scanners are aware that projects can use this method to extract files at runtime incase they are needed, such as the new .NET stuff that packs the required files that the project needs instead of needing the entire .NET framework to be used. All depends on whats in the resource thats being extracted for it to be flagged as a virus or other suspicious software.
As in my example, the embedded source was a hack I made for Nostale that included a speedhack and a chat filter bypass. Norton does not detect it as harmful, nor does any of the other scanners over at http://virusscan.jotti.org/
For the exe containing the dll to be extracted, again, nothing is found.
DLL:
| Code: |
Packers Detected: None
A-Squared
Found nothing
AntiVir
Found nothing
ArcaVir
Found nothing
Avast
Found nothing
AVG Antivirus
Found nothing
BitDefender
Found nothing
ClamAV
Found nothing
CPsecure
Found nothing
Dr.Web
Found nothing
F-Prot Antivirus
Found nothing
F-Secure Anti-Virus
Found nothing
Fortinet
Found nothing
Kaspersky Anti-Virus
Found nothing
NOD32
Found nothing
Norman Virus Control
Found nothing
Panda Antivirus
Found nothing
Rising Antivirus
Found nothing
Sophos Antivirus
Found nothing
VirusBuster
Found nothing
VBA32
Found nothing |
Exe with embedded dll:
| Code: |
Packers Detected: None
A-Squared
Found nothing
AntiVir
Found nothing
ArcaVir
Found nothing
Avast
Found nothing
AVG Antivirus
Found nothing
BitDefender
Found nothing
ClamAV
Found nothing
CPsecure
Found nothing
Dr.Web
Found nothing
F-Prot Antivirus
Found nothing
F-Secure Anti-Virus
Found nothing
Fortinet
Found nothing
Kaspersky Anti-Virus
Found nothing
NOD32
Found nothing
Norman Virus Control
Found nothing
Panda Antivirus
Found nothing
Rising Antivirus
Found nothing
Sophos Antivirus
Found nothing
VirusBuster
Found nothing
VBA32
Found nothing |
|
|
| Back to top |
|
 |
|