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

Disassembly:
push 0x98
mov eax, 0x431453
call fcn.0041bae6
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 0x40c8d2
push 0x5bb
push 0x80004005
push ecx
mov esi, esp
call fcn.00412bcd
push eax
mov ecx, esi
call fcn.0040f03e
lea ecx, [ebp - 0x84]
call fcn.00412d2a
and dword [ebp - 4], 0
lea eax, [ebp - 0x84]
push eax
mov ecx, ebx
call fcn.00402671
mov ecx, dword [ebp - 0x7c]
add ecx, 0xfffffff0
jmp 0x40cfcb
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 0x40c93b
push 0x5bf
push 0x80004005
push ecx
mov esi, esp
call fcn.00412bcd
push eax
mov ecx, esi
call fcn.0040f03e
lea ecx, [ebp - 0x84]
call fcn.00412d2a
mov dword [ebp - 4], 1
lea eax, [ebp - 0x84]
mov ecx, ebx
push eax
call fcn.00402671
mov ecx, dword [ebp - 0x7c]
jmp 0x40cfc8
cmp edi, 0x100000
setb al
test al, al
jne 0x40c976
push 0x5c0
push 0x80004005
push ecx
mov esi, esp
call fcn.00412bcd
push eax
mov ecx, esi
call fcn.0040f03e
lea ecx, [ebp - 0x84]
call fcn.00412d2a
mov dword [ebp - 4], 2
jmp 0x40c925
test edx, edx
setne al
test al, al
jne 0x40c9b0
push 0x5c1
push 0x80004005
push ecx
mov esi, esp
call fcn.00412bcd
push eax
mov ecx, esi
call fcn.0040f03e
lea ecx, [ebp - 0x84]
call fcn.00412d2a
mov dword [ebp - 4], 3
jmp 0x40c925
lea ecx, [ebp - 0x74]
call fcn.00401e2e
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 0x40c9ec
test esi, esi
jne 0x40cb50
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x40ca2b
movzx ecx, ax
or ecx, 0x80070000
mov dword [ebx + 4], 0x5ca
test eax, eax
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
mov dword [ebx], eax
call fcn.00412bcd
push eax
lea ecx, [ebx + 8]
call fcn.0040f03e
jmp 0x40cfb5
push ecx
mov ecx, dword [ebp - 0x74]
mov edi, esp
lea ecx, [ecx - 0x10]
call fcn.00412c8f
add eax, 0x10
lea edx, [ebp - 0x74]
lea ecx, [ebp - 0x84]
mov dword [edi], eax
call fcn.00407cae
pop ecx
mov byte [ebp - 4], 6
cmp dword [ebp - 0x84], 0
jge 0x40cab3
cmp dword [ebp - 0x80], 0
mov eax, 0x5cd
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.00412c8f
add eax, 0x10
lea ecx, [ebp - 0x1c]
mov dword [edi], eax
call fcn.00412d2a
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 7
push eax
mov ecx, ebx
call fcn.00402671
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.00412d0e
mov ecx, dword [ebp - 0x7c]
lea ecx, [ecx - 0x10]
call fcn.00412d0e
jmp 0x40cfb5
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x7c]
add ecx, 0xfffffff0
call fcn.00412d0e
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 0x40caec
test esi, esi
je 0x40caec
xor eax, eax
inc eax
jmp 0x40caee
xor eax, eax
test eax, eax
setne al
test al, al
jne 0x40cb4a
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5d0
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 8
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.00402671
mov ecx, dword [ebp - 0x14]
jmp 0x40caa6
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 0x40cbad
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5d6
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 9
jmp 0x40cb37
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.004122da
test al, al
jne 0x40cc2a
push 0x5d9
push 0x80004005
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0xb
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.00402671
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.00412d0e
cmp dword [ebp - 0x88], 0
je 0x40cfb5
push dword [ebp - 0x88]
jmp 0x40cfaf
cmp byte [ebp - 0x89], 0
jne 0x40cc5b
push 0x5da
push 0x80004005
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0xc
jmp 0x40cbfc
and dword [ebp - 0x9c], 0
cmp dword [ebp - 0x84], 0
ja 0x40cc75
push 0x80070057
call fcn.00412c77
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 0x40ccdb
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5dc
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0xd
jmp 0x40cbfc
mov ecx, dword [ebp - 0x90]
cmp dword [ebp - 0x9c], ecx
sete al
test al, al
jne 0x40cd33
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5dd
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0xe
jmp 0x40cbfc
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.00411b22
push str.__key_begin
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0xf
call fcn.00411bb3
push str.key_end__
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 0x10
call fcn.00411bb3
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.0040f14f
mov dword [ebp - 0x98], eax
cmp eax, 0xffffffff
jne 0x40cdd0
push 0x5f3
push 0x80004005
push ecx
mov ecx, esp
push str.Could_not_find_key
call fcn.0041284d
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
push eax
mov ecx, ebx
mov byte [ebp - 4], 0x12
call fcn.00402671
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.00412d0e
jmp 0x40cf86
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.0040f14f
mov edx, eax
cmp edx, 0xffffffff
mov dword [ebp - 0x90], edx
setne cl
test cl, cl
jne 0x40ce64
push 0x5f6
push 0x80004005
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0x13
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.00402671
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.00412d0e
xor edi, edi
lea ecx, [ebp - 0x70]
push edi
push 1
call fcn.00411c5d
push edi
push 1
lea ecx, [ebp - 0x58]
call fcn.00411c5d
push edi
push 1
lea ecx, [ebp - 0x40]
call fcn.00411c5d
cmp dword [ebp - 0x88], edi
jmp 0x40cc19
cmp edx, dword [ebp - 0x98]
setg al
test al, al
jne 0x40ce99
push 0x5f8
push 0x80004005
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0x14
jmp 0x40ce20
push str.__key_begin
call fcn.00419050
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 0x40ceec
push 0x5fb
push 0x80004005
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0x15
jmp 0x40ce20
cmp ecx, 0x400
setl al
test al, al
jne 0x40cf24
push 0x5fc
push 0x80004005
push ecx
mov edi, esp
call fcn.00412bcd
push eax
mov ecx, edi
call fcn.0040f03e
lea ecx, [ebp - 0x1c]
call fcn.00412d2a
mov byte [ebp - 4], 0x16
jmp 0x40ce20
push str.__key_begin
call fcn.00419050
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.00411b22
mov ecx, dword [ebp - 0x94]
lea eax, [ebp - 0x28]
push eax
call fcn.0040e3a2
push 0
push 1
lea ecx, [ebp - 0x28]
call fcn.00411c5d
and dword [ebx], 0
and dword [ebx + 4], 0
call fcn.00412bcd
push eax
lea ecx, [ebx + 8]
call fcn.0040f03e
push 0
push 1
lea ecx, [ebp - 0x70]
call fcn.00411c5d
push 0
push 1
lea ecx, [ebp - 0x58]
call fcn.00411c5d
push 0
push 1
lea ecx, [ebp - 0x40]
call fcn.00411c5d
test edi, edi
je 0x40cfb5
push edi
call fcn.00418695
pop ecx
cmp esi, 0xffffffff
je 0x40cfc5
test esi, esi
je 0x40cfc5
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x74]
lea ecx, [ecx - 0x10]
call fcn.00412d0e
mov eax, ebx
call fcn.0041ba95
ret