Function at 0x4999a0
Capabilities:
Allocate or change rwx memory

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x64
push ebx
push ebp
push esi
xor ebp, ebp
xor esi, esi
push edi
mov edi, dword [eax]
cmp dword [0x550aa8], ebp
jne 0x4999e1
push 0x550990
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x100
push ebp
push 0x5509a8
call fcn.004a99e0
add esp, 0xc
mov dword [0x550aa8], 1
push 0x550990
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, edi
call fcn.00499720
mov ebx, eax
mov eax, dword [esp + 0x7c]
call fcn.00499720
push 0x50
lea ecx, [esp + 0x28]
push ebp
push ecx
mov dword [esp + 0x88], eax
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
call fcn.004a99e0
lea edx, [esp + 0x28]
push edx
push 5
mov ecx, ebx
call fcn.004998d0
mov edi, eax
add esp, 0x14
cmp edi, 5
jb 0x499ba2
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
push eax
mov eax, dword [esp + 0x20]
push ecx
push edx
push eax
mov eax, ebx
call fcn.004997a0
mov esi, eax
add esp, 0x10
cmp esi, ebp
je 0x499ba2
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [esp + 0x18]
push ecx
push 0x40
push edi
mov ebp, eax
xor eax, eax
push ebx
push ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x499b57
lea edx, [esp + 0x10]
push edx
push 0x40
push 0x6c
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x499b3b
xor ebp, ebp
lea eax, [esi + 0x2c]
test edi, edi
jbe 0x499ac1
mov edx, ebx
sub edx, eax
mov cl, byte [edx + eax]
mov byte [eax], cl
mov byte [esi + ebp + 0x4c], cl
inc ebp
inc eax
cmp ebp, edi
jb 0x499ab2
lea ecx, [edi + ebx]
lea eax, [esi + edi + 0x2c]
call fcn.00499760
mov ebp, dword [esp + 0x7c]
cmp ebp, ebx
jae 0x499adb
mov eax, ebx
sub eax, ebp
jmp 0x499adf
mov eax, ebp
sub eax, ebx
mov ecx, ebp
cmp eax, 0x7fff0000
jbe 0x499b08
lea eax, [esi + 0xc]
call fcn.00499760
sub eax, esi
sub eax, 0xc
push eax
lea eax, [esi + 0xc]
push eax
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea ecx, [esi + 0xc]
mov eax, ebx
call fcn.00499760
push edi
lea eax, [esi + 0x2c]
mov dword [esi + 8], ebp
mov ebp, dword [esp + 0x18]
push eax
push ebp
mov dword [esi + 4], edi
mov dword [esi], ebx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x10]
push ecx
push edx
push 0x6c
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
push edi
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x18]
push eax
push ecx
push edi
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
cmp dword [esi], 0
je 0x499b67
mov eax, dword [esp + 0x78]
lea edx, [esi + 0x2c]
mov dword [eax], edx
jmp 0x499ba2
xor eax, eax
lea esp, [esp]
cmp dword [eax*4 + 0x5509a8], esi
je 0x499b81
inc eax
cmp eax, 0x40
jb 0x499b70
jmp 0x499ba0
push 0x8000
push 0
push esi
mov dword [eax*4 + 0x5509a8], 0
call dword [sym.imp.KERNEL32.dll_VirtualFree]
dec dword [0x550aac]
xor esi, esi
push 0x550990
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
xor eax, eax
test esi, esi
pop esi
pop ebp
setne al
pop ebx
add esp, 0x64
ret