flat assembler
Message board for the users of flat assembler.

Index > Main > [solved] Xor qword

Author
Thread Post new topic Reply to topic
AE



Joined: 07 Apr 2022
Posts: 72
AE 11 Apr 2022, 17:37
What would be the shortest way to implement such a pseudocode
Code:
xor rax, 7E7E7E7E7E7E7E7Eh    
Post 11 Apr 2022, 17:37
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 817
Location: Russian Federation, Sochi
ProMiNick 11 Apr 2022, 17:48
if operand cannot be encoded as imm part of instruction fastest way to place it in initialized data:
Code:
format PE64 GUI
entry start

section '.text' code readable executable

  start:
        xor     rax,qword[xorpattern]

section '.data' data readable writeable

  xorpattern db 8 dup ($7E)    
Post 11 Apr 2022, 17:48
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 11 Apr 2022, 20:05
You can do 64-bit loads into an unused register.
Code:
mov r8, 0x7E7E7E7E7E7E7E7E
xor rax, r8    
Post 11 Apr 2022, 20:05
View user's profile Send private message Visit poster's website Reply with quote
AE



Joined: 07 Apr 2022
Posts: 72
AE 11 Apr 2022, 20:27
Thanks! That's it.
Post 11 Apr 2022, 20:27
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.