XOR Encryption in x64 Assembly: Fixed Key, Rolling Key & the lea vs mov Pointer Bug | No libc

XOR encryption in assembly is three operations: open a file, XOR each byte against a key in a tight loop, write the output. The fixed-key version is eight instructions per iteration; the rolling-key version adds one — add r15b, 0x11 — which updates the key every cycle and wraps automatically at 0xFF because r15b is 8-bit. Both versions decrypt with the same code. The real lesson is a pointer bug that every assembly programmer hits: mov rdx, [buffer] dereferences the label, turning file data into a memory address and segfaulting; lea rdx, [buffer] takes the address itself.

October 8, 2026 · 8 min · JM00NJ
XOR Encryption in x64 Assembly: Fixed Key, Rolling Key & the lea vs mov Pointer Bug | No libc

TCP Reverse Shell in Pure x64 Assembly: PIC Shellcode, Syscall Chain & dup2 FD Redirection | No libc

Implementing a reverse shell in pure x64 Assembly exposes the raw POSIX syscall sequence: socket() creates the TCP FD, connect() establishes the outbound connection, dup2() iterates 2→1→0 to redirect all three standard streams to the socket, execve() spawns /bin/sh which inherits the redirected FDs. PIC Stack Anchor (sub rsp,0x8000 + and rsp,-16 + mov rbp,rsp) enables ASLR-safe deployment — no absolute addresses, no .data/.bss, sockaddr_in struct copied from .text to writable stack via rep movsb. Zero libc, zero external dependencies.

April 3, 2026 · 9 min · JM00NJ
TCP Reverse Shell in Pure x64 Assembly: PIC Shellcode, Syscall Chain & dup2 FD Redirection | No libc
DigitalOcean Referral Badge