Function at 0x521a40
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x244
mov eax, dword [0x60ef40]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x22c], 0
push 0x21c
push 0
lea eax, [ebp - 0x220]
push eax
call fcn.00537090
add esp, 0xc
mov ecx, 0x208
mov word [ebp - 0x212], cx
lea edx, [ebp - 0x22c]
push edx
movzx eax, word [ebp - 0x212]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00521db0
mov edx, dword [ebp + 8]
push edx
movzx eax, word [ebp - 0x212]
push eax
lea ecx, [ebp - 0x20c]
push ecx
call fcn.00521d50
mov dx, word [ebp - 0x22c]
mov word [ebp - 0x214], dx
mov dword [ebp - 0x230], 0
lea eax, [ebp - 0x230]
push eax
push str.LdrLoadDll
push 0x5d4b10
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0051fd10
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x521b00
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x1c]
mov dword [ecx], eax
mov eax, 6
jmp 0x521cc8
mov edx, dword [ebp - 0x230]
mov dword [ebp - 0x21c], edx
mov eax, 0x521d40
sub eax, 0x521ce0
mov dword [ebp - 0x234], eax
push 0x40
push 0x3000
mov ecx, dword [ebp - 0x234]
add ecx, 0x22c
push ecx
push 0
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0x240], eax
mov eax, dword [ebp - 0x240]
mov dword [ebp - 0x228], eax
mov ecx, dword [ebp - 0x228]
add ecx, 0x22b
and ecx, 0xfffffff0
mov dword [ebp - 0x238], ecx
cmp dword [ebp - 0x228], 0
jne 0x521b81
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp + 0x1c]
mov dword [edx], eax
mov eax, 0xd
jmp 0x521cc8
push 0
push 0x21c
lea eax, [ebp - 0x220]
push eax
mov ecx, dword [ebp - 0x228]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x521bd1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x1c]
mov dword [ecx], eax
push 0x8000
push 0
mov edx, dword [ebp - 0x228]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov eax, 9
jmp 0x521cc8
push 0
mov ecx, dword [ebp - 0x234]
push ecx
push 0x521ce0
mov edx, dword [ebp - 0x238]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x521c21
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x1c]
mov dword [ecx], eax
push 0x8000
push 0
mov edx, dword [ebp - 0x228]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov eax, 9
jmp 0x521cc8
mov dword [ebp - 0x23c], 0
mov ecx, dword [ebp + 0x14]
and ecx, 0x20
je 0x521c3c
mov byte [ebp - 0x221], 1
jmp 0x521c43
mov byte [ebp - 0x221], 0
lea edx, [ebp - 0x23c]
push edx
mov eax, dword [ebp + 0x1c]
push eax
movzx ecx, byte [ebp - 0x221]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp - 0x228]
push eax
mov ecx, dword [ebp - 0x238]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call fcn.005241c0
add esp, 0x1c
mov dword [ebp - 0x244], eax
push 0
push 0x21c
lea eax, [ebp - 0x220]
push eax
mov ecx, dword [ebp - 0x228]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp - 0x23c]
mov dword [eax], ecx
cmp dword [ebp + 0x10], 3
je 0x521cc2
push 0x8000
push 0
mov edx, dword [ebp - 0x228]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov eax, dword [ebp - 0x244]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00534c20
mov esp, ebp
pop ebp
ret