Function at 0x10040b90
Capabilities:
Check if file exists
Get file attributes
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100a1b2d
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov ebx, ecx
push edi
mov dword [ebp - 0x20], ebx
call fcn.10041180
mov dword [ebp - 0x14], 0
mov esi, 0xa
jmp 0x10040bd0
push 0x100b2854
lea eax, [ebp - 0x14]
push edi
push eax
call fcn.10088fbb
add esp, 0xc
test eax, eax
jne 0x10040bf0
mov edi, dword [ebp - 0x14]
test edi, edi
jne 0x10040c13
mov edi, dword [ebp + 8]
dec esi
test esi, esi
jle 0x10040f18
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10040f18
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x10040bd0
mov esi, dword [ebx + 0x18]
test esi, esi
je 0x10040c2f
lea ebx, [ebx]
mov ecx, esi
mov esi, dword [esi + 0x28]
push 1
mov eax, dword [ecx]
call dword [eax]
test esi, esi
jne 0x10040c20
push 2
push 0
push edi
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 8], 0xffffffff
mov dword [ebx + 4], 0xffffffff
call fcn.10089440
push edi
call fcn.10088d40
push 0
push 0
push edi
mov esi, eax
call fcn.10089440
add esp, 0x1c
test esi, esi
jne 0x10040cd3
cmp byte [ebx + 0x2c], 0
jne 0x10040cb1
mov edx, dword [str.Error_document_empty.]
mov ecx, edx
mov byte [ebx + 0x2c], 1
mov dword [ebx + 0x30], 0xd
lea esi, [ecx + 1]
lea ebx, [ebx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040c90
sub ecx, esi
push ecx
push edx
lea ecx, [ebx + 0x34]
call fcn.1003f650
mov dword [ebx + 0x40], 0xffffffff
mov dword [ebx + 0x3c], 0xffffffff
push dword [ebp - 0x14]
xor bl, bl
call fcn.10089127
add esp, 4
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov dword [ebp - 0x10], 0x100c731c
push esi
lea ecx, [ebp - 0x10]
mov dword [ebp - 4], 0
call fcn.1003f5a0
lea eax, [esi + 1]
push eax
call fcn.10079e9e
push edi
push 1
push esi
push eax
mov dword [ebp - 0x18], eax
mov byte [eax], 0
call fcn.10089e45
add esp, 0x14
cmp eax, 1
je 0x10040d7d
cmp byte [ebx + 0x2c], 0
jne 0x10040d48
mov edx, dword [str.Failed_to_open_file]
mov ecx, edx
mov byte [ebx + 0x2c], 1
mov dword [ebx + 0x30], 2
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040d27
sub ecx, esi
push ecx
push edx
lea ecx, [ebx + 0x34]
call fcn.1003f650
mov dword [ebx + 0x40], 0xffffffff
mov dword [ebx + 0x3c], 0xffffffff
mov eax, dword [ebp - 0x10]
cmp eax, 0x100c731c
je 0x10040d5b
push eax
call fcn.10079d07
add esp, 4
push dword [ebp - 0x14]
xor bl, bl
call fcn.10089127
add esp, 4
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp - 0x18]
mov ebx, eax
mov edi, eax
mov byte [eax + esi], 0
mov al, byte [eax]
mov esi, dword [ebp - 0x10]
test al, al
je 0x10040e79
cmp al, 0xa
jne 0x10040de4
mov eax, dword [esi]
mov ecx, edi
mov edx, dword [esi + 4]
sub ecx, ebx
inc ecx
add eax, ecx
mov dword [ebp + 8], ecx
mov dword [ebp - 0x1c], eax
cmp eax, edx
jbe 0x10040dc0
add eax, edx
lea ecx, [ebp - 0x10]
push eax
call fcn.1003f5a0
mov esi, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
mov eax, dword [esi]
push ecx
add eax, 8
add eax, esi
push ebx
push eax
call fcn.1007d410
mov eax, dword [ebp - 0x1c]
add esp, 0xc
inc edi
mov dword [esi], eax
mov ebx, edi
mov byte [eax + esi + 8], 0
jmp 0x10040e6f
cmp al, 0xd
jne 0x10040e6e
mov eax, edi
sub eax, ebx
mov dword [ebp + 8], eax
test eax, eax
jle 0x10040e33
mov ecx, dword [esi]
mov edx, dword [esi + 4]
add ecx, eax
mov dword [ebp - 0x1c], ecx
cmp ecx, edx
jbe 0x10040e17
lea eax, [edx + ecx]
push eax
lea ecx, [ebp - 0x10]
call fcn.1003f5a0
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp + 8]
push eax
mov eax, dword [esi]
add eax, 8
add eax, esi
push ebx
push eax
call fcn.1007d410
mov eax, dword [ebp - 0x1c]
add esp, 0xc
mov dword [esi], eax
mov byte [eax + esi + 8], 0
mov ebx, dword [esi]
mov eax, dword [esi + 4]
inc ebx
mov byte [ebp + 0xb], 0xa
cmp ebx, eax
jbe 0x10040e4f
add eax, ebx
lea ecx, [ebp - 0x10]
push eax
call fcn.1003f5a0
mov esi, dword [ebp - 0x10]
mov eax, dword [esi]
mov cl, byte [ebp + 0xb]
mov byte [eax + esi + 8], cl
mov dword [esi], ebx
mov byte [ebx + esi + 8], 0
lea ebx, [edi + 1]
cmp byte [ebx], 0xa
jne 0x10040e6a
lea ebx, [edi + 2]
mov edi, ebx
jmp 0x10040e6f
inc edi
mov al, byte [edi]
test al, al
jne 0x10040d95
sub edi, ebx
je 0x10040e8a
push edi
push ebx
lea ecx, [ebp - 0x10]
call fcn.1003f720
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp - 0x18]
push eax
call fcn.10079d07
mov edi, dword [ebp - 0x20]
lea eax, [esi + 8]
add esp, 4
mov ecx, edi
mov edx, dword [edi]
push 0
push 0
push eax
call dword [edx + 8]
cmp byte [edi + 0x2c], 0
je 0x10040ee5
cmp esi, 0x100c731c
je 0x10040d5b
push esi
call fcn.10079d07
add esp, 4
xor bl, bl
push dword [ebp - 0x14]
call fcn.10089127
add esp, 4
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
cmp esi, 0x100c731c
je 0x10040ef6
push esi
call fcn.10079d07
add esp, 4
push dword [ebp - 0x14]
mov bl, 1
call fcn.10089127
add esp, 4
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
cmp byte [ebx + 0x2c], 0
jne 0x10040f55
mov edx, dword [str.Failed_to_open_file]
mov ecx, edx
mov byte [ebx + 0x2c], 1
mov dword [ebx + 0x30], 2
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040f34
sub ecx, esi
push ecx
push edx
lea ecx, [ebx + 0x34]
call fcn.1003f650
mov dword [ebx + 0x40], 0xffffffff
mov dword [ebx + 0x3c], 0xffffffff
mov ecx, dword [ebp - 0xc]
xor al, al
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8