flat assembler
Message board for the users of flat assembler.

Index > Windows > How to insert code and resize PE file?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
snify



Joined: 02 Dec 2004
Posts: 39
snify 06 Feb 2008, 15:19
well ok.. so adding section is maybe the way. but how to use buffer from another section? Neutral the exe is written in C. maybe somehow to read it's own pe header and get the entry point of the new section?
Post 06 Feb 2008, 15:19
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19491
Location: In your JS exploiting you and your system
revolution 06 Feb 2008, 15:42
If adding a section is to problematic then you could consider putting your byte codes in a resource. Then your c-code can find the data using windows standard resource API's.
Post 06 Feb 2008, 15:42
View user's profile Send private message Visit poster's website Reply with quote
snify



Joined: 02 Dec 2004
Posts: 39
snify 06 Feb 2008, 18:16
So anyway, then I should add a resource section, resize it and get the bytecode using api. I really prefer to read bytecode in the normal way, so there's 2 ways:

1. To move the import section upward and resize the code section -
The problem is that I'm using TCC (TinyC), and there's no such options.
2. Add a new section with the bytecode and then read it -
How to reach it using C? Self-reading PE code?

someone get me an idea how to do one of these
Post 06 Feb 2008, 18:16
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19491
Location: In your JS exploiting you and your system
revolution 06 Feb 2008, 18:59
snify: There is no "normal way". What you are doing is not normal.

If you insist on adding a section then imghelp.dll may be useful to you. Google it, I've never used it but I know it exists.
Post 06 Feb 2008, 18:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
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 cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.