Function at 0x10040270
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x1004e040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x2c], edx
mov ebx, ecx
mov dword [ebp - 0x30], eax
xor edi, edi
call fcn.10040220
cmp dword [0x1004e800], edi
je 0x100404e9
mov esi, dword [sym.imp.KERNEL32.dll_VirtualQuery]
lea eax, [ebp - 0x20]
push 0x1c
push eax
push ebx
call esi
cmp dword [ebp - 0x10], 0x1000
jne 0x100402c4
test byte [ebp - 0xc], 0xf0
je 0x100402c4
lea eax, [edi + 1]
jmp 0x100402c6
xor eax, eax
test eax, eax
je 0x100404e2
push 0x1c
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x2c]
call esi
cmp dword [ebp - 0x10], 0x1000
jne 0x100404e2
test byte [ebp - 0xc], 0xf0
je 0x100404e2
mov edx, dword [0x1004e898]
xor eax, eax
test edx, edx
je 0x1004030e
mov ecx, dword [0x1004e890]
cmp ebx, dword [ecx]
je 0x1004037c
inc eax
add ecx, 0x2c
cmp eax, edx
jb 0x10040302
mov ecx, dword [0x1004e89c]
test ecx, ecx
je 0x10040323
cmp dword [ecx + 4], edi
jne 0x1004038b
mov ecx, dword [ecx]
test ecx, ecx
jne 0x10040318
push 0x40
push 0x3000
push 0x1000
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, eax
test ecx, ecx
je 0x10040372
mov dword [ecx + 8], edi
lea edx, [ecx + 0x20]
xor edi, edi
lea esi, [edi + 0x20]
mov dword [edx], edi
mov eax, edx
mov dword [ecx + 4], edx
add esi, 0x20
add edx, 0x20
mov edi, eax
cmp esi, 0xfe0
jbe 0x10040348
mov eax, dword [0x1004e89c]
xor edi, edi
mov dword [ecx], eax
mov dword [0x1004e89c], ecx
test ecx, ecx
jne 0x1004038b
mov edi, 9
jmp 0x100404ee
cmp eax, 0xffffffff
je 0x1004030e
mov edi, 3
jmp 0x100404ee
mov edx, dword [ecx + 4]
mov dword [ebp - 0x34], edx
mov eax, dword [edx]
inc dword [ecx + 8]
mov dword [ecx + 4], eax
lea ecx, [ebp - 0x28]
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], edx
call fcn.100405c0
test eax, eax
je 0x100404d3
mov ecx, dword [0x1004e890]
test ecx, ecx
jne 0x10040401
push 0x580
push ecx
push dword [0x1004e800]
mov dword [0x1004e894], 0x20
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, eax
mov dword [0x1004e890], ecx
test ecx, ecx
jne 0x1004043b
mov edi, 9
test edi, edi
je 0x100404ee
mov ecx, dword [ebp - 0x34]
call fcn.1003f540
jmp 0x100404ee
mov eax, dword [0x1004e898]
mov edx, dword [0x1004e894]
cmp eax, edx
jb 0x10040440
imul eax, edx, 0x58
push eax
push ecx
push 0
push dword [0x1004e800]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov ecx, eax
test ecx, ecx
je 0x100403e7
mov eax, dword [0x1004e894]
add eax, eax
mov dword [0x1004e890], ecx
mov dword [0x1004e894], eax
mov eax, dword [0x1004e898]
imul esi, eax, 0x2c
inc eax
mov dword [0x1004e898], eax
add esi, ecx
je 0x100403e7
mov eax, dword [ebp - 0x28]
mov cl, byte [esi + 0x14]
mov edx, dword [ebp - 0x1c]
and cl, 0xf8
mov dword [esi], eax
mov eax, dword [ebp - 0x24]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esi + 8], eax
mov al, dl
and al, 1
or cl, al
mov eax, dword [ebp - 0x18]
mov byte [esi + 0x14], cl
and eax, 0xf
mov ecx, dword [esi + 0x18]
and ecx, 0xfffffff0
or ecx, eax
mov eax, dword [ebp - 0x14]
mov dword [esi + 0x18], ecx
mov ecx, dword [ebp - 0x10]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x20], ecx
mov ecx, dword [ebp - 8]
mov dword [esi + 0x24], eax
mov dword [esi + 0x28], ecx
test edx, edx
je 0x100404b3
mov eax, dword [ebx - 5]
mov dword [esi + 0xc], eax
mov ax, word [ebx - 1]
mov word [esi + 0x10], ax
mov al, byte [ebx + 1]
mov byte [esi + 0x12], al
jmp 0x100404be
mov eax, dword [ebx]
mov dword [esi + 0xc], eax
mov al, byte [ebx + 4]
mov byte [esi + 0x10], al
mov ecx, dword [ebp - 0x30]
test ecx, ecx
je 0x100403ec
mov eax, dword [ebp - 0x20]
mov dword [ecx], eax
jmp 0x100403ec
mov ecx, dword [ebp - 0x34]
mov edi, 8
call fcn.1003f540
jmp 0x100404ee
mov edi, 7
jmp 0x100404ee
mov edi, 2
xor ecx, ecx
mov eax, 0x1004e7fc
xchg dword [eax], ecx
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1004123c
mov esp, ebp
pop ebp
ret 4