Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Theory & code for getting bitmaps out of resources.

Author
Message
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 4th Feb 2004 17:45 Edited at: 4th Feb 2004 17:50
For those of you who dont know, various types of files can be appended to DLL's and executables. Visual Studio makes it easy by allowing files to be added using its IDE. The harder way is to use a resource hacker to append the resource to the DLL or executable.

Anyway, bitmaps are one type that can be stored. Which means, if the bitmaps from within the file can be used, your graphics can be a lot more secure.

The following messy C code is a routine I knocked up to extract the bitmap from an executable and save it to a file. Its messy because I haven't totally figured out the layout of bitmaps in resources yet, and I've justed tested it with one bitmap at the moment.

I present for your amusement the following :


As you can see its still got all my comments in, and at the moment its not too efficient.

However, the general theory is there.

In order for it to be used in DBPro, the bitmap would need to be extracted, loaded and then immediately deleted, thus presenting no outwardly sign of temporary files being used.

In addition, it could also be used other things, like sound data, mesh data etc etc.

By the way, I use part of IanM's SaveBitmap code...


The place for all great plug-ins.
XP3000+,1Gb RAM,FX5600,1Mb ADSL,Router,.Net 2003 Pro & me
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Feb 2004 00:47
No comments ? 51 views (and they cant all be me), and not a single peep from anyone ?


The place for all great plug-ins.
XP3000+,1Gb RAM,FX5600,1Mb ADSL,Router,.Net 2003 Pro & me
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Feb 2004 01:03
Well ... y'know ... it's not bad I suppose ...

Why not update it to get the bitmap into an image too?

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Northern Fist
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location:
Posted: 6th Feb 2004 02:00
Hmm... very interesting! Howevever, I think more people are worried about making customizeable games, rather than making them secure (just an opinion). However, I could see this useful for stuff like menu themes, etc.

"Power, precision, and don't forget about speed. If you practice everyday with these things in mind... you begin to develope A FIGHTING MODE." - Fist of Legend (Jet Li)
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Feb 2004 13:16
Quote: "Why not update it to get the bitmap into an image too?
"

I'll leave that as an exercise for someone else.


The place for all great plug-ins.
XP3000+,1Gb RAM,FX5600,1Mb ADSL,Router,.Net 2003 Pro & me
Neophyte
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 6th Feb 2004 18:43
@TCA

"No comments ? 51 views (and they cant all be me), and not a single peep from anyone ?"

Well, if it was written in DBPro people might comment more and by coincidence, the people who don't know C could understand what is going on. *hint**hint*

Anyway, for someone who doesn't know C very well, it looks like it could be very usefull. I'll definately be giving this a look later, because I'm pretty sure I'll need it.

FYI, I'm in the early stages of writing a compiler for BASIC4GL. So packing media into an executable sounds like something that I'm eventually going to need to know.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Feb 2004 18:52 Edited at: 6th Feb 2004 18:53
Unfortunately it couldn't be easily written in DBPro - due to casting etc etc... I'm not taking it any further (for the time being anyway) as I'm more interested in multiplayer networking (got a nice little plug-in running for that).


The place for all great plug-ins.
XP3000+,1Gb RAM,FX5600,1Mb ADSL,Router,.Net 2003 Pro & me

Login to post a reply

Server time is: 2024-11-22 00:37:32
Your offset time is: 2024-11-22 00:37:32