Function at 0x401340
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x98
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov eax, dword [ebp + 8]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
movzx edx, word [ecx]
cmp edx, 0x5a4d
jne 0x40137b
mov eax, dword [ebp - 0x34]
mov eax, dword [eax + 0x3c]
xor edx, edx
mov ecx, 4
div ecx
test edx, edx
je 0x401380
jmp 0x4016d6
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp + 8]
add eax, dword [edx + 0x3c]
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x24]
cmp dword [ecx], 0x4550
je 0x40139c
jmp 0x4016d6
mov edx, dword [ebp - 0x24]
add edx, 0x18
mov dword [ebp - 0x20], edx
mov dword [ebp - 0xc], 0
movzx eax, byte [ebp - 0x2d]
push eax
push str.ntdll.dll
lea ecx, [ebp - 0x7c]
call fcn.004021b0
mov ecx, eax
call fcn.004016f0
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x50], eax
movzx ecx, byte [ebp - 0x2e]
push ecx
push str.NtAllocateVirtualMemory
lea ecx, [ebp - 0x98]
call fcn.004022e0
mov ecx, eax
call fcn.00401780
push eax
mov edx, dword [ebp - 0x50]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 0x50]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x58], edx
push 0x40
push 0x3000
lea eax, [ebp - 8]
push eax
push 0
lea ecx, [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [ebp - 0x58]
mov dword [ebp - 0x70], eax
cmp dword [ebp - 0xc], 0
jne 0x401431
jmp 0x4016d6
mov edx, dword [ebp - 0x24]
movzx eax, word [edx + 0x14]
mov ecx, dword [ebp - 0x24]
lea edx, [ecx + eax + 0x18]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 0x3c]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0xc]
push eax
call fcn.004012f0
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x10], cx
jmp 0x40146d
mov dx, word [ebp - 0x10]
add dx, 1
mov word [ebp - 0x10], dx
movzx eax, word [ebp - 0x10]
mov ecx, dword [ebp - 0x24]
movzx edx, word [ecx + 6]
cmp eax, edx
jge 0x4014b9
movzx eax, word [ebp - 0x10]
imul ecx, eax, 0x28
mov edx, dword [ebp - 0x38]
mov eax, dword [edx + ecx + 0x10]
push eax
movzx ecx, word [ebp - 0x10]
imul edx, ecx, 0x28
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp + 8]
add ecx, dword [eax + edx + 0x14]
push ecx
movzx edx, word [ebp - 0x10]
imul eax, edx, 0x28
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0xc]
add edx, dword [ecx + eax + 0xc]
push edx
call fcn.004012f0
add esp, 0xc
jmp 0x401461
mov eax, 8
shl eax, 0
mov ecx, dword [ebp - 0x20]
lea edx, [ecx + eax + 0x60]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x3c]
cmp dword [eax], 0
je 0x4015b0
mov ecx, dword [ebp - 0x3c]
cmp dword [ecx + 4], 0x14
jbe 0x4015b0
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0xc]
add eax, dword [edx]
mov dword [ebp - 0x18], eax
jmp 0x4014fa
mov ecx, dword [ebp - 0x18]
add ecx, 0x14
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
cmp dword [edx + 0xc], 0
je 0x4015b0
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + 0xc]
mov dword [ebp - 0x5c], ecx
mov edx, dword [ebp - 0x5c]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
je 0x4015ab
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0xc]
add eax, dword [edx + 0x10]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x18]
cmp dword [ecx], 0
jne 0x40154f
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], edx
jmp 0x401563
mov eax, dword [ebp - 0x1c]
add eax, 4
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x2c]
add ecx, 4
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x1c]
cmp dword [edx], 0
je 0x4015ab
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax]
and ecx, 0x80000000
je 0x401587
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx]
and eax, 0xffff
mov dword [ebp - 0x48], eax
jmp 0x401596
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx]
mov eax, dword [ebp - 0xc]
lea ecx, [eax + edx + 2]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp - 0x2c]
mov dword [ecx], eax
jmp 0x401551
jmp 0x4014f1
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0xc]
cmp eax, dword [edx + 0x1c]
je 0x4016b4
mov ecx, 8
imul edx, ecx, 5
mov eax, dword [ebp - 0x20]
cmp dword [eax + edx + 0x64], 0
je 0x4016b4
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0xc]
sub edx, dword [ecx + 0x1c]
mov dword [ebp - 0x64], edx
mov eax, 8
imul ecx, eax, 5
mov edx, dword [ebp - 0x20]
lea eax, [edx + ecx + 0x60]
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x40]
cmp dword [ecx + 4], 0
je 0x401604
mov edx, dword [ebp - 0x40]
cmp dword [edx], 0
jne 0x401609
jmp 0x4016d6
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
cmp dword [edx], 0
je 0x4016b4
mov eax, dword [ebp - 0x14]
cmp dword [eax + 4], 8
jb 0x4016a3
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 4]
sub edx, 8
shr edx, 1
mov dword [ebp - 0x60], edx
mov eax, dword [ebp - 0x14]
add eax, 8
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x28], 0
jmp 0x401652
mov ecx, dword [ebp - 0x28]
add ecx, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x28]
cmp edx, dword [ebp - 0x60]
jae 0x4016a3
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x44]
movzx edx, word [ecx + eax*2]
test edx, edx
je 0x4016a1
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax]
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x44]
movzx edx, word [eax + edx*2]
and edx, 0xfff
mov eax, dword [ecx + edx]
add eax, dword [ebp - 0x64]
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x44]
movzx ecx, word [edx + ecx*2]
and ecx, 0xfff
mov edx, dword [ebp - 0x14]
mov esi, dword [ebp - 0xc]
add esi, dword [edx]
mov dword [esi + ecx], eax
jmp 0x401649
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
add ecx, dword [eax + 4]
mov dword [ebp - 0x14], ecx
jmp 0x401614
mov edx, dword fs:[0x30]
mov dword [ebp - 0x68], edx
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0xc]
mov dword [eax + 8], ecx
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0xc]
add eax, dword [edx + 0x10]
mov dword [ebp - 0x6c], eax
call dword [ebp - 0x6c]
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040345f
mov esp, ebp
pop ebp
ret