flat assembler
Message board for the users of flat assembler.

Index > Windows > a simple file encrypting

Author
Thread Post new topic Reply to topic
fasmis



Joined: 07 Sep 2008
Posts: 1
fasmis 07 Sep 2008, 21:31
hi all
i want write a simple file encrypting like this :
http://board.flatassembler.net/topic.php?t=8951
but WITHOUT ANY MACRO , completely in assembly .
but i don't know how . please help me .
thanks in advance .
Post 07 Sep 2008, 21:31
View user's profile Send private message Reply with quote
dxl



Joined: 17 Sep 2005
Posts: 16
dxl 07 Sep 2008, 22:55
A macro isn't a function.
If you dont know anything about PE format, it would be hard to write such stuff.
Post 07 Sep 2008, 22:55
View user's profile Send private message Reply with quote
pal



Joined: 26 Aug 2008
Posts: 227
pal 08 Sep 2008, 06:54
Map the file to memory/read it to memory, verify its a PE file, optional but useful. Get the offset to the code/text/data/whatever section you wish to encrypt from the PE header, encrypt it. As for the actual code cave for the decryption, I am not sure on how to do that...
Post 08 Sep 2008, 06:54
View user's profile Send private message Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid 08 Sep 2008, 08:16
you can add the size of your decryptor to the last section and copy there or create a new section and copy the decryptor to it. You also need to modify the EntryPoint in PE header to point to your decryptor (in last section or in the new section). At finish you must "jump" to the original entrypoint so the original program will execute.
Post 08 Sep 2008, 08:16
View user's profile Send private message Reply with quote
dxl



Joined: 17 Sep 2005
Posts: 16
dxl 09 Sep 2008, 10:48
do not forget to add the Writing attribute to the section you want to encrypt especially the code section.
Post 09 Sep 2008, 10:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.