Function at 0x4c6790
Capabilities:
Check os version
Get common file path
Get system information on windows
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4ec
mov eax, dword [0x594ccc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
push 0x118
lea edx, [ebp - 0x388]
push 0
push edx
mov dword [ebp - 0x4b4], eax
mov dword [ebp - 0x4c4], ecx
mov dword [ebp - 0x4ac], 0
call fcn.0051d250
push 0x118
lea eax, [ebp - 0x4a4]
push 0
mov esi, 0x11c
push eax
mov dword [ebp - 0x38c], esi
call fcn.0051d250
add esp, 0x18
push str.RtlGetVersion
mov dword [ebp - 0x4a8], esi
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.ntdll.dll
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call ebx
test eax, eax
je 0x4c68ae
lea ecx, [ebp - 0x4a8]
push ecx
call eax
mov edx, dword [ebp - 0x4a4]
mov cl, byte [ebp - 0x38e]
mov eax, dword [ebp - 0x4a0]
mov dword [ebp - 0x388], edx
movzx edx, word [ebp - 0x394]
mov byte [ebp - 0x272], cl
lea ecx, [ebp - 0x494]
push ecx
mov word [ebp - 0x278], dx
mov dword [ebp - 0x384], eax
mov ax, word [ebp - 0x392]
lea edx, [ebp - 0x378]
push 0x80
push edx
mov word [ebp - 0x276], ax
call fcn.00522718
movzx edx, word [ebp - 0x390]
mov eax, dword [ebp - 0x498]
mov ecx, dword [ebp - 0x49c]
add esp, 0xc
mov dword [ebp - 0x37c], eax
mov dword [ebp - 0x380], ecx
mov word [ebp - 0x274], dx
jmp 0x4c68bb
lea eax, [ebp - 0x38c]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
xor eax, eax
push str.GetNativeSystemInfo
push 0x55ff94
mov dword [ebp - 0x4ec], eax
mov dword [ebp - 0x4e8], eax
mov dword [ebp - 0x4e4], eax
mov dword [ebp - 0x4e0], eax
mov dword [ebp - 0x4dc], eax
mov dword [ebp - 0x4d8], eax
mov dword [ebp - 0x4d4], eax
mov dword [ebp - 0x4d0], eax
mov dword [ebp - 0x4cc], eax
call esi
push eax
call ebx
test eax, eax
je 0x4c6911
lea ecx, [ebp - 0x4ec]
push ecx
call eax
jmp 0x4c691e
lea edx, [ebp - 0x4ec]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
movzx eax, word [ebp - 0x278]
mov edx, dword [ebp - 0x384]
mov dword [edi], eax
mov eax, dword [ebp - 0x388]
lea ecx, [eax + eax*4]
xor eax, eax
push 0x206
lea esi, [edx + ecx*2]
push eax
lea ecx, [ebp - 0x26e]
push ecx
mov word [ebp - 0x270], ax
call fcn.0051d250
add esp, 0xc
lea edx, [ebp - 0x270]
push edx
push 0
push 0
push 0x25
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jl 0x4c6a97
push str._ntoskrnl.exe
lea eax, [ebp - 0x270]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
test eax, eax
je 0x4c6a97
lea ecx, [ebp - 0x4bc]
push ecx
lea edx, [ebp - 0x270]
push edx
call fcn.004c0620
add esp, 8
test eax, eax
je 0x4c6a97
mov ecx, dword [ebp - 0x4b8]
mov eax, ecx
shr eax, 0x10
movzx ecx, cx
lea edx, [eax + eax*4]
lea edx, [ecx + edx*2]
cmp esi, edx
jge 0x4c6a97
mov dword [ebp - 0x388], eax
mov dword [edi], 0
mov eax, dword [0x599458]
mov edx, dword [eax + 0xc]
mov dword [ebp - 0x384], ecx
mov ecx, 0x599458
call edx
mov esi, eax
add esi, 0x10
push str.Service_Pack
lea ecx, [ebp - 0x4b0]
mov dword [ebp - 0x4b8], esi
call fcn.00464b60
xor eax, eax
push 0x62
push eax
lea ecx, [ebp - 0x66]
push ecx
mov word [ebp - 0x68], ax
call fcn.0051d250
add esp, 0xc
lea edx, [ebp - 0x4c8]
push edx
lea eax, [ebp - 0x68]
push eax
lea ecx, [ebp - 0x4c0]
push ecx
push str.CSDVersion
push str.SOFTWAREMicrosoftWindows_NTCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x4c0], 1
mov dword [ebp - 0x4c8], 0x64
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
test eax, eax
jne 0x4c6a81
mov ebx, dword [ebp - 0x4b0]
mov eax, dword [ebx - 0xc]
push eax
push ebx
push esi
call fcn.0051f1ce
add esp, 0xc
test eax, eax
jne 0x4c6a81
mov ebx, dword [ebx - 0xc]
lea edx, [esi + ebx*2]
push edx
call fcn.00526deb
add esp, 4
mov dword [edi], eax
lea ecx, [ebp - 0x4b0]
call fcn.00442750
lea ecx, [ebp - 0x4b8]
call fcn.00442750
mov ecx, dword [ebp - 0x388]
mov eax, dword [ebp - 0x4b4]
mov edx, dword [ebp - 0x4c4]
pop edi
mov dword [eax], ecx
mov eax, dword [ebp - 0x384]
pop esi
mov dword [edx], eax
pop ebx
cmp ecx, 5
jne 0x4c6b18
test eax, eax
jne 0x4c6ace
mov dword [ebp - 0x4ac], 1
jmp 0x4c6bd1
cmp eax, 1
jne 0x4c6ae2
mov dword [ebp - 0x4ac], 2
jmp 0x4c6bd1
cmp eax, 2
jne 0x4c6bd1
cmp byte [ebp - 0x272], 1
jne 0x4c6b09
cmp word [ebp - 0x4ec], 9
jne 0x4c6b09
mov dword [ebp - 0x4ac], eax
jmp 0x4c6bd1
mov dword [ebp - 0x4ac], 4
jmp 0x4c6bd1
cmp ecx, 6
jne 0x4c6bb5
test eax, eax
jne 0x4c6b51
mov al, byte [ebp - 0x272]
cmp al, 3
je 0x4c6b42
cmp al, 2
je 0x4c6b42
mov dword [ebp - 0x4ac], 3
jmp 0x4c6bd1
mov dword [ebp - 0x4ac], 6
jmp 0x4c6bd1
cmp eax, 1
jne 0x4c6b7c
mov al, byte [ebp - 0x272]
cmp al, 3
je 0x4c6b70
cmp al, 2
je 0x4c6b70
mov dword [ebp - 0x4ac], 5
jmp 0x4c6bd1
mov dword [ebp - 0x4ac], 7
jmp 0x4c6bd1
cmp eax, 2
jne 0x4c6b96
cmp byte [ebp - 0x272], 1
jne 0x4c6bd1
mov dword [ebp - 0x4ac], 8
jmp 0x4c6bd1
cmp eax, 3
jne 0x4c6bb0
cmp byte [ebp - 0x272], 1
jne 0x4c6bd1
mov dword [ebp - 0x4ac], 9
jmp 0x4c6bd1
cmp eax, 4
jmp 0x4c6bbc
cmp ecx, 0xa
jne 0x4c6bd1
test eax, eax
jne 0x4c6bd1
cmp byte [ebp - 0x272], 1
jne 0x4c6bd1
mov dword [ebp - 0x4ac], 0xa
test byte [ebp - 0x274], 0x40
je 0x4c6bea
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051d23b
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x4ac]
xor ecx, ebp
call fcn.0051d23b
mov esp, ebp
pop ebp
ret