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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x130
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x128], 0xffffffff
call fcn.004103f9
mov dword [ebp - 0x1c], eax
push 0
mov ax, word [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.004102c4
add esp, 0xc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40b669
jmp 0x40bde6
push 0x4366fc
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x40b691
call fcn.0040fb96
push eax
push 0xc
call fcn.00410c1b
add esp, 8
mov dword [ebp - 0x18], eax
jmp 0x40bde6
push 0x4366fc
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x40b6c2
push 0x4366fc
call fcn.0040fb96
push eax
push 0xe
call fcn.00410c1b
add esp, 0xc
mov dword [ebp - 0x18], eax
jmp 0x40bde6
push 0x20
push 0x8000
push 0x4366fc
call fcn.00413d00
add esp, 0xc
mov edx, dword [ebp + 0x14]
mov dword [edx], eax
mov eax, dword [ebp + 0x14]
cmp dword [eax], 0xffffffff
jne 0x40b700
call fcn.0040fb96
push eax
push 0x4366fc
push 0xf
call fcn.00410c1b
add esp, 0xc
mov dword [ebp - 0x18], eax
jmp 0x40bde6
lea ecx, [ebp - 8]
push ecx
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call fcn.0040fb44
add esp, 8
cmp dword [ebp - 8], 0xac
jae 0x40b73b
mov ecx, dword [ebp - 8]
push ecx
push 0xac
push 0x4366fc
push 0x10
call fcn.00410c1b
add esp, 0x10
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
push 0
push 0
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call fcn.00414f3d
add esp, 0xc
mov dword [ebp - 0x124], eax
push 0xac
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call fcn.00413a21
add esp, 0xc
mov dword [ebp - 0x124], eax
cmp dword [ebp - 0x124], 0xac
je 0x40b7ce
push 0xac
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call fcn.00413a21
add esp, 0xc
mov dword [ebp - 0x124], eax
cmp dword [ebp - 0x124], 0xac
je 0x40b7ce
mov ecx, dword [ebp - 0x124]
push ecx
push 0xac
call fcn.0040fb96
push eax
push 0x4366fc
push 0x11
call fcn.00410c1b
add esp, 0x14
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 0x14]
cmp eax, 4
jle 0x40b805
push 0x4366fc
mov ecx, dword [ebp + 0x10]
movsx edx, word [ecx + 0x16]
push edx
mov eax, dword [ebp + 0x10]
movsx ecx, word [eax + 0x14]
push ecx
push 7
push 4
push 0x12
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov edx, dword [ebp + 0x10]
movsx eax, byte [edx]
movsx ecx, byte [0x429a48]
cmp eax, ecx
jne 0x40b828
mov edx, dword [ebp + 0x10]
movsx eax, byte [edx + 1]
movsx ecx, byte [0x429a49]
cmp eax, ecx
je 0x40b85e
mov edx, dword [ebp + 0x10]
movsx eax, byte [edx + 1]
push eax
mov ecx, dword [ebp + 0x10]
movsx edx, byte [ecx]
push edx
movsx eax, byte [0x429a49]
push eax
movsx ecx, byte [0x429a48]
push ecx
push 0x4366fc
push 0x13
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 0x14]
movsx ecx, word [ebp + 0xc]
cmp eax, ecx
je 0x40b899
push 0x4366fc
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 0x16]
push eax
mov ecx, dword [ebp + 0x10]
movsx edx, word [ecx + 0x14]
push edx
movsx eax, word [ebp + 0xc]
push eax
push 0x14
call fcn.00410c1b
add esp, 0x14
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx + 0xa]
cmp edx, dword [ebp - 8]
je 0x40b932
mov eax, dword [ebp + 0x10]
movsx ecx, word [eax + 8]
test ecx, ecx
je 0x40b8e5
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 0xa]
push ecx
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 0x16]
push eax
mov ecx, dword [ebp + 0x10]
movsx edx, word [ecx + 0x14]
push edx
push 0x4366fc
push 0x16
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov dword [ebp - 0x124], 0x18
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 0xa]
cmp ecx, dword [ebp - 0x124]
je 0x40b932
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0xa]
push eax
mov ecx, dword [ebp - 0x124]
push ecx
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 0x16]
push eax
mov ecx, dword [ebp + 0x10]
movsx edx, word [ecx + 0x14]
push edx
push 0x4366fc
push 0x17
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov eax, dword [ebp + 0x10]
movsx ecx, word [eax + 8]
sub ecx, 1
imul ecx, ecx, 0x94
add ecx, 0xac
mov dword [ebp - 8], ecx
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0xa]
cmp eax, dword [ebp - 8]
je 0x40b988
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0xa]
push eax
mov ecx, dword [ebp + 0x10]
movsx edx, word [ecx + 0x16]
push edx
mov eax, dword [ebp + 0x10]
movsx ecx, word [eax + 0x14]
push ecx
push 0x4366fc
push 0x18
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov dword [ebp - 0x10], 6
push 0x4366fc
call fcn.00410b19
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x40b9ae
mov edx, dword [ebp - 0x10]
and edx, 0xfffffffb
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x14]
and eax, dword [ebp - 0x10]
mov ecx, dword [0x42f7d8]
and ecx, dword [ebp - 0x10]
cmp eax, ecx
je 0x40b9e8
mov edx, dword [ebp - 0x14]
and edx, 6
push edx
mov eax, dword [0x42f7d8]
and eax, 6
push eax
push 0x4366fc
push 0x15
call fcn.00410c1b
add esp, 0x10
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov ecx, dword [ebp + 0x10]
mov dx, word [ecx + 2]
and dx, 0x7fff
mov eax, dword [ebp + 0x10]
mov word [eax + 2], dx
mov ecx, dword [ebp - 4]
neg ecx
sbb ecx, ecx
and ecx, 0x8000
mov edx, dword [ebp + 0x10]
mov ax, word [edx + 2]
or ax, cx
mov ecx, dword [ebp + 0x10]
mov word [ecx + 2], ax
cmp dword [ebp + 0x18], 0
je 0x40bb8b
cmp dword [ebp - 4], 0
je 0x40ba3a
mov edx, dword [ebp + 0x10]
cmp dword [edx + 4], 0x1b5de6b6
jne 0x40ba3a
jmp 0x40bb8b
lea eax, [ebp - 0xc]
push eax
push 0x4366fc
call fcn.0040c3dc
add esp, 8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40ba59
jmp 0x40bdc9
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx + 4]
cmp edx, dword [ebp - 0xc]
je 0x40bb8b
cmp dword [ebp - 0xc], 0x1b5de6b6
je 0x40bb8b
mov eax, dword [ebp + 0x10]
cmp dword [eax + 4], 0x1b5de6b6
je 0x40bb69
cmp dword [ebp - 0xc], 0x1b5de6b6
je 0x40bb69
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.0040b220
add esp, 4
mov edx, dword [ebp + 0x10]
movsx eax, byte [edx + 0x48]
cmp eax, 1
jne 0x40bb5d
lea ecx, [ebp - 0x12c]
push ecx
lea edx, [ebp - 0x130]
push edx
call fcn.0040d44c
add esp, 8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40bad2
jmp 0x40bdc9
mov eax, dword [ebp - 0x130]
and eax, 0xff
mov ecx, dword [ebp + 0x10]
movsx edx, byte [ecx + 0x49]
cmp eax, edx
jg 0x40bb14
mov eax, dword [ebp - 0x130]
and eax, 0xff
mov ecx, dword [ebp + 0x10]
movsx edx, byte [ecx + 0x49]
cmp eax, edx
jne 0x40bb5d
mov eax, dword [ebp - 0x12c]
and eax, 0xff
mov ecx, dword [ebp + 0x10]
movsx edx, byte [ecx + 0x4a]
cmp eax, edx
jle 0x40bb5d
mov eax, dword [ebp + 0x10]
push eax
call fcn.0040b220
add esp, 4
push 0x4366fc
mov ecx, dword [ebp + 0x10]
movsx edx, byte [ecx + 0x4a]
push edx
mov eax, dword [ebp + 0x10]
movsx ecx, byte [eax + 0x49]
push ecx
mov edx, dword [ebp - 0x12c]
and edx, 0xff
push edx
mov eax, dword [ebp - 0x130]
and eax, 0xff
push eax
push 0x19
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bb8b
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.0040b220
add esp, 4
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 4]
push ecx
push 0x4366fc
push 0x1a
call fcn.00410c1b
add esp, 0x10
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 2]
and eax, 1
test eax, eax
jne 0x40bdc9
mov ecx, dword [ebp + 0x10]
movsx edx, word [ecx + 0x14]
cmp edx, 2
jl 0x40bdc9
movsx eax, byte [0x436800]
test eax, eax
je 0x40bdc9
push 0x4366fc
call fcn.0040d4ab
add esp, 4
cmp eax, 2
je 0x40bdc9
push 0x436800
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x40bbfa
call fcn.0040fb96
push eax
push 0x1b
call fcn.00410c1b
add esp, 8
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
push 0x436800
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x40bc2b
push 0x436800
call fcn.0040fb96
push eax
push 0x1c
call fcn.00410c1b
add esp, 0xc
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov ecx, dword [ebp - 0x14]
and ecx, 6
mov edx, dword [0x42f7dc]
and edx, 6
cmp ecx, edx
je 0x40bc66
mov eax, dword [ebp - 0x14]
and eax, 6
push eax
mov ecx, dword [0x42f7dc]
and ecx, 6
push ecx
push 0x436800
push 0x1d
call fcn.00410c1b
add esp, 0x10
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
push 0x20
push 0x8000
push 0x436800
call fcn.00413d00
add esp, 0xc
mov dword [ebp - 0x128], eax
cmp dword [ebp - 0x128], 0xffffffff
jne 0x40bca6
call fcn.0040fb96
push eax
push 0x436800
push 0x1e
call fcn.00410c1b
add esp, 0xc
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
lea edx, [ebp - 8]
push edx
mov eax, dword [ebp - 0x128]
push eax
call fcn.0040fb44
add esp, 8
cmp dword [ebp - 8], 0x104
je 0x40bd01
mov ecx, dword [ebp - 0x128]
push ecx
call fcn.00413941
add esp, 4
mov edx, dword [ebp - 8]
push edx
push 0x104
mov eax, dword [ebp + 0x10]
movsx ecx, word [eax + 0x16]
push ecx
mov edx, dword [ebp + 0x10]
movsx eax, word [edx + 0x14]
push eax
push 0x436800
push 0x1f
call fcn.00410c1b
add esp, 0x18
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
push 0x104
lea ecx, [ebp - 0x120]
push ecx
mov edx, dword [ebp - 0x128]
push edx
call fcn.00413a21
add esp, 0xc
mov dword [ebp - 0x124], eax
cmp dword [ebp - 0x124], 0x104
je 0x40bd90
push 0x104
lea eax, [ebp - 0x120]
push eax
mov ecx, dword [ebp - 0x128]
push ecx
call fcn.00413a21
add esp, 0xc
mov dword [ebp - 0x124], eax
cmp dword [ebp - 0x124], 0x104
je 0x40bd90
mov edx, dword [ebp - 0x128]
push edx
call fcn.00413941
add esp, 4
mov eax, dword [ebp - 0x124]
push eax
push 0x104
call fcn.0040fb96
push eax
push 0x436800
push 0x20
call fcn.00410c1b
add esp, 0x14
mov dword [ebp - 0x18], eax
jmp 0x40bdc9
mov ecx, dword [ebp - 0x128]
push ecx
call fcn.00413941
add esp, 4
push 0x436800
lea edx, [ebp - 0x120]
push edx
call fcn.00410256
add esp, 8
test eax, eax
jne 0x40bdc9
push 0x436800
push 0x21
call fcn.00410c1b
add esp, 8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40bde6
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax]
push ecx
call fcn.00413941
add esp, 4
mov edx, dword [ebp + 0x14]
mov dword [edx], 0xffffffff
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00410406
add esp, 4
mov eax, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret