Function at 0x4d5950
Capabilities:
Access peb ldr_data
Get file size
Get kernel32 base address
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x1a0
mov esi, esp
mov dword [esi + 0x180], ebp
mov ebx, dword [ebp + 8]
lea eax, [esi + 0x18c]
mov dword [eax - 8], esp
xor edi, edi
dec edi
mov dword [eax + 0xc], edi
mov dword [eax + 8], 0x5f1f58
mov dword [eax + 4], 0x518920
mov ecx, dword fs:[0]
mov dword [eax], ecx
mov dword fs:[0], eax
mov dword [esi + 0xc], edi
pcmpeqd xmm0, xmm0
movdqa xmmword [esi + 0x70], xmm0
movdqa xmmword [esi + 0x60], xmm0
movdqa xmmword [esi + 0x50], xmm0
movdqa xmmword [esi + 0x40], xmm0
lea eax, [esi + 0x88]
push 0xf8
push 0xff
push eax
call fcn.005191b0
add esp, 0xc
mov dword [esi + 0x34], edi
mov dword [esi + 0x30], edi
pcmpeqd xmm0, xmm0
movdqa xmmword [esi + 0x20], xmm0
sub esp, 0x1c
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], eax
movaps xmm0, xmmword [0x5e4040]
movups xmmword [esp + 4], xmm0
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, edi
je 0x4d5b61
mov ebx, eax
lea edi, [esi + 0xc]
lea eax, [esi + 0x40]
push 0
push edi
push 0x40
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4d5b5a
cmp dword [esi + 0xc], 0x40
jne 0x4d5b5a
movzx eax, word [esi + 0x40]
cmp eax, 0x5a4d
jne 0x4d5b5a
xor eax, eax
push eax
push eax
push dword [esi + 0x7c]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [esi + 0x7c]
jne 0x4d5b5a
push 0
push edi
push 0xf8
lea eax, [esi + 0x88]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4d5b5a
cmp dword [esi + 0xc], 0xf8
jne 0x4d5b5a
cmp dword [esi + 0x88], 0x4550
jne 0x4d5b5a
cmp word [esi + 0x8e], 0
je 0x4d5b5a
mov eax, dword [esi + 0x110]
test eax, eax
je 0x4d5b5a
mov dword [esi + 0x10], eax
xor edi, edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esi + 0xc], eax
push 4
push 0x1000
push eax
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x4d5b5a
mov edi, eax
xor eax, eax
push eax
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor eax, eax
push eax
lea eax, [esi + 0xc]
push eax
push dword [esi + 0xc]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4d5b4c
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi + 0x7c]
add ecx, edi
mov dword [esi + 0x198], 0
mov dword [esi + 0x1c], ecx
mov edx, dword [esi + 0x10]
mov dword [esi + 8], edi
call fcn.004d5cb0
mov edx, dword [esi + 8]
movzx ecx, word [eax + edx + 0xe]
movzx ebx, word [eax + edx + 0xc]
add ebx, ecx
mov edi, edx
je 0x4d5bb2
add eax, edi
neg ebx
xor ecx, ecx
mov edx, dword [eax + ecx*8 + 0x10]
test edx, edx
js 0x4d5b43
movzx edx, dx
cmp edx, 0xa
je 0x4d5b79
inc ecx
mov edx, ebx
add edx, ecx
jne 0x4d5b33
jmp 0x4d5bb2
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov eax, dword [esi + 0x18c]
mov dword fs:[0], eax
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ebx, 0x7fffffff
and ebx, dword [eax + ecx*8 + 0x14]
movzx edx, word [ebx + eax + 0xe]
movzx ecx, word [ebx + eax + 0xc]
add ecx, edx
je 0x4d5bb2
mov edx, eax
mov dword [esi + 0x18], eax
add ebx, eax
neg ecx
xor edx, edx
movzx edi, word [ebx + edx*8 + 0x10]
cmp edi, 0x360
je 0x4d5bce
inc edx
mov edi, ecx
add edi, edx
jne 0x4d5b9b
mov edi, dword [esi + 8]
xor ebx, ebx
mov dword [esi + 0x198], 0xffffffff
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x4d5b63
mov ecx, dword [ebx + edx*8 + 0x14]
test ecx, ecx
mov ebx, dword [esi + 8]
js 0x4d5bde
mov dword [esi + 0x14], ecx
jmp 0x4d5bf8
and ecx, 0x7fffffff
mov eax, dword [esi + 0x18]
mov ecx, dword [ecx + eax + 0x14]
mov dword [esi + 0x14], ecx
mov dword [esi + 0x198], 0
mov edx, dword [esi + 0x10]
xor eax, eax
mov ecx, dword [esi + 0x1c]
mov dword [ecx + 0x58], eax
mov dword [ecx + 0x98], eax
mov dword [ecx + 0x9c], eax
mov dword [esi + 0x20], 0x18
mov dword [esi + 0x24], ebx
mov dword [esi + 0x198], eax
call fcn.004d5cb0
mov ecx, dword [esi + 0x18]
mov dword [esi + 0x28], eax
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x2c], eax
mov edx, dword [esi + 0x14]
mov eax, dword [edx + ecx + 4]
mov dword [esi + 0x34], eax
mov edx, dword [edx + ecx]
mov ecx, dword [esi + 0x1c]
call fcn.004d5cb0
mov edx, dword [esi + 8]
add edx, eax
lea ecx, [esi + 0x20]
mov dword [ecx + 0x10], edx
call fcn.004d5d10
mov ebx, eax
mov edi, dword [esi + 8]
jmp 0x4d5bb4