Function at 0x40de30
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Parse pe header
Read file via mapping

Disassembly:
sub esp, 0x14
push ebx
push ebp
mov ebp, dword [esp + 0x20]
push esi
xor ebx, ebx
push edi
or edi, 0xffffffff
xor esi, esi
mov dword [esp + 0x18], edi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x1c], ebx
cmp dword [ebp + 0x14], ebx
je 0x40e08c
cmp dword [esp + 0x2c], ebx
je 0x40e08c
cmp dword [ebp + 0xc], 0x10
jae 0x40e08c
push 0x4c
call fcn.0040f431
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x40e08c
push 0x4c
push ebx
push esi
call fcn.00411760
push 0x104
call fcn.0040f431
add esp, 0x10
mov dword [esp + 0x10], eax
test eax, eax
je 0x40e08c
push 0x104
push ebx
push eax
call fcn.00411760
mov eax, dword [esp + 0x38]
add esp, 0xc
xor edi, edi
cmp byte [eax], bl
je 0x40def3
mov edx, dword [esp + 0x10]
sub edx, eax
jmp 0x40ded0
cmp dword [esp + 0x28], 0x104
jae 0x40def3
mov cl, byte [eax]
mov bl, cl
xor bl, 0x98
mov byte [edx + eax], bl
mov ebx, dword [esp + 0x1c]
mov byte [esi + edi + 0xc], cl
inc eax
inc edi
cmp byte [eax], 0
jne 0x40ded0
mov dword [esi + 8], edi
mov edi, dword [esp + 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
je 0x40e05e
push 0x104
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov dword [esp + 0x28], eax
test eax, eax
je 0x40e05e
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
je 0x40e05e
push 0
push 0
push 0
push 0x1000002
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x20], eax
test eax, eax
je 0x40e05e
push 0
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
test ebx, ebx
je 0x40e05e
push 4
push ebx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40e05e
mov eax, 0x5a4d
cmp ax, word [ebx]
jne 0x40e05e
mov edi, dword [ebx + 0x3c]
push 4
add edi, ebx
push edi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40e05a
cmp dword [edi], 0x4550
jne 0x40e05a
push 4
add edi, 0x50
push edi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40e05a
mov eax, dword [edi]
push eax
mov dword [esi + 4], eax
call fcn.0040f431
add esp, 4
mov dword [esi], eax
test eax, eax
je 0x40e05a
mov ecx, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_VirtualProtect]
lea edx, [esp + 0x28]
push edx
xor ecx, eax
mov eax, dword [esi + 4]
push 2
push eax
push ebx
mov dword [esi], ecx
call edi
test eax, eax
je 0x40e05a
mov eax, dword [esi]
mov edx, dword [esi + 4]
xor eax, dword [ebp + 8]
lea ecx, [esp + 0x28]
push ecx
push 0x40
push edx
push eax
call edi
test eax, eax
je 0x40e05a
mov eax, dword [esi + 4]
mov ecx, dword [esi]
xor ecx, dword [ebp + 8]
push eax
push ebx
push eax
push ecx
call fcn.0040f615
mov edx, dword [ebp + 8]
xor dword [esi + 4], edx
mov eax, dword [ebp + 8]
xor dword [esi + 8], eax
mov edi, dword [ebp + 0xc]
mov ecx, edi
imul ecx, ecx, 0x4c
add ecx, dword [ebp + 0x10]
push 0x4c
push esi
push 0x4c
push ecx
call fcn.0040f615
add esp, 0x20
inc dword [ebp + 0xc]
mov dword [esp + 0x18], edi
mov edi, dword [esp + 0x10]
push edi
call fcn.0040ee0c
add esp, 4
test ebx, ebx
je 0x40e072
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40e081
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x14], 0
mov edi, dword [esp + 0x18]
je 0x40e097
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, 0xffffffff
jne 0x40e0be
test esi, esi
je 0x40e0cb
mov eax, dword [esi]
test eax, eax
je 0x40e0be
mov ebp, dword [ebp + 8]
xor ebp, eax
mov dword [esi], ebp
je 0x40e0be
push ebp
call fcn.0040ee0c
add esp, 4
mov dword [esi], 0
test esi, esi
je 0x40e0cb
push esi
call fcn.0040ee0c
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 8