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

Disassembly:
push 0x98
mov eax, 0x431887
call fcn.0041be96
mov ebx, ecx
mov ecx, dword [edx + 0x3c]
and dword [ebp - 0xa4], 0
add ecx, edx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x94], eax
cmp dword [ecx], 0x4550
sete al
test al, al
jne 0x40cb96
push 0x5d3
push 0x80004005
push ecx
mov esi, esp
call fcn.00412f7e
push eax
mov ecx, esi
call fcn.0040f3c2
lea ecx, [ebp - 0x84]
call fcn.004130db
and dword [ebp - 4], 0
lea eax, [ebp - 0x84]
push eax
mov ecx, ebx
call fcn.00402691
mov ecx, dword [ebp - 0x7c]
add ecx, 0xfffffff0
jmp 0x40d28f
mov edi, dword [ecx + 0x9c]
test edi, edi
mov edx, dword [ecx + 0x98]
setne al
mov dword [ebp - 0x98], edx
mov dword [ebp - 0x90], edi
mov byte [ebp - 0x89], al
test al, al
jne 0x40cbff
push 0x5d7
push 0x80004005
push ecx
mov esi, esp
call fcn.00412f7e
push eax
mov ecx, esi
call fcn.0040f3c2
lea ecx, [ebp - 0x84]
call fcn.004130db
mov dword [ebp - 4], 1
lea eax, [ebp - 0x84]
mov ecx, ebx
push eax
call fcn.00402691
mov ecx, dword [ebp - 0x7c]
jmp 0x40d28c
cmp edi, 0x100000
setb al
test al, al
jne 0x40cc3a
push 0x5d8
push 0x80004005
push ecx
mov esi, esp
call fcn.00412f7e
push eax
mov ecx, esi
call fcn.0040f3c2
lea ecx, [ebp - 0x84]
call fcn.004130db
mov dword [ebp - 4], 2
jmp 0x40cbe9
test edx, edx
setne al
test al, al
jne 0x40cc74
push 0x5d9
push 0x80004005
push ecx
mov esi, esp
call fcn.00412f7e
push eax
mov ecx, esi
call fcn.0040f3c2
lea ecx, [ebp - 0x84]
call fcn.004130db
mov dword [ebp - 4], 3
jmp 0x40cbe9
lea ecx, [ebp - 0x74]
call fcn.00401e4e
xor eax, eax
mov dword [ebp - 4], 4
push eax
push eax
push 3
push eax
push 7
push 1
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0xa0], esi
mov byte [ebp - 4], 5
cmp esi, 0xffffffff
je 0x40ccb0
test esi, esi
jne 0x40ce14
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x40ccef
movzx ecx, ax
or ecx, 0x80070000
mov dword [ebx + 4], 0x5e2
test eax, eax
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
mov dword [ebx], eax
call fcn.00412f7e
push eax
lea ecx, [ebx + 8]
call fcn.0040f3c2
jmp 0x40d279
push ecx
mov ecx, dword [ebp - 0x74]
mov edi, esp
lea ecx, [ecx - 0x10]
call fcn.00413040
add eax, 0x10
lea edx, [ebp - 0x74]
lea ecx, [ebp - 0x84]
mov dword [edi], eax
call fcn.00407daa
pop ecx
mov byte [ebp - 4], 6
cmp dword [ebp - 0x84], 0
jge 0x40cd77
cmp dword [ebp - 0x80], 0
mov eax, 0x5e5
cmovne eax, dword [ebp - 0x80]
push eax
push dword [ebp - 0x84]
push ecx
mov ecx, dword [ebp - 0x7c]
mov edi, esp
lea ecx, [ecx - 0x10]
call fcn.00413040
add eax, 0x10
lea ecx, [ebp - 0x1c]
mov dword [edi], eax
call fcn.004130db
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 7
push eax
mov ecx, ebx
call fcn.00402691
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004130bf
mov ecx, dword [ebp - 0x7c]
lea ecx, [ecx - 0x10]
call fcn.004130bf
jmp 0x40d279
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x7c]
add ecx, 0xfffffff0
call fcn.004130bf
xor eax, eax
push eax
push eax
push 3
push eax
push 7
push 1
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0xa0], esi
cmp esi, 0xffffffff
je 0x40cdb0
test esi, esi
je 0x40cdb0
xor eax, eax
inc eax
jmp 0x40cdb2
xor eax, eax
test eax, eax
setne al
test al, al
jne 0x40ce0e
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5e8
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 8
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.00402691
mov ecx, dword [ebp - 0x14]
jmp 0x40cd6a
mov edi, dword [ebp - 0x90]
xor eax, eax
push eax
push eax
push eax
push dword [ebp - 0x98]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
setne al
test al, al
jne 0x40ce71
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5ee
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 9
jmp 0x40cdfb
xor eax, eax
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x84], eax
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x7c], eax
push ecx
push edi
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 0xa
call fcn.00412689
test al, al
jne 0x40ceee
push 0x5f1
push 0x80004005
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0xb
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.00402691
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004130bf
cmp dword [ebp - 0x88], 0
je 0x40d279
push dword [ebp - 0x88]
jmp 0x40d273
cmp byte [ebp - 0x89], 0
jne 0x40cf1f
push 0x5f2
push 0x80004005
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0xc
jmp 0x40cec0
and dword [ebp - 0x9c], 0
cmp dword [ebp - 0x84], 0
ja 0x40cf39
push 0x80070057
call fcn.00413028
push 0
lea eax, [ebp - 0x9c]
push eax
push edi
mov edi, dword [ebp - 0x88]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
setne al
test al, al
jne 0x40cf9f
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5f4
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0xd
jmp 0x40cec0
mov ecx, dword [ebp - 0x90]
cmp dword [ebp - 0x9c], ecx
sete al
test al, al
jne 0x40cff7
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5f5
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0xe
jmp 0x40cec0
and dword [ebp - 0x30], 0
push ecx
push edi
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x2c], 0xf
mov byte [ebp - 0x40], 0
call fcn.00411ed1
push str.__key_begin
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0xf
call fcn.00411f62
push str.key_end__
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 0x10
call fcn.00411f62
mov byte [ebp - 4], 0x11
lea eax, [ebp - 0x58]
push dword [ebp - 0x48]
cmp dword [ebp - 0x44], 0x10
push ecx
cmovae eax, dword [ebp - 0x58]
lea ecx, [ebp - 0x40]
push eax
call fcn.0040f4d3
mov dword [ebp - 0x98], eax
cmp eax, 0xffffffff
jne 0x40d094
push 0x60b
push 0x80004005
push ecx
mov ecx, esp
push str.Could_not_find_key
call fcn.00412bfc
lea ecx, [ebp - 0x1c]
call fcn.004130db
push eax
mov ecx, ebx
mov byte [ebp - 4], 0x12
call fcn.00402691
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004130bf
jmp 0x40d24a
push dword [ebp - 0x60]
cmp dword [ebp - 0x5c], 0x10
lea eax, [ebp - 0x70]
push ecx
cmovae eax, dword [ebp - 0x70]
lea ecx, [ebp - 0x40]
push eax
call fcn.0040f4d3
mov edx, eax
cmp edx, 0xffffffff
mov dword [ebp - 0x90], edx
setne cl
test cl, cl
jne 0x40d128
push 0x60e
push 0x80004005
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0x13
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.00402691
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004130bf
xor edi, edi
lea ecx, [ebp - 0x70]
push edi
push 1
call fcn.0041200c
push edi
push 1
lea ecx, [ebp - 0x58]
call fcn.0041200c
push edi
push 1
lea ecx, [ebp - 0x40]
call fcn.0041200c
cmp dword [ebp - 0x88], edi
jmp 0x40cedd
cmp edx, dword [ebp - 0x98]
setg al
test al, al
jne 0x40d15d
push 0x610
push 0x80004005
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0x14
jmp 0x40d0e4
push str.__key_begin
call fcn.00419400
pop ecx
mov ecx, dword [ebp - 0x90]
sub ecx, dword [ebp - 0x98]
sub ecx, eax
test ecx, ecx
mov dword [ebp - 0x90], ecx
setg al
test al, al
jne 0x40d1b0
push 0x613
push 0x80004005
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0x15
jmp 0x40d0e4
cmp ecx, 0x400
setl al
test al, al
jne 0x40d1e8
push 0x614
push 0x80004005
push ecx
mov edi, esp
call fcn.00412f7e
push eax
mov ecx, edi
call fcn.0040f3c2
lea ecx, [ebp - 0x1c]
call fcn.004130db
mov byte [ebp - 4], 0x16
jmp 0x40d0e4
push str.__key_begin
call fcn.00419400
mov edx, dword [ebp - 0x90]
add eax, edi
add eax, dword [ebp - 0x98]
and dword [ebp - 0x18], 0
pop ecx
push edx
push eax
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
call fcn.00411ed1
mov ecx, dword [ebp - 0x94]
lea eax, [ebp - 0x28]
push eax
call fcn.0040e6e4
push 0
push 1
lea ecx, [ebp - 0x28]
call fcn.0041200c
and dword [ebx], 0
and dword [ebx + 4], 0
call fcn.00412f7e
push eax
lea ecx, [ebx + 8]
call fcn.0040f3c2
push 0
push 1
lea ecx, [ebp - 0x70]
call fcn.0041200c
push 0
push 1
lea ecx, [ebp - 0x58]
call fcn.0041200c
push 0
push 1
lea ecx, [ebp - 0x40]
call fcn.0041200c
test edi, edi
je 0x40d279
push edi
call fcn.00418a45
pop ecx
cmp esi, 0xffffffff
je 0x40d289
test esi, esi
je 0x40d289
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x74]
lea ecx, [ecx - 0x10]
call fcn.004130bf
mov eax, ebx
call fcn.0041be45
ret