Function at 0x100059d0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov dword [ebp - 8], 0
mov dword [ebp - 0x18], 2
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18], 0
je 0x100059f7
mov eax, 1
jmp 0x10005b7e
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
mov dword [ecx + 0xc], eax
mov ecx, dword [ebp + 8]
add ecx, 0x20
mov edx, dword [ebp + 8]
mov dword [edx + 0x24], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x24]
mov dword [eax + 0x20], edx
push 0x40
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x1c], eax
push 0x40
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, dword [ebp + 8]
mov dword [edx + 0x10], eax
lea eax, [ebp - 4]
push eax
push 0x40
push 0x40
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 8]
push edx
call fcn.100094e0
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 8]
add eax, 0x20
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x24]
push edx
mov eax, dword [ebp + 0xc]
push eax
call fcn.10009650
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
ja 0x10005a8a
xor eax, eax
jmp 0x10005b7e
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x1c]
push edx
lea eax, [ebp - 0x14]
push eax
push 0x40
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c]
push edx
mov eax, dword [ebp + 8]
add eax, 0x20
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x24]
push edx
mov eax, dword [ebp + 0xc]
push eax
call fcn.10009d40
test eax, eax
jne 0x10005ac2
xor eax, eax
jmp 0x10005b7e
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c]
add edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c]
add edx, dword [ebp - 0x14]
push edx
call fcn.10009570
push 0x40
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea edx, [ebp - 0x20]
push edx
push 0x40
push 0xf
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call fcn.10009570
mov edx, dword [ebp + 8]
mov dword [edx + 0x14], eax
mov eax, dword [ebp + 8]
cmp dword [eax + 0x14], 0
je 0x10005b44
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x14]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x10]
push edx
call sub.ntdll.dll_memcpy
add esp, 0xc
lea eax, [ebp - 4]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
push 0xf
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push 0xf
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov dword [ebp - 8], 1
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov dword [ecx + 0x18], edx
mov eax, dword [ebp - 8]
mov esp, ebp
pop ebp
ret 8