Function at 0x1005b180
Capabilities:
Access peb ldr_data
Parse pe header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1011f4b8
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push esi
push edi
mov eax, dword [0x1016e750]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov edx, dword [esi + 0x30]
mov eax, 0x5a4d
mov dword [esi + 0xc], edx
cmp word [edx], ax
je 0x1005b208
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1005b1c9
push eax
call edi
mov eax, dword [esi]
mov dword [esi + 4], 0
test eax, eax
je 0x1005b1de
cmp eax, 0xffffffff
je 0x1005b1de
push eax
call edi
push dword [esi + 0x30]
mov dword [esi], 0xffffffff
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push str.Incorrect_PE_file__e_magic___IMAGE_DOS_SIGNATURE_
lea ecx, [ebp - 0x14]
call fcn.100264e0
push 0x1016bc48
lea eax, [ebp - 0x14]
push eax
call fcn.1010805b
mov eax, dword [edx + 0x3c]
xor edi, edi
lea ecx, [eax + 0xf8]
cmp edi, dword [esi + 0x2c]
jb 0x1005b260
ja 0x1005b21f
cmp ecx, dword [esi + 0x28]
jb 0x1005b260
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1005b22f
push eax
call edi
mov eax, dword [esi]
mov dword [esi + 4], 0
test eax, eax
je 0x1005b244
cmp eax, 0xffffffff
je 0x1005b244
push eax
call edi
cmp dword [esi + 0x34], 0
mov dword [esi], 0xffffffff
je 0x1005b259
push dword [esi + 0x30]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push str.Incorrect_PE_file__header___filesize_
jmp 0x1005b1f2
add eax, edx
mov dword [esi + 0x40], eax
cmp dword [eax], 0x4550
je 0x1005b2f7
push str.Incorrect_PE_file__incorrect_signature_
lea ecx, [ebp - 0x10]
call fcn.10023fc0
mov dword [ebp - 4], 0
mov ecx, 0x454e
mov eax, dword [esi + 0x40]
cmp word [eax], cx
jne 0x1005b29f
push str.NE_executable
lea ecx, [ebp - 0x10]
call fcn.100240c0
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1005b2af
push eax
call edi
mov eax, dword [esi]
mov dword [esi + 4], 0
test eax, eax
je 0x1005b2c4
cmp eax, 0xffffffff
je 0x1005b2c4
push eax
call edi
cmp dword [esi + 0x34], 0
mov dword [esi], 0xffffffff
je 0x1005b2d9
push dword [esi + 0x30]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x10]
lea ecx, [ecx - 0x10]
call fcn.10024750
add eax, 0x10
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push 0x1016bc48
jmp 0x1005b202
add eax, 0x18
xor ecx, ecx
mov edi, 0x20b
mov dword [esi + 0x14], eax
cmp word [eax], di
sete cl
mov dword [esi + 0x3c], ecx
test ecx, ecx
je 0x1005b32f
mov eax, dword [edx + 0x3c]
add eax, edx
mov dword [esi + 0x44], eax
add eax, 0x18
mov dword [esi + 0x18], eax
mov eax, dword [esi + 0x44]
mov ax, word [eax + 6]
mov word [esi + 8], ax
mov eax, dword [esi + 0x44]
jmp 0x1005b33d
mov eax, dword [esi + 0x40]
mov ax, word [eax + 6]
mov word [esi + 8], ax
mov eax, dword [esi + 0x40]
add eax, 4
mov dword [esi + 0x10], eax
test ecx, ecx
je 0x1005b361
mov eax, dword [esi + 0x18]
add eax, 0x70
mov dword [esi + 0x1c], eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x14]
add eax, 0x60
mov dword [esi + 0x1c], eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret