Contribute  :  Web Resources  :  Past Polls  :  Site Statistics  :  Downloads  :  Forum  
    BiW ReversingThe challenge is yours    
 Welcome to BiW Reversing
 Friday, June 22 2018 @ 01:13 PM CEST
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is it possible to have a member of Resource section in other

 
Post new topic   Reply to topic    www.reversing.be Forum Index -> Coding Corner
View previous topic :: View next topic  
Author Message
Zest
Frequent poster
Frequent poster


Joined: 24 Apr 2005
Posts: 56

PostPosted: Fri Oct 06, 2006 10:07 pm    Post subject: Is it possible to have a member of Resource section in other Reply with quote

Hi,
I know that normally people put thier Pictures and Midi files and Dialogues in
a section of a PE file whoch is named RESOURCE SECTION.

Now,I want to know if it's possible to put a Picture in another section of a PE file.

For example in the data segment or in a new segment that we create to keep this information.

I need to konw how you will do this while you are programming.

Please share some ideas and if you have a snippet of code that shows me this method.

The code in C or Assembly is more desirable.

Thanks in advance.
Regards,
Zest.
Back to top
View user's profile Send private message
detten
Site Admin


Joined: 05 Feb 2005
Posts: 317

PostPosted: Sat Oct 07, 2006 8:24 pm    Post subject: Reply with quote

Ofcourse you can put pictures or other data anywhere you want in your code.
Basically all you need to do is store the raw binary stream in your code.
bmp images are often stored in an array. Same way to address it as any other array.

Short answer : yes you can do it, see this example that loads a png from data section :

static const unsigned my_png_data[] =
{ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,
0,0,0,18,0,0,0,19,8,6,0,0,0,157,146,93,
//CUT
34,37,85,1,222,223,203,191,136,240,31,86,93,109,112,92,
215,246,103,0,0,0,0,73,69,78,68,174,66,96,130,

};

int main() {
load_png_image(my_png_data, sizeof my_png_data);
return 0;
}

tip : winhex has a nice feature to convert binary files to c style arrays. Though writing this in c is only a couple of lines code Wink

_________________
Ignorance is bliss, knowledge is power
Back to top
View user's profile Send private message Visit poster's website
Zest
Frequent poster
Frequent poster


Joined: 24 Apr 2005
Posts: 56

PostPosted: Sun Oct 08, 2006 10:16 pm    Post subject: Reply with quote

Hi detten,
Thanks for sharing info.
Your really helped me.
Also let me ask another question.
Imagine that I have a picture in resource section.
I want to encrypt this pcture in resource section and just when the program needs to use it,this picture become decrypted in the program.

I need to know the technique and way of programming you use in this case.

Any ideas,Source codes...?

Regards,
Zest.


Ps:I have to ways to to Encrypt the resource section.
1-Encrypt this sectio After Run-TIME and then Decrypt it when I need to use it.
2-Have the resource section encrypted before run-time and Decrypt it after Run-Time.


So seemingly,two methods are involved in regard of this question.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.reversing.be Forum Index -> Coding Corner All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
 Copyright © 2018 BiW Reversing
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.06 seconds