Function at 0x10013610
Capabilities:
Parse pe header
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push edi
mov edi, ecx
mov eax, 0x5a4d
mov dword [ebp - 0x14], edi
cmp word [edi], ax
je 0x10013638
push str.Not_a_valid_executable_file._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret
push ebx
mov ebx, dword [edi + 0x3c]
add ebx, edi
cmp dword [ebx], 0x4550
je 0x10013659
push str.No_PE_header_found._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop ebx
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x2000
push dword [ebx + 0x50]
push dword [ebx + 0x34]
call esi
mov dword [ebp - 4], eax
test eax, eax
jne 0x1001369d
push 4
push 0x2000
push dword [ebx + 0x50]
push eax
call esi
mov dword [ebp - 4], eax
test eax, eax
jne 0x1001369d
mov ecx, str.Cant_reserve_memory
call fcn.100133d0
pop esi
pop ebx
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret
push 0x14
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [ebp - 4]
push 4
push 0x1000
mov dword [eax + 4], ecx
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 0x10], 0
push dword [ebx + 0x50]
mov dword [ebp - 8], eax
push ecx
call esi
push 4
push 0x1000
push dword [ebx + 0x54]
push dword [ebp - 4]
call esi
mov ecx, dword [edi + 0x3c]
mov esi, eax
add ecx, dword [ebx + 0x54]
push ecx
push edi
push esi
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [edi + 0x3c]
add esp, 0xc
mov ecx, dword [ebp - 4]
add eax, esi
mov esi, dword [ebp - 8]
mov dword [ebp - 0xc], 0
mov dword [esi], eax
mov dword [eax + 0x34], ecx
xor eax, eax
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov dword [ebp - 0x10], edx
movzx edi, word [ecx + 0x14]
add edi, 0x28
cmp ax, word [ecx + 6]
jae 0x100137a7
add edi, ecx
nop dword [eax + eax]
mov eax, dword [edi]
test eax, eax
jne 0x1001375f
mov esi, dword [ebx + 0x38]
test esi, esi
jle 0x1001378d
mov eax, dword [edi - 4]
push 4
push 0x1000
push esi
add eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push esi
push 0
push eax
mov dword [edi - 8], eax
call sub.VCRUNTIME140.dll_memset
jmp 0x10013787
push 4
push 0x1000
push eax
mov eax, dword [edi - 4]
add eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push dword [edi]
mov ecx, dword [edi + 4]
mov esi, eax
add ecx, dword [ebp - 0x14]
push ecx
push esi
call sub.VCRUNTIME140.dll_memcpy
mov dword [edi - 8], esi
mov edx, dword [ebp - 0x10]
add esp, 0xc
mov eax, dword [ebp - 8]
add edi, 0x28
mov esi, dword [ebp - 0xc]
inc esi
mov dword [ebp - 0xc], esi
mov ecx, dword [eax]
movzx eax, word [ecx + 6]
cmp esi, eax
jl 0x10013730
mov esi, dword [ebp - 8]
mov eax, dword [ebp - 4]
sub eax, dword [ebx + 0x34]
mov dword [ebp - 0x14], eax
je 0x1001381f
cmp dword [ecx + 0xa4], 0
jbe 0x1001381f
mov edx, dword [esi + 4]
mov edi, dword [ecx + 0xa0]
add edi, edx
mov dword [ebp - 0x10], edx
mov eax, dword [edi]
test eax, eax
je 0x1001381f
nop
mov ecx, dword [edi + 4]
lea ebx, [eax + edx]
xor esi, esi
lea edx, [edi + 8]
lea eax, [ecx - 8]
test eax, 0xfffffffe
jbe 0x10013813
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x10013803
mov ecx, dword [ebp - 0x14]
and eax, 0xfff
add dword [eax + ebx], ecx
mov ecx, dword [edi + 4]
inc esi
add edx, 2
lea eax, [ecx - 8]
shr eax, 1
cmp esi, eax
jb 0x100137e5
mov eax, dword [edi + ecx]
add edi, ecx
mov edx, dword [ebp - 0x10]
test eax, eax
jne 0x100137d0
mov ebx, dword [ebp - 8]
mov ecx, ebx
call fcn.10013460
test eax, eax
je 0x10013979
mov esi, dword [ebx]
xor eax, eax
mov dword [ebp - 0x14], 0
movzx edi, word [esi + 0x14]
add edi, 0x28
cmp ax, word [esi + 6]
jae 0x10013960
add edi, esi
nop
mov ebx, dword [edi + 0x14]
mov edx, dword [edi]
test ebx, 0x2000000
je 0x10013871
push 0x4000
push edx
push dword [edi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x10013945
mov ecx, ebx
mov eax, ebx
shr eax, 0x1e
and eax, 1
shr ecx, 0x1d
and ecx, 1
lea ecx, [eax + ecx*2]
mov eax, ebx
shr eax, 0x1f
lea eax, [eax + ecx*2]
mov ecx, dword [eax*4 + 0x1001a540]
mov eax, ebx
mov dword [ebp - 0xc], ecx
or dword [ebp - 0xc], 0x200
and eax, 0x4000000
mov eax, dword [ebp - 0xc]
cmove eax, ecx
test edx, edx
jne 0x100138cb
test bl, 0x40
je 0x100138b8
mov edx, dword [esi + 0x20]
jmp 0x100138c3
test bl, bl
jns 0x10013945
mov edx, dword [esi + 0x24]
test edx, edx
je 0x10013945
lea ecx, [ebp - 0x18]
push ecx
push eax
push edx
push dword [edi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10013945
push eax
push eax
lea eax, [ebp - 0x10]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov ecx, dword [ebp - 0x10]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10013903
sub ecx, edx
lea eax, [ecx + 0x1f]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push dword [ebp - 0x10]
mov esi, eax
push str.Error_protecting_memory_page
push str._s:__s
push esi
call fcn.10001810
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
call ebx
push dword [ebp - 0x10]
call ebx
mov ebx, dword [ebp - 8]
add edi, 0x28
mov ecx, dword [ebp - 0x14]
inc ecx
mov dword [ebp - 0x14], ecx
mov esi, dword [ebx]
movzx eax, word [esi + 6]
cmp ecx, eax
jl 0x10013850
mov eax, dword [esi + 0x28]
test eax, eax
je 0x100139a2
mov ecx, dword [ebp - 4]
add eax, ecx
jne 0x10013989
push str.Library_has_no_entry_point._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, ebx
call fcn.10013a40
pop esi
pop ebx
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret
push 0
push 1
push ecx
call eax
test eax, eax
jne 0x1001399b
push str.Cant_attach_library._n
jmp 0x10013973
mov dword [ebx + 0x10], 1
pop esi
mov eax, ebx
pop ebx
pop edi
mov esp, ebp
pop ebp
ret