Function at 0x40120f
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x828
push ebx
push esi
push edi
xor eax, eax
mov word [ebp - 0x828], ax
push 0x400
xor edi, edi
lea eax, [ebp - 0x828]
push eax
mov ebx, edi
mov esi, edi
push edi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x828]
push edi
push 0x8000000
push 3
push edi
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4012b0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov ecx, ebx
mov dword [ebp - 0x18], eax
call fcn.00401450
mov esi, eax
push 0
lea eax, [ebp - 0x24]
push eax
push ebx
push esi
push edi
mov dword [ebp - 0x14], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401298
cmp dword [ebp - 0x24], ebx
je 0x4012a9
mov ecx, esi
call fcn.004cd000
xor esi, esi
xor ebx, ebx
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x18], ebx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x10]
push eax
push ecx
mov ecx, esi
call fcn.00401520
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 0x10]
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.00401690
mov eax, dword [ebp - 0xc]
push 0x40
mov edi, dword [eax + 0x3c]
add edi, eax
push 0x3000
mov eax, dword [edi + 0x50]
mov dword [ebp - 8], eax
add eax, 0x18
add eax, ebx
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [ebp - 4], ebx
test ebx, ebx
je 0x40142e
mov edx, dword [ebp - 0xc]
push 0x40
mov ecx, ebx
call fcn.00401470
mov esi, dword [ebx + 0x3c]
movzx eax, word [edi + 0x14]
add esi, ebx
push eax
mov edx, edi
mov ecx, esi
mov dword [ebp - 0x1c], esi
call fcn.00401470
movzx ecx, word [edi + 0x14]
lea eax, [edi + 0x18]
movzx edi, word [edi + 6]
add ecx, eax
movzx eax, word [esi + 0x14]
add esi, 0x18
add esi, eax
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x28], edi
test edi, edi
je 0x401383
mov ebx, ecx
sub ebx, esi
push 0x28
lea edx, [ebx + esi]
mov ecx, esi
call fcn.00401470
add esi, 0x28
dec edi
jne 0x401349
mov edi, dword [ebp - 0x28]
mov ebx, dword [ebp - 4]
mov ecx, dword [ebp - 0x20]
test edi, edi
je 0x401383
lea esi, [ecx + 0x14]
mov edx, dword [esi]
mov ecx, dword [esi - 8]
push dword [esi - 4]
add edx, dword [ebp - 0xc]
add ecx, ebx
call fcn.00401470
lea esi, [esi + 0x28]
dec edi
jne 0x40136b
mov eax, dword [ebp - 0x1c]
add eax, 0x18
push eax
mov edx, ebx
mov ecx, ebx
mov dword [ebp - 0x1c], eax
call fcn.00401790
mov eax, dword [ebp - 8]
add eax, ebx
mov ebx, eax
add eax, 0x18
push str.KERNEL32
mov dword [ebp - 8], eax
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 + 0xc], eax
push str.LoadLibraryA
push edi
call esi
mov dword [ebx + 8], eax
push str.OutputDebugStringW
push edi
call esi
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 0x14]
mov dword [ebx + 4], eax
mov eax, ecx
sub eax, ebx
mov dword [ebx + 0x10], eax
mov eax, dword [ebp - 0x18]
push eax
mov edx, esi
mov dword [ebx + 0x14], eax
call fcn.00401470
mov ecx, dword [ebp - 0x1c]
mov edi, dword [ebp - 4]
mov ebx, dword [ecx + 0x60]
xor eax, eax
lea edx, [ebx + edi]
inc eax
sub eax, dword [edx + 0x10]
cmp eax, dword [edx + 0x14]
jae 0x40141b
push eax
push edx
push dword [ecx + 0x64]
mov edx, ebx
mov ecx, edi
call fcn.00401830
jmp 0x40141d
xor eax, eax
push edi
call eax
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, dword [ebp - 0xc]
call fcn.00401460
mov ecx, esi
call fcn.00401460
pop edi
xor eax, eax
pop esi
inc eax
pop ebx
leave
ret