flat assembler
Message board for the users of flat assembler.

Index > Main > fasm1 post processing

Author
Thread Post new topic Reply to topic
Ali.Z



Joined: 08 Jan 2018
Posts: 718
Ali.Z 09 Jun 2024, 11:29
is there any way to post process a block of code or data or both in fasm1?

say after assembling a block instructions i want to xor every byte with a key.

i dont mind incremental xor too.

the goal is to rely on fasm instead of external tool to xor that block of bytes.

if important my xor key is 87h or 135d.

_________________
Asm For Wise Humans
Post 09 Jun 2024, 11:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20340
Location: In your JS exploiting you and your system
revolution 09 Jun 2024, 11:57
Code:
while % <= $-$$
 load x byte from $$+%-1
 store byte x xor the_key to $$+%-1
end while    
Post 09 Jun 2024, 11:57
View user's profile Send private message Visit poster's website Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 718
Ali.Z 09 Jun 2024, 12:49
i tried different ways, but i dont seem to understand how to use it. Sad

first thing i replaced the_key with 87h, then i tried to place instructions before end while, but nothing happens. (also tried other ways)

would you please provide an example? thanks.

_________________
Asm For Wise Humans
Post 09 Jun 2024, 12:49
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 09 Jun 2024, 14:35
See https://board.flatassembler.net/topic.php?t=2126 for a more thorough example.
Post 09 Jun 2024, 14:35
View user's profile Send private message Visit poster's website Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 718
Ali.Z 09 Jun 2024, 15:23
thank you.

_________________
Asm For Wise Humans
Post 09 Jun 2024, 15:23
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.