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

Disassembly:
mov eax, 0x2cf4
call fcn.004044f0
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 0x40554f
cmp ebx, 2
jg 0x405a28
push ebx
call fcn.00405140
add esp, 4
test al, al
je 0x405605
cmp ebx, 2
jne 0x4056ec
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 0x405605
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 0x405624
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405615
call fcn.00405350
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.00406770
add esp, 8
test eax, eax
je 0x40568a
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x40567b
call fcn.00405350
pop edi
pop esi
mov eax, 7
pop ebx
add esp, 0x2cf4
ret
mov eax, dword [esp + 0x458]
test eax, eax
jne 0x40569f
pop edi
pop esi
pop ebx
add esp, 0x2cf4
ret
cmp eax, 1
jne 0x405a28
mov eax, dword [esp + 0x2d08]
test eax, eax
je 0x4056dd
push str.Chkmes.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x4056dd
push str.EvaluationMessage
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x4056d6
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 0x405895
sub ebx, 0
je 0x40576e
dec ebx
je 0x405765
dec ebx
jne 0x40577b
push 0
push 0xdc
jmp 0x405772
push 0
push 0xaf
jmp 0x405772
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 0x4057c2
call sub.MSVCRT.dll_fclose
mov eax, dword [esp + 0x2d10]
add esp, 4
test eax, eax
je 0x405a28
call fcn.00405350
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.00406700
push 0
push 0x7b8
call fcn.00406610
lea edx, [esp + 0x28]
push 0xf
push edx
call fcn.00406710
call fcn.004066f0
lea eax, [esp + 0x30]
push eax
call fcn.00405390
add esp, 0x1c
test al, al
jne 0x40582d
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405a28
call fcn.00405350
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
mov al, byte [esp + 0x19]
cmp al, 2
jae 0x4059a7
cmp al, 1
jne 0x405a05
mov eax, dword [esp + 0x2d08]
test eax, eax
je 0x405a05
push str.Chkmes.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x405a05
push str.EvaluationMessage
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x4059fe
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 0x4058b8
dec ebx
je 0x4058ac
dec ebx
jne 0x4058f2
lea ecx, [esp + 0xc]
push ecx
push str.software_farstone_virtualdrive0100client
jmp 0x4058c2
lea edx, [esp + 0xc]
push edx
push str.software_farstone_virtualdrive0100_admin
jmp 0x4058c2
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 0x4058f2
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405a28
call fcn.00405350
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 0x405957
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405a28
call fcn.00405350
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.00406700
push 0
push 0x7b8
call fcn.00406610
lea eax, [esp + 0x24]
push 0xf
push eax
call fcn.00406710
call fcn.004066f0
lea ecx, [esp + 0x2c]
push ecx
call fcn.00405390
add esp, 0x18
test al, al
jne 0x4059c4
mov eax, dword [esp + 0x2d0c]
test eax, eax
je 0x405a28
call fcn.00405350
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret
mov al, byte [esp + 0x19]
cmp al, 2
jae 0x405a18
cmp al, 1
jne 0x405a05
mov eax, dword [esp + 0x2d08]
test eax, eax
je 0x405a05
push str.Chkmes.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x405a05
push str.EvaluationMessage
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x4059fe
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 0x405a28
call fcn.00405350
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x2cf4
ret