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

Disassembly:
push 0xffffffffffffffff
push 0x4218d6
mov eax, dword fs:[0]
push eax
sub esp, 0x548
mov eax, dword [0x42c070]
xor eax, esp
mov dword [esp + 0x544], eax
push ebx
push ebp
push esi
mov eax, dword [0x42c070]
xor eax, esp
push eax
lea eax, [esp + 0x558]
mov dword fs:[0], eax
xor ebx, ebx
mov esi, ecx
cmp edi, ebx
jne 0x4050b6
push str.WritRegKeyToConfig_param_err
call fcn.00412950
add esp, 4
xor eax, eax
jmp 0x405377
lea ecx, [esp + 0x14]
call fcn.00410080
mov dword [esp + 0x560], ebx
cmp dword [esp + 0x28], ebx
jne 0x4050f4
push str.GetModuleDirectory_error
call fcn.004129d0
add esp, 4
cmp dword [esp + 0x2c], 0x10
jb 0x4050ed
mov eax, dword [esp + 0x18]
push eax
call fcn.0041300c
add esp, 4
xor eax, eax
jmp 0x405377
push 5
push str.log_
lea eax, [esp + 0x1c]
call fcn.00407630
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x405110
sub eax, edx
push eax
push esi
lea eax, [esp + 0x1c]
call fcn.00407630
push 0x3ff
lea ecx, [esp + 0x159]
push ebx
push ecx
mov dword [esp + 0x1c], ebx
mov byte [esp + 0x160], bl
call fcn.00418e90
add esp, 0xc
push 0x104
lea edx, [esp + 0x51]
push ebx
push edx
mov byte [esp + 0x58], bl
call fcn.00418e90
mov eax, dword [esp + 0x24]
mov ebp, 0x10
add esp, 0xc
cmp dword [esp + 0x2c], ebp
jae 0x40516f
lea eax, [esp + 0x18]
push eax
lea esi, [esp + 0x50]
call fcn.00411970
add esp, 4
test eax, eax
jne 0x405196
push str.WritRegKeyToConfig_CanonicalizePath_failed
call fcn.004129d0
add esp, 4
cmp dword [esp + 0x2c], ebp
jmp 0x4050de
lea ecx, [esp + 0x4c]
push ecx
mov byte [esp + 0x154], bl
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
cmp eax, 1
jne 0x4052c7
push 0x424e50
lea edx, [esp + 0x50]
push edx
lea eax, [esp + 0x18]
push eax
call fcn.00413f16
add esp, 0xc
test eax, eax
je 0x4051ee
lea ecx, [esp + 0x4c]
push ecx
push str.open_file__s_error
call fcn.004129d0
add esp, 8
lea ecx, [esp + 0x14]
call fcn.00406fe0
xor eax, eax
jmp 0x405377
mov edx, dword [esp + 0x10]
push edx
push 0x3ff
lea eax, [esp + 0x15c]
push 1
push eax
call fcn.004144c2
add esp, 0x10
test eax, eax
jne 0x40521b
push str.fread_data_error
call fcn.004129d0
add esp, 4
mov ecx, dword [esp + 0x10]
push ecx
call fcn.004145d3
add esp, 4
lea edx, [esp + 0x154]
push edi
push edx
mov dword [esp + 0x18], ebx
mov byte [esp + 0x55b], bl
call fcn.004139d0
add esp, 8
test eax, eax
je 0x405252
push str.this_PID_is_exist...
jmp 0x405361
push 0x425b6c
lea ecx, [esp + 0x34]
call fcn.00406f70
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x48], ebp
jae 0x40526e
lea eax, [esp + 0x34]
push 0xffffffffffffffff
push eax
lea eax, [esp + 0x15c]
push 0x400
push eax
call fcn.004137f7
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0x16c]
push 0x400
push ecx
call fcn.004137f7
push 0x425b70
lea edx, [esp + 0x70]
push edx
lea eax, [esp + 0x38]
push eax
call fcn.00413f16
add esp, 0x2c
test eax, eax
jne 0x405331
mov ecx, dword [esp + 0x10]
push ecx
lea edx, [esp + 0x158]
push edx
call fcn.004138bb
jmp 0x40532e
push 0x425b70
lea eax, [esp + 0x50]
push eax
lea ecx, [esp + 0x18]
push ecx
call fcn.00413f16
add esp, 0xc
cmp eax, ebx
je 0x4052ec
lea edx, [esp + 0x4c]
push edx
jmp 0x4051d1
push str._REG_DIR__nvalue
lea ecx, [esp + 0x34]
call fcn.00406f70
lea eax, [esp + 0x30]
push eax
mov edx, edi
mov byte [esp + 0x564], 1
call fcn.00407030
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x48], ebp
jae 0x40531c
lea eax, [esp + 0x34]
mov ecx, dword [esp + 0x10]
push ecx
push eax
call fcn.004138bb
mov byte [esp + 0x568], bl
add esp, 8
lea ecx, [esp + 0x30]
call fcn.00406fe0
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x40535c
push eax
call fcn.00413c97
mov edx, dword [esp + 0x14]
add esp, 4
push edx
call fcn.004145d3
add esp, 4
mov dword [esp + 0x10], ebx
push str.WritRegKeyToConfig_leave
call fcn.00412950
add esp, 4
lea ecx, [esp + 0x14]
call fcn.00406fe0
mov eax, 1
mov ecx, dword [esp + 0x558]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x544]
xor ecx, esp
call fcn.00413017
add esp, 0x554
ret