Function at 0x51e814
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffad4
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
call fcn.00404ba8
xor eax, eax
push ebp
push 0x51ea70
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x529]
xor ecx, ecx
mov edx, 0x501
call fcn.00403174
xor ebx, ebx
mov eax, dword [0x52a2d4]
cmp dword [eax], 0
je 0x51ea5a
mov eax, dword [0x52a318]
cmp dword [eax], 0
je 0x51ea5a
mov eax, dword [0x52a998]
push eax
call sub.KERNEL32.DLL_EnterCriticalSection
call sub.KERNEL32.DLL_GetTickCount
mov edx, dword [0x52a5e4]
sub eax, dword [edx]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], 0x5dc
mov eax, dword [ebp + 8]
call fcn.0051e758
test al, al
jne 0x51e8b1
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x10]
jae 0x51e8b1
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
push eax
call sub.KERNEL32.DLL_Sleep
push 0x40
push 0x1000
push 0x1000
push 0
mov eax, dword [0x52a2d4]
mov eax, dword [eax]
push eax
call sub.KERNEL32.DLL_VirtualAllocEx
mov edi, eax
call fcn.00402bb4
mov eax, 0x7d0
call fcn.00403194
mov ebx, eax
add ebx, edi
inc ebx
mov esi, ebx
add esi, 0x1f4
lea eax, [ebp - 0x10]
push eax
push 0x64
mov eax, dword [ebp - 4]
push eax
push ebx
mov eax, dword [0x52a2d4]
mov eax, dword [eax]
push eax
call sub.KERNEL32.DLL_WriteProcessMemory
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
push esi
mov eax, dword [0x52a2d4]
mov eax, dword [eax]
push eax
call sub.KERNEL32.DLL_WriteProcessMemory
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x24], 1
mov eax, dword [0x52a76c]
mov eax, dword [eax + 0x30]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], esi
lea edx, [ebp - 0x28]
mov eax, dword [0x52a76c]
mov eax, dword [eax + 0x34]
add eax, 0x500
mov ecx, 0x14
call fcn.0051a548
mov eax, dword [0x52a87c]
mov eax, dword [eax]
call fcn.0051f1e8
mov eax, dword [0x52a318]
cmp dword [eax], 0
je 0x51e999
mov eax, dword [0x52aaf0]
cmp byte [eax], 0
je 0x51e999
mov eax, dword [0x52a76c]
mov eax, dword [eax + 0x34]
add eax, 0x504
call fcn.0051a3ec
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x51e999
push 0x14
call sub.KERNEL32.DLL_Sleep
jmp 0x51e961
lea eax, [ebp - 0x28]
xor ecx, ecx
mov edx, 0x14
call fcn.00403174
lea edx, [ebp - 0x28]
mov eax, dword [0x52a76c]
mov eax, dword [eax + 0x40]
add eax, 0x500
mov ecx, 0x14
call fcn.0051a548
lea edx, [ebp - 0x529]
mov ecx, 0x501
mov eax, ebx
call fcn.0051a548
mov eax, dword [0x52a69c]
add eax, 0x5c
mov edx, dword [ebp + 8]
call fcn.0040474c
mov eax, dword [0x52a69c]
mov byte [eax + 0x60], 1
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
mov eax, esi
cdq
push edx
push eax
mov eax, dword [ebp - 0xc]
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
push eax
mov eax, dword [0x52a2d4]
mov eax, dword [eax]
push eax
call sub.KERNEL32.DLL_ReadProcessMemory
mov ebx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
call fcn.0051e758
test al, al
jne 0x51ea3a
call sub.KERNEL32.DLL_GetTickCount
xor edx, edx
mov ecx, dword [0x52a5e4]
mov dword [ecx], eax
mov dword [ecx + 4], edx
push 0x8000
push 0
push edi
mov eax, dword [0x52a2d4]
mov eax, dword [eax]
push eax
call sub.KERNEL32.DLL_VirtualFreeEx
mov eax, dword [0x52a998]
push eax
call sub.KERNEL32.DLL_LeaveCriticalSection
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51ea77
lea eax, [ebp + 8]
call fcn.004046f8
ret