Function at 0x404049
Capabilities:
Check os version
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x938
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x92c], eax
mov eax, dword [ebp + 0x10]
push esi
push edi
mov dword [ebp - 0x930], eax
xor ebx, ebx
mov edi, edx
mov dword [ebp - 0x934], ecx
xor esi, esi
mov eax, 0x41c000
cmp edi, dword [eax]
je 0x404096
add eax, 0x14
inc esi
cmp eax, 0x41c0c8
jl 0x404082
jmp 0x404269
cmp esi, 0xffffffff
je 0x404269
mov dword [ebp - 0x920], ebx
mov dword [ebp - 0x91c], ebx
cmp ecx, 0xffffffff
je 0x4040d7
push str.Userenv.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x91c], eax
cmp eax, ebx
je 0x4040d7
push str.ExpandEnvironmentStringsForUserW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x920], eax
imul esi, esi, 0x14
mov eax, dword [esi + 0x41c010]
cmp eax, ebx
je 0x40411d
push dword [ebp + 0xc]
push dword [ebp - 0x92c]
push eax
cmp dword [ebp - 0x920], ebx
je 0x404104
push dword [ebp - 0x934]
call dword [ebp - 0x920]
jmp 0x40410a
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [ebp - 0x91c]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor eax, eax
jmp 0x40426e
cmp edi, 0x23
jne 0x40416d
push 0x110
lea eax, [ebp - 0x914]
push ebx
push eax
call sub.MSVCR100.dll_memset
add esp, 0xc
lea eax, [ebp - 0x918]
push eax
mov dword [ebp - 0x918], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [ebp - 0x914], 6
jae 0x40416d
mov eax, dword [str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerUser_Shell_Folders]
mov dword [esi + str.SoftwareMicrosoftWindowsCurrentVersionExplorerUser_Shell_Folders], eax
mov eax, dword [str.Common_AppData]
mov dword [esi + str.AppData], eax
mov dword [ebp - 0x928], ebx
cmp dword [ebp + 0x14], ebx
jle 0x404255
mov eax, dword [ebp - 0x930]
mov dword [ebp - 0x924], ebx
cmp eax, ebx
jne 0x404192
mov eax, dword [esi + 0x41c004]
lea ecx, [ebp - 0x924]
push ecx
push 1
push ebx
push dword [esi + 0x41c008]
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov edi, eax
cmp edi, ebx
jne 0x40421d
xor eax, eax
push 0x7fe
mov word [ebp - 0x804], ax
lea eax, [ebp - 0x802]
push ebx
push eax
call sub.MSVCR100.dll_memset
add esp, 0xc
lea eax, [ebp - 0x938]
push eax
lea eax, [ebp - 0x804]
push eax
push ebx
push ebx
push dword [esi + 0x41c00c]
mov dword [ebp - 0x938], 0x800
push dword [ebp - 0x924]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edi, eax
cmp edi, ebx
jne 0x404211
lea eax, [ebp - 0x804]
push eax
call dword [sym.imp.MSVCR100.dll_wcslen]
pop ecx
test eax, eax
jne 0x40427d
push dword [ebp - 0x924]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x930], ebx
je 0x404240
cmp dword [ebp - 0x928], 5
jle 0x404240
cmp edi, ebx
je 0x404240
mov dword [ebp - 0x930], ebx
inc dword [ebp - 0x928]
mov eax, dword [ebp - 0x928]
cmp eax, dword [ebp + 0x14]
jl 0x40417c
cmp dword [ebp - 0x91c], ebx
je 0x404269
push dword [ebp - 0x91c]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, 0x80004005
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401d92
leave
ret
push dword [ebp + 0xc]
lea eax, [ebp - 0x804]
push dword [ebp - 0x92c]
push eax
cmp dword [ebp - 0x920], ebx
je 0x4042a3
push dword [ebp - 0x934]
call dword [ebp - 0x920]
jmp 0x4042a9
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [ebp - 0x924]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x91c], ebx
je 0x404116
jmp 0x40410a