Function at 0x401193
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x134
and dword [ebp - 0xc], 0
and dword [ebp - 0x12c], 0
and dword [ebp - 0x10], 0
or dword [ebp - 0x18], 0xffffffff
and dword [ebp - 8], 0
and dword [ebp - 4], 0
and dword [ebp - 0x1c], 0
and dword [ebp - 0x14], 0
cmp dword [ebp + 8], 0
jne 0x401201
push 0x104
push 0
lea eax, [ebp - 0x128]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x104
lea eax, [ebp - 0x128]
push eax
push dword [0x411888]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x128]
mov dword [ebp - 0x12c], eax
jmp 0x40120a
mov eax, dword [ebp + 8]
mov dword [ebp - 0x12c], eax
push dword [ebp - 0x12c]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x401224
jmp 0x40135e
and dword [ebp - 0x130], 0
jmp 0x40123a
mov eax, dword [ebp - 0x130]
inc eax
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0x32
jge 0x401273
push 0
push 0
push 3
push 0
push 1
push closesocket
push dword [ebp - 0x12c]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
je 0x401269
jmp 0x401273
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40122d
push 0
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x40128d
cmp dword [ebp - 8], 0xffffffff
jne 0x401297
jmp 0x40135e
push 4
push 0x3000
push dword [ebp - 8]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4012bc
jmp 0x40135e
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 8]
jae 0x4012fb
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x14]
push dword [ebp - 0x10]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4012e7
jmp 0x40135e
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 4]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 8]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
jmp 0x4012c2
mov dword [ebp - 0xc], 1
cmp dword [ebp + 0x14], 2
jae 0x40135e
and dword [ebp - 0x134], 0
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x10]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x134], ecx
cmp dword [ebp + 0x14], 0
jne 0x40133f
mov eax, dword [ebp - 0x134]
movzx eax, word [eax + 0x16]
or eax, 0x2000
mov ecx, dword [ebp - 0x134]
mov word [ecx + 0x16], ax
jmp 0x40135e
cmp dword [ebp + 0x14], 1
jne 0x40135e
mov eax, dword [ebp - 0x134]
movzx eax, word [eax + 0x16]
and eax, 0xdfff
mov ecx, dword [ebp - 0x134]
mov word [ecx + 0x16], ax
cmp dword [ebp - 0x18], 0xffffffff
je 0x40136d
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xc], 0
jne 0x401397
cmp dword [ebp - 0x10], 0
je 0x401389
push 0x8000
push 0
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp + 0xc]
and dword [eax], 0
mov eax, dword [ebp + 0x10]
and dword [eax], 0
jmp 0x4013a7
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
mov dword [eax], ecx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
mov eax, dword [ebp - 0xc]
leave
ret 0x10