Function at 0x522720
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov dword [ebp - 4], ecx
push 0x40
push 0x3000
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x18]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edx, dword [ebp - 4]
mov dword [edx + 4], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 4], 0
jne 0x522763
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
mov eax, 4
jmp 0x5228e5
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x3c]
and eax, 8
je 0x52279e
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
push eax
call fcn.0055e3f0
add esp, 4
call fcn.0055e3b0
and eax, 0x80000fff
jns 0x522790
dec eax
or eax, 0xfffff000
inc eax
add eax, 0x10f
and eax, 0xfffffff0
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x20], eax
mov edx, 0x5231d0
sub edx, 0x522cc0
mov dword [ebp - 8], edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x20]
mov edx, dword [ebp - 4]
add ecx, dword [edx + 0x18]
mov eax, dword [ebp - 8]
lea ecx, [ecx + eax + 0x14]
mov edx, dword [ebp - 4]
mov dword [edx + 0x1c], ecx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x3c]
and ecx, 8
je 0x52282a
push 0x40
push 0x3000
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x1c]
push eax
push 0
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x24], eax
mov edx, dword [ebp - 4]
cmp dword [edx + 0x24], 0
jne 0x522825
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
push 0x8000
push 0
mov edx, dword [ebp - 4]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, 3
jmp 0x5228e5
jmp 0x5228b0
push 0x40
push 0x3000
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x1c]
push edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x10]
mov edx, dword [ecx + 0x1c]
push edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edx, dword [ebp - 4]
mov dword [edx + 0x24], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x24], 0
jne 0x5228b0
push 0x40
push 0x3000
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x1c]
push edx
push 0
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edx, dword [ebp - 4]
mov dword [edx + 0x24], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x24], 0
jne 0x5228b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
push 0x8000
push 0
mov edx, dword [ebp - 4]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, 3
jmp 0x5228e5
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x24]
mov eax, dword [ebp - 4]
add edx, dword [eax + 0x20]
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x28], edx
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x28]
mov ecx, dword [ebp - 4]
add eax, dword [ecx + 0x18]
mov edx, dword [ebp - 4]
mov dword [edx + 0x30], eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x30]
add ecx, 0x14
mov edx, dword [ebp - 4]
mov dword [edx + 0x2c], ecx
xor eax, eax
mov esp, ebp
pop ebp
ret 4