Function at 0x414ae0
Capabilities:
Parse pe header
Read file on windows

Disassembly:
sub esp, 0x17c
mov eax, dword [esp + 0x180]
push ebx
push ebp
push esi
push edi
push 0
push 0
push 3
push 0
push 3
push connect
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x414d63
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x5c]
push 0x40
push edx
push ebp
call esi
test eax, eax
je 0x414d5c
cmp word [esp + 0x54], 0x5a4d
jne 0x414d5c
mov eax, dword [esp + 0x90]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push eax
push ebp
call edi
cmp eax, dword [esp + 0x90]
jne 0x414d5c
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x9c]
push 0xf8
push edx
push ebp
call esi
test eax, eax
je 0x414d5c
cmp dword [esp + 0x94], 0x4550
jne 0x414d5c
cmp word [esp + 0x9a], 0
je 0x414d5c
push 0x1000
mov dword [esp + 0x1c], 0
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ebx, eax
mov eax, dword [esp + 0xac]
add esp, 4
test ebx, ebx
setne byte [esp + 0x24]
and eax, 0xffff
push 1
sub eax, 0xe0
push 0
push eax
push ebp
call edi
cmp word [esp + 0x9a], 0
mov dword [esp + 0x14], 0
jbe 0x414d10
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x34]
push 0x28
push edx
push ebp
call esi
test eax, eax
je 0x414d37
cmp dword [esp + 0x10], 0x28
jne 0x414d37
mov eax, dword [esp + 0x194]
test eax, eax
je 0x414c4c
mov ecx, 2
lea edi, [esp + 0x2c]
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x414c46
lea ecx, [esp + 0x2c]
push 8
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__mbsnbcmp]
add esp, 0xc
test eax, eax
jne 0x414cdd
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push 0
push ebp
call edi
mov edx, dword [esp + 0x40]
push 0
push 0
push edx
push ebp
mov dword [esp + 0x2c], eax
call edi
cmp eax, dword [esp + 0x40]
jne 0x414ccf
lea eax, [esp + 0x10]
push 0
push eax
push 0x1000
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x414ccf
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x19c]
mov eax, ebx
lea esi, [ebx + ecx]
mov ecx, dword [esp + 0x198]
add edx, ecx
cmp ebx, esi
mov dword [esp + 0x20], edx
jae 0x414ccf
cmp ecx, dword [esp + 0x20]
je 0x414d08
mov dl, byte [ecx]
cmp dl, byte [eax]
jne 0x414cb4
inc eax
inc ecx
jmp 0x414cc5
mov edx, dword [esp + 0x198]
mov edi, edx
sub edi, ecx
mov ecx, edx
lea eax, [eax + edi + 1]
cmp eax, esi
jb 0x414ca4
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x1c]
push 0
push 0
push eax
push ebp
call edi
jmp 0x414ce3
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x9a]
inc eax
and ecx, 0xffff
cmp eax, ecx
mov dword [esp + 0x14], eax
jae 0x414d10
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x414bed
mov dword [esp + 0x18], 1
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esp + 0x24]
test al, al
je 0x414d28
push ebx
call fcn.0043fa08
add esp, 4
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x17c
ret
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esp + 0x24]
test al, al
je 0x414d63
push ebx
call fcn.0043fa08
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x17c
ret
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x17c
ret