Function at 0x401e20
Capabilities:
Check if file exists
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4c5617
mov eax, dword fs:[0]
push eax
sub esp, 0xf0
mov eax, dword [0x4e5d60]
xor eax, esp
mov dword [esp + 0xe8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4e5d60]
xor eax, esp
push eax
lea eax, [esp + 0x104]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [esp + 0x10c], ebx
call fcn.004990cf
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x401e7e
push 0x80004005
call fcn.0040f160
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov byte [esp + 0x10c], 1
mov edi, dword [esp + 0x114]
cmp dword [edi - 0xc], ebx
jne 0x401ec0
add eax, 0xfffffff0
or edi, 0xffffffff
mov byte [esp + 0x10c], bl
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x4021ef
lea ecx, [esp + 0x20]
push 0x4cbc10
push ecx
call fcn.00401bb0
add esp, 8
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x110], 2
call fcn.0040ebc0
mov byte [esp + 0x10c], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
or edi, 0xffffffff
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x401f0e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [esp + 0x18]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x401f38
lea eax, [esi - 0x10]
mov byte [esp + 0x10c], bl
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x4021ef
push 0x4cbc38
lea ecx, [esp + 0x20]
push esi
push ecx
mov dword [esp + 0x28], ebx
call fcn.004a6ee5
add esp, 0xc
test eax, eax
jne 0x4021d9
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x4021d9
push 2
push ebx
push eax
call fcn.004a6fc2
mov edx, dword [esp + 0x28]
add esp, 0xc
push edx
call fcn.004a71e4
add esp, 4
push ebx
mov esi, eax
mov eax, dword [esp + 0x20]
push ebx
push eax
call fcn.004a6fc2
add esp, 0xc
mov dword [esp + 0x90], 0xf
mov dword [esp + 0x8c], ebx
mov byte [esp + 0x7c], bl
lea eax, [esi + 2]
mov byte [esp + 0x10c], 3
cmp eax, ebx
ja 0x401fc2
push edi
push eax
lea ecx, [esp + 0x80]
call fcn.0040e6e0
jmp 0x401fcc
push ebx
lea edi, [esp + 0x7c]
call fcn.0040bad0
cmp dword [esp + 0x8c], ebx
ja 0x401fda
call fcn.004c0b0c
cmp dword [esp + 0x90], 0x10
mov eax, dword [esp + 0x7c]
jae 0x401fec
lea eax, [esp + 0x7c]
mov ecx, dword [esp + 0x1c]
push ecx
push esi
push 1
push eax
call fcn.004a74f2
mov edx, dword [esp + 0x2c]
push edx
mov esi, eax
call fcn.004a7586
add esp, 0x14
mov dword [esp + 0x1c], ebx
cmp esi, ebx
je 0x4020c4
xor edi, edi
lea eax, [esp + 0x78]
call fcn.0040b120
cmp byte [eax], 0xef
jne 0x402086
mov edi, 1
lea eax, [esp + 0x78]
call fcn.0040b120
cmp byte [eax], 0xbb
jne 0x402086
mov edi, 2
lea eax, [esp + 0x78]
call fcn.0040b120
cmp byte [eax], 0xbf
jne 0x402086
lea eax, [esp + 0x20]
push eax
lea ebx, [esp + 0x3c]
lea edi, [esp + 0x7c]
call fcn.0040b0d0
call fcn.0040b950
mov esi, dword [eax]
mov ebp, dword [eax + 4]
lea ebx, [esp + 0x28]
call fcn.0040b0d0
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push ebp
push esi
push ecx
push edx
lea eax, [esp + 0x40]
push eax
mov ecx, edi
push ecx
call fcn.0040afb0
lea ecx, [esp + 0x78]
lea esi, [esp + 0x94]
call fcn.0048b7f0
mov ebx, 4
mov edi, 0x4a
mov byte [esp + 0x10c], bl
cmp dword [esp + 0xa4], edi
je 0x4020e7
mov byte [esp + 0x10c], 3
lea ecx, [esp + 0x94]
call fcn.004013e0
lea ecx, [esp + 0x78]
call fcn.0040eb40
lea ecx, [esp + 0x18]
call fcn.0040ed20
lea ecx, [esp + 0x114]
call fcn.0040ed20
jmp 0x402222
push str.session
lea ecx, [esp + 0x60]
call fcn.0040e6a0
lea eax, [esp + 0x5c]
lea ecx, [esp + 0x94]
mov byte [esp + 0x10c], 5
call fcn.00401480
lea ecx, [esp + 0x5c]
mov esi, eax
mov byte [esp + 0x10c], bl
call fcn.0040eb40
cmp dword [esi + 0x10], edi
jne 0x4020b0
push str.restore_on_startup
lea ecx, [esp + 0x44]
call fcn.0040e6a0
lea eax, [esp + 0x40]
mov ecx, esi
mov byte [esp + 0x10c], 6
call fcn.00401480
lea ecx, [esp + 0x40]
mov esi, eax
mov byte [esp + 0x10c], bl
call fcn.0040eb40
call fcn.00401000
test al, al
je 0x4020b0
mov eax, dword [esi + 8]
sub eax, 1
mov byte [esp + 0x10c], 3
lea ecx, [esp + 0x94]
je 0x4021af
sub eax, 3
je 0x402188
sub eax, 1
jmp 0x4020bf
call fcn.004013e0
lea ecx, [esp + 0x78]
call fcn.0040eb40
lea ecx, [esp + 0x18]
call fcn.0040ed20
lea ecx, [esp + 0x114]
call fcn.0040ed20
mov eax, ebx
jmp 0x402227
call fcn.004013e0
lea ecx, [esp + 0x78]
call fcn.0040eb40
lea ecx, [esp + 0x18]
call fcn.0040ed20
lea ecx, [esp + 0x114]
call fcn.0040ed20
mov eax, 1
jmp 0x402227
lea eax, [esi - 0x10]
mov byte [esp + 0x10c], bl
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4021fb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x10c], edi
mov eax, dword [esp + 0x114]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edi
dec edi
test edi, edi
jg 0x402222
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 5
mov ecx, dword [esp + 0x104]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xe8]
xor ecx, esp
call fcn.004a6859
add esp, 0xfc
ret 4