Function at 0x413664
Capabilities:
Allocate or change rwx memory

Disassembly:
sub esp, 0x2c
push ebx
mov ebx, ecx
push edi
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ebx
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x440e3c], eax
je 0x41368d
mov eax, 0x10dd
jmp 0x4138d6
mov eax, dword [0x440e40]
test eax, eax
jne 0x4138d6
test ebx, ebx
jne 0x4136a6
push 6
pop eax
jmp 0x4138d6
mov ecx, dword [ebx]
push ebp
push esi
test ecx, ecx
jne 0x4136bc
push 6
pop edi
mov dword [0x440e40], edi
jmp 0x41389c
mov esi, edi
mov ebx, edi
call fcn.0041330b
mov ecx, dword [esp + 0x28]
mov ebp, eax
mov dword [esp + 0x1c], ebp
call fcn.0041330b
mov dword [esp + 0x38], eax
cmp eax, ebp
jne 0x4136ed
cmp dword [0x440e44], ebx
jne 0x413898
jmp 0x41387c
push 0x18
push edi
push dword [0x4420ec]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov dword [esp + 0x34], ebx
test ebx, ebx
jne 0x41370e
push 8
pop edi
jmp 0x41387c
mov ecx, ebp
call fcn.004130dd
mov dword [esp + 0x14], eax
test eax, eax
jne 0x413725
push 8
pop edi
jmp 0x413878
mov edx, eax
add eax, 0x1e
mov dword [esp + 0x10], edx
mov dword [esp + 0x28], eax
mov ebx, ebp
jmp 0x41373a
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x20]
push eax
push ecx
push ebp
mov ecx, edx
mov esi, ebp
mov dword [esp + 0x2c], edi
call fcn.00432c36
mov ecx, eax
mov eax, dword [esp + 0x20]
sub eax, esi
add eax, ecx
add dword [esp + 0x10], eax
mov dword [esp + 0x24], ecx
sub ecx, ebx
mov dword [esp + 0x18], ecx
mov ecx, esi
call fcn.00413050
mov ecx, dword [esp + 0x18]
test eax, eax
jne 0x41377e
mov ebp, dword [esp + 0x24]
cmp ecx, 5
jb 0x413736
mov ebx, dword [esp + 0x34]
cmp ecx, 5
jae 0x4137c3
mov edx, dword [esp + 0x24]
cmp byte [edx], 0x90
jne 0x413804
lea eax, [esp + 0x24]
push eax
push ecx
mov ecx, dword [esp + 0x18]
push edx
mov esi, edx
mov dword [esp + 0x30], edi
call fcn.00432c36
mov edx, eax
mov eax, dword [esp + 0x24]
sub eax, esi
mov ecx, edx
sub ecx, dword [esp + 0x1c]
add eax, edx
add dword [esp + 0x10], eax
mov dword [esp + 0x18], ecx
cmp ecx, 5
jb 0x41378b
mov edx, dword [esp + 0x28]
cmp dword [esp + 0x10], edx
jbe 0x4137ce
int3
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
sub cl, al
mov byte [edx], cl
mov ecx, dword [esp + 0x18]
push ecx
mov byte [eax + 0x36], cl
add eax, 0x20
push esi
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
mov ebp, dword [esp + 0x24]
add esp, 0xc
cmp ebp, 0x19
jbe 0x41381b
push 6
jmp 0x41371f
cmp ecx, 5
jae 0x4137c3
cmp dword [0x440e44], 0
mov esi, dword [esp + 0x14]
push 9
pop edi
jne 0x413882
jmp 0x41387c
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x38]
mov dword [eax + 0x3c], ecx
movzx ecx, byte [eax + 0x1e]
add ecx, eax
lea edx, [esi + ebp]
mov dword [eax + 0x38], edx
lea eax, [ecx + 5]
sub edx, eax
mov eax, dword [esp + 0x28]
mov byte [ecx], 0xe9
mov dword [ecx + 1], edx
add ecx, 5
cmp ecx, eax
jae 0x413859
sub eax, ecx
push eax
push 0xcc
push ecx
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push 0x40
push ebp
push esi
mov dword [esp + 0x40], edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x4138a6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov esi, dword [esp + 0x14]
mov dword [0x440e40], edi
test esi, esi
je 0x41388d
mov ecx, esi
call fcn.004132e5
test ebx, ebx
je 0x413898
mov ecx, ebx
call fcn.00430e28
mov ebx, dword [esp + 0x2c]
mov dword [0x440e28], ebx
mov eax, edi
jmp 0x4138d4
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x14]
mov dword [ebx + 8], eax
mov eax, dword [esp + 0x1c]
mov dword [ebx + 0xc], eax
mov dword [ebx + 4], edi
mov dword [ebx + 0x10], esi
mov eax, dword [esp + 0x30]
mov dword [ebx + 0x14], eax
mov eax, dword [0x440e34]
mov dword [ebx], eax
mov dword [0x440e34], ebx
xor eax, eax
pop esi
pop ebp
pop edi
pop ebx
add esp, 0x2c
ret 0xc