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

Disassembly:
push 0x98
mov eax, 0x4395b2
call fcn.0041a5b5
mov ebx, ecx
mov dword [ebp - 0x98], ebx
mov eax, dword [ebp + 8]
and dword [ebp - 0xa4], 0
mov dword [ebp - 0x94], eax
mov eax, dword [edx + 0x3c]
cmp dword [eax + edx], 0x4550
je 0x40d1e9
push 0x5c7
push 0x80004005
push ecx
mov esi, esp
call fcn.00413c5e
push eax
mov ecx, esi
call fcn.00413a4e
lea ecx, [ebp - 0x84]
call fcn.004142d3
and dword [ebp - 4], 0
lea eax, [ebp - 0x84]
push eax
mov ecx, ebx
call fcn.0040153c
mov ecx, dword [ebp - 0x7c]
add ecx, 0xfffffff0
jmp 0x40d87b
mov edi, dword [eax + edx + 0x9c]
test edi, edi
mov ecx, dword [eax + edx + 0x98]
setne al
mov dword [ebp - 0x98], ecx
mov dword [ebp - 0x90], edi
mov byte [ebp - 0x89], al
test al, al
jne 0x40d254
push 0x5cb
push 0x80004005
push ecx
mov esi, esp
call fcn.00413c5e
push eax
mov ecx, esi
call fcn.00413a4e
lea ecx, [ebp - 0x84]
call fcn.004142d3
mov dword [ebp - 4], 1
lea eax, [ebp - 0x84]
mov ecx, ebx
push eax
call fcn.0040153c
mov ecx, dword [ebp - 0x7c]
jmp 0x40d878
cmp edi, 0x100000
setb al
test al, al
jne 0x40d28f
push 0x5cc
push 0x80004005
push ecx
mov esi, esp
call fcn.00413c5e
push eax
mov ecx, esi
call fcn.00413a4e
lea ecx, [ebp - 0x84]
call fcn.004142d3
mov dword [ebp - 4], 2
jmp 0x40d23e
test ecx, ecx
setne al
test al, al
jne 0x40d2c9
push 0x5cd
push 0x80004005
push ecx
mov esi, esp
call fcn.00413c5e
push eax
mov ecx, esi
call fcn.00413a4e
lea ecx, [ebp - 0x84]
call fcn.004142d3
mov dword [ebp - 4], 3
jmp 0x40d23e
lea ecx, [ebp - 0x74]
call fcn.00401ea6
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 0x40d305
test esi, esi
jne 0x40d469
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x40d344
movzx ecx, ax
or ecx, 0x80070000
mov dword [ebx + 4], 0x5d6
test eax, eax
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
mov dword [ebx], eax
call fcn.00413c5e
push eax
lea ecx, [ebx + 8]
call fcn.00413a4e
jmp 0x40d865
push ecx
mov ecx, dword [ebp - 0x74]
mov edi, esp
mov dword [ebp - 0x78], edi
lea ecx, [ecx - 0x10]
call fcn.0041423d
add eax, 0x10
lea edx, [ebp - 0x74]
lea ecx, [ebp - 0x84]
mov dword [edi], eax
call fcn.004087c6
pop ecx
mov byte [ebp - 4], 6
cmp dword [ebp - 0x84], 0
jge 0x40d3d2
cmp dword [ebp - 0x80], 0
mov eax, 0x5d9
cmovne eax, dword [ebp - 0x80]
push eax
push dword [ebp - 0x84]
push ecx
mov ecx, dword [ebp - 0x7c]
mov edi, esp
mov dword [ebp - 0x78], edi
lea ecx, [ecx - 0x10]
call fcn.0041423d
add eax, 0x10
lea ecx, [ebp - 0x1c]
mov dword [edi], eax
call fcn.004142d3
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 7
push eax
mov ecx, ebx
call fcn.0040153c
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004142bb
mov ecx, dword [ebp - 0x7c]
lea ecx, [ecx - 0x10]
call fcn.004142bb
jmp 0x40d865
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x7c]
add ecx, 0xfffffff0
call fcn.004142bb
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 0x40d40a
test esi, esi
je 0x40d40a
mov al, 1
jmp 0x40d40c
xor al, al
test al, al
jne 0x40d463
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.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 8
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.0040153c
mov ecx, dword [ebp - 0x14]
jmp 0x40d3c5
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 0x40d4c6
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5e2
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 9
jmp 0x40d450
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.00413490
test al, al
jne 0x40d530
push 0x5e5
push 0x80004005
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0xb
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.0040153c
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004142bb
jmp 0x40d850
cmp byte [ebp - 0x89], 0
jne 0x40d561
push 0x5e6
push 0x80004005
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0xc
jmp 0x40d515
and dword [ebp - 0x9c], 0
lea eax, [ebp - 0x9c]
push 0
push eax
push edi
push ecx
lea ecx, [ebp - 0x88]
call fcn.00410c02
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
setne al
test al, al
jne 0x40d5d4
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.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0xd
jmp 0x40d515
cmp dword [ebp - 0x9c], edi
sete al
test al, al
jne 0x40d626
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
push 0x5e9
cmovle ecx, eax
mov eax, 0x80004005
test ecx, ecx
cmovs eax, ecx
push eax
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0xe
jmp 0x40d515
push ecx
lea ecx, [ebp - 0x88]
call fcn.00410c02
and dword [ebp - 0x30], 0
lea ecx, [ebp - 0x40]
push edi
push eax
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x2c], 0xf
mov byte [ebp - 0x40], 0
call fcn.00412cff
push str.__key_begin
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 0xf
call fcn.00412993
push str.key_end__
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0x10
call fcn.00412993
mov byte [ebp - 4], 0x11
lea eax, [ebp - 0x70]
push dword [ebp - 0x60]
cmp dword [ebp - 0x5c], 0x10
push ecx
cmovae eax, dword [ebp - 0x70]
lea ecx, [ebp - 0x40]
push eax
call fcn.004102d8
mov dword [ebp - 0x90], eax
cmp eax, 0xffffffff
jne 0x40d6bd
push 0x5ff
push 0x80004005
push ecx
mov ecx, esp
push str.Could_not_find_key
call fcn.00414128
mov ecx, ebx
call fcn.004142d3
jmp 0x40d82c
push dword [ebp - 0x48]
cmp dword [ebp - 0x44], 0x10
lea eax, [ebp - 0x58]
push ecx
cmovae eax, dword [ebp - 0x58]
lea ecx, [ebp - 0x40]
push eax
call fcn.004102d8
mov edi, eax
cmp edi, 0xffffffff
setne cl
test cl, cl
jne 0x40d722
push 0x602
push 0x80004005
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0x12
lea eax, [ebp - 0x1c]
mov ecx, ebx
push eax
call fcn.0040153c
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.004142bb
jmp 0x40d82c
cmp edi, dword [ebp - 0x90]
setg al
test al, al
jne 0x40d757
push 0x604
push 0x80004005
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0x13
jmp 0x40d707
push str.__key_begin
call fcn.00421160
sub edi, dword [ebp - 0x90]
sub edi, eax
pop ecx
test edi, edi
jg 0x40d799
push 0x607
push 0x80004005
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0x14
jmp 0x40d707
cmp edi, 0x400
jl 0x40d7cc
push 0x608
push 0x80004005
push ecx
mov edi, esp
call fcn.00413c5e
push eax
mov ecx, edi
call fcn.00413a4e
lea ecx, [ebp - 0x1c]
call fcn.004142d3
mov byte [ebp - 4], 0x15
jmp 0x40d707
push str.__key_begin
call fcn.00421160
add eax, dword [ebp - 0x90]
add eax, dword [ebp - 0x98]
and dword [ebp - 0x18], 0
pop ecx
push edi
push eax
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
call fcn.00412cff
mov ecx, dword [ebp - 0x94]
lea eax, [ebp - 0x28]
push eax
call fcn.0040f147
push 0
push 1
lea ecx, [ebp - 0x28]
call fcn.00412dc0
and dword [ebx], 0
and dword [ebx + 4], 0
call fcn.00413c5e
push eax
lea ecx, [ebx + 8]
call fcn.00413a4e
push 0
push 1
lea ecx, [ebp - 0x58]
call fcn.00412dc0
push 0
push 1
lea ecx, [ebp - 0x70]
call fcn.00412dc0
push 0
push 1
lea ecx, [ebp - 0x40]
call fcn.00412dc0
cmp dword [ebp - 0x88], 0
je 0x40d865
push dword [ebp - 0x88]
call fcn.00420f91
pop ecx
cmp esi, 0xffffffff
je 0x40d875
test esi, esi
je 0x40d875
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x74]
lea ecx, [ecx - 0x10]
call fcn.004142bb
mov eax, ebx
call fcn.0041a55f
ret