Function at 0x40954b
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 0x409562
mov dword [eax], ebx
mov eax, dword [ebp + 0x14]
cmp eax, ebx
je 0x40956b
mov dword [eax], ebx
mov edi, dword [ebp + 0x18]
cmp edi, ebx
je 0x409574
mov dword [edi], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x437ae4], eax
je 0x40958c
mov eax, 0x10dd
jmp 0x4097d2
mov eax, dword [0x437ae8]
cmp eax, ebx
jne 0x4097d2
mov ecx, dword [ebp + 8]
cmp ecx, ebx
jne 0x4095a8
push 6
pop eax
jmp 0x4097d2
mov eax, dword [ecx]
cmp eax, ebx
jne 0x4095bb
push 6
pop eax
mov dword [0x437ae8], eax
jmp 0x4097cc
push ebx
push eax
mov dword [ebp - 0x10], ebx
call fcn.00408efc
push 0
mov esi, eax
push dword [ebp + 0xc]
call fcn.00408efc
cmp eax, esi
mov dword [ebp + 0xc], eax
jne 0x4095ea
cmp dword [0x437adc], 0
jne 0x4097c6
jmp 0x40979a
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x4095f3
mov dword [ecx], esi
test edi, edi
je 0x4095f9
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 0x409614
mov dword [ebp - 4], 8
jmp 0x40979a
push esi
call fcn.0040982c
mov ebx, eax
pop ecx
test ebx, ebx
je 0x409608
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40962a
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 0x40964a
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.00409c18
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.004097d9
test eax, eax
pop ecx
jne 0x4096a4
cmp dword [ebp + 0x18], 5
jb 0x409647
cmp dword [ebp + 0x18], 5
jae 0x4096ca
mov eax, dword [ebp - 0x14]
cmp byte [eax], 0x90
jne 0x4096c0
inc eax
mov dword [ebp - 0x14], eax
sub eax, esi
cmp eax, 5
mov dword [ebp + 0x18], eax
jb 0x4096aa
cmp dword [ebp + 0x18], 5
jb 0x40978a
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 8]
jbe 0x4096d3
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 0x409702
mov dword [ebp - 4], 6
jmp 0x40979a
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 0x40973d
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 0x409760
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x40979a
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 [0x437af4]
mov dword [eax], ecx
mov dword [0x437af4], eax
xor eax, eax
jmp 0x4097d2
cmp dword [0x437adc], 0
mov dword [ebp - 4], 9
jne 0x4097a2
mov eax, dword [ebp - 4]
mov dword [0x437ae8], eax
test ebx, ebx
je 0x4097b7
push ebx
call fcn.00409176
mov eax, dword [ebp + 0x10]
pop ecx
test eax, eax
je 0x4097b7
and dword [eax], 0
cmp dword [ebp - 0x10], 0
je 0x4097c6
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 [0x437aec], ecx
pop edi
pop esi
pop ebx
leave
ret 0x14