Function at 0x409f5e
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 0x10]
push ebx
xor ebx, ebx
push esi
cmp eax, ebx
push edi
mov dword [ebp - 4], ebx
je 0x409f75
mov dword [eax], ebx
mov eax, dword [ebp + 0x14]
cmp eax, ebx
je 0x409f7e
mov dword [eax], ebx
mov edi, dword [ebp + 0x18]
cmp edi, ebx
je 0x409f87
mov dword [edi], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x438b94], eax
je 0x409f9f
mov eax, 0x10dd
jmp 0x40a1e5
mov eax, dword [0x438b98]
cmp eax, ebx
jne 0x40a1e5
mov ecx, dword [ebp + 8]
cmp ecx, ebx
jne 0x409fbb
push 6
pop eax
jmp 0x40a1e5
mov eax, dword [ecx]
cmp eax, ebx
jne 0x409fce
push 6
pop eax
mov dword [0x438b98], eax
jmp 0x40a1df
push ebx
push eax
mov dword [ebp - 0x10], ebx
call fcn.0040990f
push 0
mov esi, eax
push dword [ebp + 0xc]
call fcn.0040990f
cmp eax, esi
mov dword [ebp + 0xc], eax
jne 0x409ffd
cmp dword [0x438b8c], 0
jne 0x40a1d9
jmp 0x40a1ad
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x40a006
mov dword [ecx], esi
test edi, edi
je 0x40a00c
mov dword [edi], eax
push 0x18
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [ebp - 0x10], eax
jne 0x40a027
mov dword [ebp - 4], 8
jmp 0x40a1ad
push esi
call fcn.0040a23f
mov ebx, eax
pop ecx
test ebx, ebx
je 0x40a01b
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40a03d
mov dword [eax], ebx
lea edi, [ebx + 0x38]
push 8
push 0
push edi
call sub.MSVCRT.dll_memset
lea ecx, [ebx + 0x1e]
add esp, 0xc
mov eax, esi
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ecx
jmp 0x40a05d
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x18]
and dword [ebp - 0x18], 0
push ecx
push 0
mov dword [ebp - 0x1c], eax
push eax
lea eax, [ebp - 8]
push eax
push dword [ebp - 4]
call fcn.0040a62b
mov ecx, eax
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0x1c]
mov dl, 0x1f
push dword [ebp - 0x1c]
mov dword [ebp - 0x14], ecx
add eax, ecx
sub ecx, esi
add dword [ebp - 4], eax
mov al, byte [edi]
mov byte [ebp + 0x17], al
mov al, bl
imul dl
add al, byte [ebp - 4]
mov dword [ebp + 0x18], ecx
and cl, 7
shl al, 3
xor al, cl
mov byte [edi], al
call fcn.0040a1ec
test eax, eax
pop ecx
jne 0x40a0b7
cmp dword [ebp + 0x18], 5
jb 0x40a05a
cmp dword [ebp + 0x18], 5
jae 0x40a0dd
mov eax, dword [ebp - 0x14]
cmp byte [eax], 0x90
jne 0x40a0d3
inc eax
mov dword [ebp - 0x14], eax
sub eax, esi
cmp eax, 5
mov dword [ebp + 0x18], eax
jb 0x40a0bd
cmp dword [ebp + 0x18], 5
jb 0x40a19d
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 8]
jbe 0x40a0e6
int3
push dword [ebp + 0x18]
sub al, bl
mov byte [ebx + 0x1e], al
mov al, byte [ebp + 0x18]
mov byte [ebx + 0x36], al
lea eax, [ebx + 0x20]
push esi
push eax
call sub.MSVCRT.dll_memcpy
mov ecx, dword [ebp + 0x18]
add esp, 0xc
cmp ecx, 0x19
jbe 0x40a115
mov dword [ebp - 4], 6
jmp 0x40a1ad
mov eax, dword [ebp + 0xc]
add ecx, esi
mov dword [ebx + 0x44], eax
mov dword [ebx + 0x40], ecx
movzx eax, byte [ebx + 0x1e]
add eax, ebx
lea edx, [eax + 5]
mov byte [eax], 0xe9
inc eax
sub ecx, edx
mov dword [eax], ecx
mov ecx, dword [ebp - 8]
lea edi, [eax + 4]
cmp edi, ecx
jae 0x40a150
sub ecx, edi
mov eax, 0xcccccccc
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [ebp - 0xc]
and dword [ebp - 0xc], 0
push eax
push 0x40
push dword [ebp + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x40a173
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x40a1ad
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
and dword [eax + 4], 0
mov dword [eax + 8], ecx
mov dword [eax + 0x10], ebx
mov dword [eax + 0xc], esi
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0x14], ecx
mov ecx, dword [0x438ba4]
mov dword [eax], ecx
mov dword [0x438ba4], eax
xor eax, eax
jmp 0x40a1e5
cmp dword [0x438b8c], 0
mov dword [ebp - 4], 9
jne 0x40a1b5
mov eax, dword [ebp - 4]
mov dword [0x438b98], eax
test ebx, ebx
je 0x40a1ca
push ebx
call fcn.00409b89
mov eax, dword [ebp + 0x10]
pop ecx
test eax, eax
je 0x40a1ca
and dword [eax], 0
cmp dword [ebp - 0x10], 0
je 0x40a1d9
push dword [ebp - 0x10]
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
pop ecx
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov dword [0x438b9c], ecx
pop edi
pop esi
pop ebx
leave
ret 0x14