Function at 0x401198
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 0x401206
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 [0x413d48]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x128]
mov dword [ebp - 0x12c], eax
jmp 0x40120f
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 0x401229
jmp 0x401363
and dword [ebp - 0x130], 0
jmp 0x40123f
mov eax, dword [ebp - 0x130]
inc eax
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0x32
jge 0x401278
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 0x40126e
jmp 0x401278
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401232
push 0
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x401292
cmp dword [ebp - 8], 0xffffffff
jne 0x40129c
jmp 0x401363
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 0x4012c1
jmp 0x401363
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 8]
jae 0x401300
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 0x4012ec
jmp 0x401363
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 0x4012c7
mov dword [ebp - 0xc], 1
cmp dword [ebp + 0x14], 2
jae 0x401363
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 0x401344
mov eax, dword [ebp - 0x134]
movzx eax, word [eax + 0x16]
or eax, 0x2000
mov ecx, dword [ebp - 0x134]
mov word [ecx + 0x16], ax
jmp 0x401363
cmp dword [ebp + 0x14], 1
jne 0x401363
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 0x401372
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xc], 0
jne 0x40139c
cmp dword [ebp - 0x10], 0
je 0x40138e
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 0x4013ac
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