Function at 0x40bf8b
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x46405c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], ecx
test eax, eax
je 0x40c10d
test ebx, ebx
je 0x40c10d
test ecx, ecx
je 0x40c10d
cmp eax, ebx
je 0x40c10d
xor esi, esi
lea edi, [ebp - 0x40]
jmp 0x40bfd4
mov eax, dword [ebp - 0x10]
add eax, esi
mov dword [edi], esi
push eax
add edi, 4
call fcn.0040be34
add esi, eax
pop ecx
cmp esi, 5
jb 0x40bfd1
or dword [edi], 0xffffffff
mov dword [ebp - 0x18], esi
add esi, 0xa
push esi
call fcn.0044f187
pop ecx
mov dword [ebp - 0x20], eax
test eax, eax
je 0x40c10d
mov esi, dword [ebp - 0x10]
mov edi, eax
movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x18]
push edi
push dword [ebp - 0x10]
lea esi, [eax + 5]
push esi
call sub.msvcrt.dll_memcpy
add esp, 0xc
and dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp + eax*4 - 0x40]
cmp edx, 0xffffffff
je 0x40c069
mov eax, dword [ebp - 0x10]
add eax, edx
mov cl, byte [eax]
mov byte [ebp - 0x11], cl
cmp cl, 0xe9
je 0x40c042
cmp cl, 0xe8
jne 0x40c060
call fcn.0040bf66
cmp eax, ebx
jne 0x40c055
cmp byte [ebp - 0x11], 0xe9
je 0x40c104
sub eax, edx
sub eax, esi
sub eax, 5
mov dword [edx + esi + 1], eax
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 6
jb 0x40c022
mov eax, dword [ebp - 0x10]
sub eax, esi
sub eax, 5
mov dword [esi + edi + 1], eax
lea eax, [ebp - 0x28]
push eax
mov byte [esi + edi], 0xe9
and dword [ebp - 0x28], 0
push 0x40
add edi, 5
push edi
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov eax, dword [ebp - 0xc]
mov dword [eax], esi
xor eax, eax
mov byte [ebp - 0xc], 0xe9
lea edi, [ebp - 0xa]
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [ebp - 0x10]
sub ebx, edi
sub ebx, 5
test byte [0x46c684], 1
mov dword [ebp - 0xb], ebx
mov esi, 0x46c66c
jne 0x40c0df
or dword [0x46c684], 1
push 0x190
push esi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
mov dword [0x46c668], eax
xor ebx, ebx
cmp dword [0x46c668], ebx
jne 0x40c11e
push 0x10
push str.CreateCriticalSection
push 0x45ffd4
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
push 2
call dword [sym.imp.msvcrt.dll_exit]
push dword [ebp - 0x20]
call fcn.0044f0ca
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0044f7e0
leave
ret
test byte [0x46c684], 2
jne 0x40c13f
or dword [0x46c684], 2
push 0x451d43
mov dword [0x46c664], esi
call fcn.0044fd43
pop ecx
mov eax, dword [0x46c664]
cmp eax, ebx
je 0x40c14f
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebp - 0x1c]
push eax
push 0x40
push 5
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x24], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
push edi
call ebx
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x1c]
lea esi, [ebp - 0xc]
movsd dword es:[edi], dword [esi]
push 5
push dword [ebp - 0x10]
movsb byte es:[edi], byte [esi]
call ebx
push 5
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov eax, dword [0x46c664]
test eax, eax
je 0x40c19b
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
inc eax
jmp 0x40c10f