Function at 0x411950
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 0x411bd3
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 0x411bcc
cmp word [esp + 0x54], 0x5a4d
jne 0x411bcc
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 0x411bcc
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x9c]
push 0xf8
push edx
push ebp
call esi
test eax, eax
je 0x411bcc
cmp dword [esp + 0x94], 0x4550
jne 0x411bcc
cmp word [esp + 0x9a], 0
je 0x411bcc
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 0x411b80
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x34]
push 0x28
push edx
push ebp
call esi
test eax, eax
je 0x411ba7
cmp dword [esp + 0x10], 0x28
jne 0x411ba7
mov eax, dword [esp + 0x194]
test eax, eax
je 0x411abc
mov ecx, 2
lea edi, [esp + 0x2c]
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x411ab6
lea ecx, [esp + 0x2c]
push 8
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__mbsnbcmp]
add esp, 0xc
test eax, eax
jne 0x411b4d
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 0x411b3f
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 0x411b3f
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 0x411b3f
cmp ecx, dword [esp + 0x20]
je 0x411b78
mov dl, byte [ecx]
cmp dl, byte [eax]
jne 0x411b24
inc eax
inc ecx
jmp 0x411b35
mov edx, dword [esp + 0x198]
mov edi, edx
sub edi, ecx
mov ecx, edx
lea eax, [eax + edi + 1]
cmp eax, esi
jb 0x411b14
mov edi, dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov eax, dword [esp + 0x1c]
push 0
push 0
push eax
push ebp
call edi
jmp 0x411b53
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 0x411b80
mov esi, dword [sym.imp.KERNEL32.DLL_ReadFile]
jmp 0x411a5d
mov dword [esp + 0x18], 1
push ebp
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov al, byte [esp + 0x24]
test al, al
je 0x411b98
push ebx
call fcn.0042d5f4
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 0x411bd3
push ebx
call fcn.0042d5f4
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