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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov ebx, dword [0x40922c]
xor eax, eax
push ebp
push 0x40644c
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x409254]
mov dword [eax], 0xa000
mov eax, dword [0x409254]
mov eax, dword [eax]
xor edx, edx
call fcn.00407f2c
mov eax, dword [0x40645c]
mov dword [ebp - 4], eax
push 0
lea eax, [ebp - 8]
push eax
push 3
lea eax, [ebp - 4]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
lea eax, [ebp - 0x24]
lea edx, [ebp - 4]
mov ecx, 4
call fcn.00402f74
mov eax, dword [ebp - 0x24]
mov edx, 0x406468
call fcn.0040309c
je 0x405e59
push 0x10
push 0x40646c
push 0x406478
push 0
call sub.user32.dll_MessageBoxA_1
call fcn.00402d00
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0xe]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
mov al, byte [ebp - 0xe]
and al, 1
cmp al, 1
sete byte [0x40920c]
mov al, byte [ebp - 0xe]
and al, 2
cmp al, 2
sete byte [0x409208]
mov al, byte [ebp - 0xe]
and al, 4
cmp al, 4
sete byte [0x409210]
mov al, byte [ebp - 0xe]
and al, 0x18
sub al, 8
je 0x405ea6
sub al, 8
je 0x405eb2
jmp 0x405ebc
mov dword [0x409214], 0x1f5
jmp 0x405ebc
mov dword [0x409214], 0x1f6
test byte [ebp - 0xe], 0x20
sete byte [0x40921c]
lea edx, [ebp - 0x24]
xor eax, eax
call fcn.00402600
mov eax, dword [ebp - 0x24]
lea edx, [ebp - 0x20]
call fcn.0040801c
mov al, byte [ebp - 0xe]
and al, 0x40
cmp al, 0x40
jne 0x405f06
mov edx, dword [ebp - 0x20]
mov eax, 0x4064cc
call fcn.00403218
dec eax
je 0x405f0a
mov edx, 0x4064d8
mov eax, dword [ebp - 0x20]
call fcn.00405d24
test eax, eax
je 0x405f0a
xor eax, eax
jmp 0x405f0c
mov al, 1
mov byte [0x409218], al
test byte [ebp - 0xe], 0x80
sete byte [0x409220]
push 0
lea eax, [ebp - 8]
push eax
push 2
lea eax, [ebp - 0x1a]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 2
lea eax, [ebp - 0x1a]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
movzx eax, word [ebp - 0x1a]
mov edx, dword [0x409254]
add dword [edx], eax
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0xd]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
cmp byte [ebp - 0xd], 0
jbe 0x405f93
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [ebp - 0xd]
push eax
mov eax, dword [0x40a4f4]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [ebp - 0xd]
mov edx, dword [0x40a4f4]
mov byte [edx + eax], 0
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0xd]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
cmp byte [ebp - 0xd], 0
seta byte [0x4091fc]
cmp byte [0x4091fc], 0
je 0x4062f4
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [ebp - 0xd]
push eax
mov eax, dword [0x40a4ec]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [ebp - 0xd]
mov edx, dword [0x40a4ec]
mov byte [edx + eax], 0
mov eax, dword [0x40a4ec]
cmp byte [eax], 0x48
jne 0x4062c7
mov eax, dword [0x40a4ec]
cmp byte [eax + 1], 0x4b
jne 0x4062c7
xor eax, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0xc], eax
mov dl, 0x7c
mov eax, dword [0x40a4ec]
call fcn.004083a4
inc eax
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x406045
mov eax, dword [0x40a4ec]
call fcn.00407f14
mov esi, eax
mov eax, dword [ebp - 0x14]
call fcn.00407f14
sub esi, eax
mov eax, dword [0x40a4ec]
mov byte [eax + esi - 1], 0
mov dl, 0x5c
mov eax, dword [0x40a4ec]
call fcn.004083a4
mov edi, eax
test edi, edi
je 0x406075
mov eax, dword [0x40a4ec]
call fcn.00407f14
mov esi, eax
mov eax, edi
call fcn.00407f14
sub esi, eax
mov eax, dword [0x40a4ec]
mov byte [eax + esi], 0
mov dl, 0x5c
mov eax, dword [0x40a4ec]
call fcn.004083e0
mov esi, eax
test esi, esi
je 0x4060a5
mov eax, dword [0x40a4ec]
call fcn.00407f14
push eax
mov eax, esi
call fcn.00407f14
pop edx
sub edx, eax
mov eax, dword [0x40a4ec]
mov byte [eax + edx], 0
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x4064ec
call fcn.0040309c
jne 0x4060ce
mov dword [ebp - 0x18], 0x80000001
jmp 0x40618d
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x406508
call fcn.0040309c
jne 0x4060f7
mov dword [ebp - 0x18], 0x80000001
jmp 0x40618d
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x406518
call fcn.0040309c
jne 0x40611d
mov dword [ebp - 0x18], 0x80000002
jmp 0x40618d
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x406534
call fcn.0040309c
jne 0x406143
mov dword [ebp - 0x18], 0x80000002
jmp 0x40618d
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x406544
call fcn.0040309c
jne 0x406169
mov dword [ebp - 0x18], 0x80000003
jmp 0x40618d
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x406558
call fcn.0040309c
jne 0x40618d
mov dword [ebp - 0x18], 0x80000003
cmp dword [ebp - 0x18], 0
je 0x4062b1
lea eax, [ebp - 0x18]
push eax
push 0x20019
push 0
inc esi
push esi
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_RegOpenKeyExA_1
test eax, eax
jne 0x4062b1
lea eax, [ebp - 0xc]
push eax
push 0
push 0
push 0
lea eax, [edi + 1]
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_RegQueryValueExA_1
test eax, eax
jne 0x4062b1
mov eax, dword [ebp - 0xc]
call fcn.00402454
mov esi, eax
lea eax, [ebp - 0xc]
push eax
push esi
push 0
push 0
inc edi
push edi
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_RegQueryValueExA_1
mov dl, 0x3b
mov eax, esi
call fcn.004083e0
test eax, eax
je 0x40621c
mov dl, 0x3b
mov eax, esi
call fcn.004083e0
call fcn.00407f14
push eax
mov eax, esi
call fcn.00407f14
pop edx
sub eax, edx
mov byte [esi + eax], 0
mov eax, esi
call fcn.00407f14
cmp eax, 0x104
jle 0x406231
mov byte [esi + 0x105], 0
mov eax, esi
call fcn.00407f14
mov ecx, eax
inc ecx
mov edx, dword [0x40a4ec]
mov eax, esi
call fcn.00402554
mov eax, esi
call fcn.0040246c
cmp dword [ebp - 0x14], 0
je 0x4062a8
mov eax, dword [ebp - 0x14]
call fcn.00407f14
mov esi, eax
mov eax, dword [0x40a4ec]
call fcn.00407f14
add esi, eax
add esi, 2
cmp esi, 0x104
jge 0x4062a8
mov eax, dword [0x40a4ec]
call fcn.0040834c
mov eax, dword [0x40a4ec]
call fcn.00407f14
mov edx, dword [0x40a4ec]
lea eax, [edx + eax]
push eax
mov eax, dword [ebp - 0x14]
call fcn.00407f14
mov ecx, eax
inc ecx
mov eax, dword [ebp - 0x14]
pop edx
call fcn.00402554
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_RegCloseKey_1
cmp dword [ebp - 0xc], 5
jge 0x4062c7
mov eax, dword [0x40a4ec]
push eax
push 0x104
call sub.kernel32.dll_GetTempPathA
lea eax, [ebp - 0x24]
mov edx, dword [0x40a4ec]
call fcn.00402f44
mov eax, dword [ebp - 0x24]
mov edx, 0x406564
call fcn.0040309c
jne 0x4062f4
mov eax, dword [0x40a4ec]
push eax
push 0x104
call sub.kernel32.dll_GetTempPathA
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0xd]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
cmp byte [ebp - 0xd], 0
seta byte [0x409200]
cmp byte [0x409200], 0
je 0x406336
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [ebp - 0xd]
push eax
mov eax, dword [0x40a4f0]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [ebp - 0xd]
mov edx, dword [0x40a4f0]
mov byte [edx + eax], 0
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0xd]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
cmp byte [ebp - 0xd], 0
seta byte [0x409204]
cmp byte [0x409204], 0
je 0x406387
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [ebp - 0xd]
push eax
mov eax, dword [0x40a4f8]
push eax
mov eax, dword [ebx]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [ebp - 0xd]
mov edx, dword [0x40a4f8]
mov byte [edx + eax], 0
cmp byte [0x40921c], 0
je 0x4063a4
call fcn.00405b74
cmp byte [0x409204], 0
je 0x406431
mov word [ebp - 0x1a], 0
mov eax, dword [0x40a4f8]
mov al, byte [eax]
dec al
je 0x4063c8
dec al
je 0x4063d0
jmp 0x4063d6
mov word [ebp - 0x1a], 0x41
jmp 0x4063d6
mov word [ebp - 0x1a], 0x24
mov eax, dword [0x40a4f8]
cmp byte [eax], 7
jae 0x4063fd
mov eax, dword [0x40a4f8]
call fcn.00407f14
mov ecx, eax
mov edx, dword [0x40a4f8]
mov eax, dword [0x40a4f8]
inc eax
call fcn.00402554
movzx eax, word [ebp - 0x1a]
push eax
mov eax, dword [0x40a4f4]
push eax
mov eax, dword [0x40a4f8]
push eax
push 0
call sub.user32.dll_MessageBoxA_1
mov dword [ebp - 8], eax
cmp word [ebp - 0x1a], 0
je 0x406431
mov eax, dword [ebp - 8]
sub eax, 2
je 0x40642c
sub eax, 5
jne 0x406431
call fcn.00402d00
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406453
lea eax, [ebp - 0x24]
mov edx, 2
call fcn.00402e54
ret