Function at 0x1005cf10
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x70
push ebx
push esi
mov esi, dword [eax]
push edi
xor edi, edi
cmp dword [0x1013e8dc], edi
jne 0x1005cf3d
push 0x1013e900
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [0x1013e8dc], 1
push 0x1013e900
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
call fcn.1005d1c0
push dword [ebp + 0xc]
mov ebx, eax
mov dword [ebp - 0x14], ebx
call fcn.1005d1c0
push 0x50
mov dword [ebp - 0xc], eax
xorps xmm0, xmm0
lea eax, [ebp - 0x68]
movlpd qword [ebp - 0x70], xmm0
push 0
push eax
call fcn.1006ff30
lea eax, [ebp - 0x70]
push eax
push 5
push ebx
call fcn.1005cd70
mov esi, eax
add esp, 0x20
mov dword [ebp - 0x18], esi
cmp esi, 5
jb 0x1005d10d
push esi
push ebx
call fcn.1005d340
push dword [ebp - 0x64]
push dword [ebp - 0x68]
push dword [ebp - 0x6c]
push dword [ebp - 0x70]
push ebx
call fcn.1005d4d0
mov edi, eax
add esp, 0x1c
test edi, edi
je 0x1005d108
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push eax
push 0x40
push esi
push ebx
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x1005d0ec
lea eax, [ebp - 4]
push eax
push 0x40
push 0x74
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x1005d0ce
xor ecx, ecx
lea eax, [edi + 0x2c]
test esi, esi
je 0x1005d019
mov dword [ebp - 0x10], ebx
mov edx, eax
sub ebx, eax
mov al, byte [ebx + edx]
lea edx, [edx + 1]
mov byte [edx - 1], al
mov byte [edi + ecx + 0x4c], al
inc ecx
cmp ecx, esi
jb 0x1005d001
mov ebx, dword [ebp - 0x14]
lea eax, [edi + 0x2c]
lea ecx, [eax + esi]
lea eax, [ecx + 5]
lea edx, [esi + ebx]
mov dword [ebp - 0x14], eax
cmp eax, edx
jbe 0x1005d02d
sub eax, edx
jmp 0x1005d032
mov eax, edx
sub eax, dword [ebp - 0x14]
cmp eax, 0x7fff0000
ja 0x1005d046
lea eax, [ecx + 5]
mov byte [ecx], 0xe9
sub edx, eax
mov dword [ecx + 1], edx
jmp 0x1005d053
lea eax, [ecx + 6]
mov word [ecx], 0x25ff
mov dword [ecx + 2], eax
mov dword [eax], edx
mov ecx, dword [ebp - 0xc]
cmp ecx, ebx
jae 0x1005d060
mov eax, ebx
sub eax, ecx
jmp 0x1005d064
mov eax, ecx
sub eax, ebx
push ecx
cmp eax, 0x7fff0000
jbe 0x1005d098
lea esi, [edi + 0xc]
push esi
call fcn.1005ce40
add esp, 8
sub eax, edi
sub eax, 0xc
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
push esi
push ebx
call fcn.1005ce40
mov esi, dword [ebp - 0x18]
jmp 0x1005d09e
push ebx
call fcn.1005ce40
mov eax, dword [ebp - 0xc]
add esp, 8
mov dword [edi + 8], eax
lea eax, [edi + 0x2c]
mov dword [edi + 4], esi
mov dword [edi], ebx
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea eax, [ebp - 4]
push eax
push dword [ebp - 4]
push 0x74
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
cmp dword [edi], 0
je 0x1005d0fb
mov ecx, dword [ebp + 8]
lea eax, [edi + 0x2c]
mov dword [ecx], eax
jmp 0x1005d108
push 1
push edi
call fcn.1005d570
add esp, 8
xor edi, edi
call fcn.1005d130
push 0x1013e900
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
test edi, edi
pop edi
pop esi
setne al
pop ebx
mov esp, ebp
pop ebp
ret