Function at 0x40e4d7
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push edi
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x4551cc], eax
je 0x40e4f8
mov eax, 0x10dd
jmp 0x40e6df
mov eax, dword [0x4551d0]
test eax, eax
jne 0x40e6df
mov ecx, dword [0x4552a0]
push ebx
push esi
test ecx, ecx
jne 0x40e51f
push 6
pop edi
mov dword [0x4551d0], edi
jmp 0x40e696
mov esi, edi
mov ebx, edi
call fcn.0040e11b
mov ecx, 0x40ea78
mov dword [ebp - 4], eax
call fcn.0040e11b
mov dword [ebp - 0x20], eax
cmp eax, dword [ebp - 4]
jne 0x40e54e
cmp dword [0x4551d4], ebx
jne 0x40e696
jmp 0x40e67a
push 0x18
call fcn.0041eeeb
mov ebx, eax
mov dword [ebp - 0x1c], ebx
pop ecx
test ebx, ebx
jne 0x40e567
push 8
pop edi
jmp 0x40e67a
mov ecx, dword [ebp - 4]
call fcn.0040deab
mov esi, eax
mov dword [ebp - 8], esi
test esi, esi
je 0x40e55f
mov eax, dword [ebp - 4]
mov ebx, edi
mov dword [ebp - 0xc], ebx
lea ecx, [ebp - 0x10]
mov dword [ebp - 0xc], eax
push ecx
push ecx
lea ecx, [ebx + esi]
mov dword [ebp - 0x10], edi
mov edx, eax
call fcn.0040e6e6
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x10], edi
jne 0x40e5b6
mov ecx, dword [ebp - 0xc]
mov ebx, eax
sub ebx, dword [ebp - 4]
call fcn.0040de35
test eax, eax
jne 0x40e5b6
mov eax, dword [ebp - 0x18]
cmp ebx, 5
jl 0x40e580
mov dword [ebp - 0xc], ebx
cmp ebx, 5
mov ebx, dword [ebp - 0x1c]
jge 0x40e5d6
cmp dword [0x4551d4], 0
push 9
pop edi
jne 0x40e680
jmp 0x40e67a
mov eax, dword [ebp - 0xc]
cmp eax, 0x12
jbe 0x40e5e5
push 6
jmp 0x40e561
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 0x20]
add edx, eax
mov dword [esi + 0x18], edx
mov dword [esi + 0x1c], ecx
add esi, 0x17
mov ecx, dword [ebp - 8]
add ecx, eax
mov byte [esi], al
lea eax, [ecx + 5]
mov byte [ecx], 0xe9
sub edx, eax
mov eax, edi
and dword [ebp - 0x20], eax
mov dword [ecx + 1], edx
add ecx, 5
mov edx, esi
sub edx, ecx
cmp ecx, esi
cmova edx, dword [ebp - 0x20]
test edx, edx
je 0x40e627
mov byte [ecx], 0xcc
inc ecx
inc eax
cmp eax, edx
jb 0x40e61e
mov esi, dword [ebp - 4]
lea eax, [ebp - 0x14]
push eax
push 0x40
push dword [ebp - 0xc]
mov dword [ebp - 0x14], edi
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x40e66f
mov ecx, esi
call fcn.0040e0ba
mov esi, eax
test esi, esi
je 0x40e6b2
mov eax, 0x6544
cmp word [esi + 0x1c], ax
je 0x40e6b2
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], edi
push eax
push 0x40
push 0x40
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x40e6a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [ebp - 8]
mov edi, eax
mov dword [0x4551d0], edi
test esi, esi
je 0x40e68b
mov ecx, esi
call fcn.0040e095
test ebx, ebx
je 0x40e696
push ebx
call fcn.0041e2e4
pop ecx
mov dword [0x4551b8], 0x4552a0
mov eax, edi
jmp 0x40e6dd
mov dword [esi + 0x1c], 0x6f746544
mov dword [esi + 0x20], 0x21737275
mov eax, dword [ebp - 8]
mov dword [ebx + 0x10], eax
mov eax, dword [ebp - 4]
mov dword [ebx + 0xc], eax
mov dword [ebx + 4], edi
mov dword [ebx + 8], 0x4552a0
mov eax, dword [ebp - 0x14]
mov dword [ebx + 0x14], eax
mov eax, dword [0x4551c4]
mov dword [ebx], eax
xor eax, eax
mov dword [0x4551c4], ebx
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret 0xc