Function at 0x405710
Capabilities:
Get common file path
Query or enumerate registry value
Read file on windows

Disassembly:
mov eax, 0x2cf4
call fcn.00404720
xor ecx, ecx
mov al, byte [0x40c428]
mov dword [esp + 0xd], ecx
push ebx
mov dword [esp + 0x15], ecx
push esi
mov dword [esp + 0x1d], ecx
push edi
mov dword [esp + 0x25], ecx
mov byte [esp + 0x18], al
mov word [esp + 0x29], cx
mov byte [esp + 0x13c], al
mov byte [esp + 0x2b], cl
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x13d]
rep stosd dword es:[edi], eax
mov ebx, dword [esp + 0x2d04]
mov dword [esp + 0x14], 0x14
stosw word es:[edi], ax
test ebx, ebx
stosb byte es:[edi], al
mov dword [esp + 0x30], 3
jge 0x40577f
cmp ebx, 2
jg 0x405c58
push ebx
call fcn.00405370
add esp, 4
test al, al
je 0x405835
cmp ebx, 2
jne 0x40591c
mov dl, byte [0x40c428]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x39]
mov byte [esp + 0x38], dl
mov dword [esp + 0x10], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x10]
mov dword [esp + 0x2c], 1
push eax
push str.Software_farstone_virtualdrive0100
push 0x80000002
mov dword [esp + 0x40], 0x104
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x405835
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x34]
lea edx, [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x30]
push edx
push eax
push 0
push str.ServerPath
push ecx
call esi
lea edx, [esp + 0x34]
lea eax, [esp + 0x38]
push edx
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x30]
push eax
push ecx
push 0
push str.ServerPath
push edx
call esi
mov esi, eax
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x405854
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405845
call fcn.00405580
pop edi
pop esi
mov eax, 3
pop ebx
add esp, 0x2cf4
ret
mov edi, str.setup.sys
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x38]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x240]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x3c]
push ecx
call fcn.004069a0
add esp, 8
test eax, eax
je 0x4058ba
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x4058ab
call fcn.00405580
pop edi
pop esi
mov eax, 7
pop ebx
add esp, 0x2cf4
ret
mov eax, dword [esp + 0x458]
test eax, eax
jne 0x4058cf
pop edi
pop esi
pop ebx
add esp, 0x2cf4
ret
cmp eax, 1
jne 0x405c58
mov eax, dword [esp + 0x2d08]
test eax, eax
je 0x40590d
push str.Chkmes.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x40590d
push str.EvaluationMessage
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x405906
call eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x2cf4
ret
push ebp
lea edx, [esp + 0x140]
push 0x104
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, str._rtclcmg32.dll
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x140]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x40c1d8
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x144]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call sub.MSVCRT.dll_fopen
add esp, 8
mov esi, eax
test esi, esi
pop ebp
je 0x405ac5
sub ebx, 0
je 0x40599e
dec ebx
je 0x405995
dec ebx
jne 0x4059ab
push 0
push 0xdc
jmp 0x4059a2
push 0
push 0xaf
jmp 0x4059a2
push 0
push 0x65
push esi
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov ecx, dword [esp + 0x14]
push esi
push ecx
lea edx, [esp + 0x20]
push 1
push edx
call sub.MSVCRT.dll_fread
mov ecx, dword [esp + 0x24]
add esp, 0x10
cmp eax, ecx
push esi
je 0x4059f2
call sub.MSVCRT.dll_fclose
mov eax, dword [esp + 0x2d10]
add esp, 4
test eax, eax
je 0x405c58
call fcn.00405580
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
call sub.MSVCRT.dll_fclose
movzx ax, byte [esp + 0x2c]
movzx cx, byte [esp + 0x2d]
shl eax, 8
add eax, ecx
push eax
call fcn.00406930
push 0
push 0x7b8
call fcn.00406840
lea edx, [esp + 0x28]
push 0xf
push edx
call fcn.00406940
call fcn.00406920
lea eax, [esp + 0x30]
push eax
call fcn.004055c0
add esp, 0x1c
test al, al
jne 0x405a5d
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405c58
call fcn.00405580
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
mov al, byte [esp + 0x19]
cmp al, 2
jae 0x405bd7
cmp al, 1
jne 0x405c35
mov eax, dword [esp + 0x2d08]
test eax, eax
je 0x405c35
push str.Chkmes.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x405c35
push str.EvaluationMessage
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x405c2e
call eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x19]
pop edi
pop esi
and eax, 0xff
pop ebx
add esp, 0x2cf4
ret
sub ebx, 0
je 0x405ae8
dec ebx
je 0x405adc
dec ebx
jne 0x405b22
lea ecx, [esp + 0xc]
push ecx
push str.software_farstone_virtualdrive0100client
jmp 0x405af2
lea edx, [esp + 0xc]
push edx
push str.software_farstone_virtualdrive0100_admin
jmp 0x405af2
lea eax, [esp + 0xc]
push eax
push str.Software_farstone_virtualdrive0100_retail
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
je 0x405b22
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405c58
call fcn.00405580
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x14]
lea edx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x34]
push edx
push eax
push 0
push str.ricksetup
push ecx
call esi
lea edx, [esp + 0x14]
lea eax, [esp + 0x18]
push edx
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x34]
push eax
push ecx
push 0
push str.ricksetup
push edx
call esi
test eax, eax
je 0x405b87
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405c58
call fcn.00405580
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
movzx cx, byte [esp + 0x28]
movzx dx, byte [esp + 0x29]
shl ecx, 8
add ecx, edx
push ecx
call fcn.00406930
push 0
push 0x7b8
call fcn.00406840
lea eax, [esp + 0x24]
push 0xf
push eax
call fcn.00406940
call fcn.00406920
lea ecx, [esp + 0x2c]
push ecx
call fcn.004055c0
add esp, 0x18
test al, al
jne 0x405bf4
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405c58
call fcn.00405580
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
mov al, byte [esp + 0x19]
cmp al, 2
jae 0x405c48
cmp al, 1
jne 0x405c35
mov eax, dword [esp + 0x2d08]
test eax, eax
je 0x405c35
push str.Chkmes.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x405c35
push str.EvaluationMessage
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x405c2e
call eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x19]
pop edi
pop esi
and eax, 0xff
pop ebx
add esp, 0x2cf4
ret
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405c58
call fcn.00405580
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret