Function at 0x408690
Capabilities:
Check os version
Link many functions at runtime
Query or enumerate registry value

Disassembly:
sub esp, 0x6f4
mov eax, dword [0x435e80]
xor eax, esp
mov dword [esp + 0x6f0], eax
mov eax, dword [esp + 0x6fc]
mov ecx, dword [esp + 0x700]
mov edx, dword [esp + 0x704]
push ebp
mov ebp, dword [esp + 0x6fc]
test ebp, ebp
mov dword [esp + 8], ebp
mov dword [esp + 4], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0x20], 0
je 0x408d88
test eax, eax
je 0x408d88
test ecx, ecx
mov dword [eax], 0
je 0x408701
mov dword [ecx], 0
test edx, edx
je 0x408708
mov byte [edx], 0
push 0x9c
lea eax, [esp + 0x54]
push 0
push eax
call fcn.00412590
add esp, 0xc
lea ecx, [esp + 0x50]
push ecx
mov dword [esp + 0x54], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
jne 0x40874f
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop ebp
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00412a21
add esp, 0x6f4
ret
cmp dword [esp + 0x60], 2
je 0x40876f
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00412a21
add esp, 0x6f4
ret
push edi
push str.Netapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
mov dword [esp + 0x1c], edi
jne 0x4087a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop ebp
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00412a21
add esp, 0x6f4
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.NetApiBufferFree
push edi
call esi
test eax, eax
mov dword [esp + 0x1c], eax
je 0x4087c9
push str.NetWkstaGetInfo
push edi
call esi
test eax, eax
mov dword [esp + 0x2c], eax
jne 0x4087f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, esi
pop esi
pop edi
pop ebp
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00412a21
add esp, 0x6f4
ret
cmp dword [esp + 0x5c], 5
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
jb 0x4088a1
push str.NetGetJoinInformation
push edi
mov dword [esp + 0x20], 0
call esi
test eax, eax
je 0x408883
lea edx, [esp + 0x28]
push edx
lea ecx, [esp + 0x1c]
push ecx
push 0
call eax
test eax, eax
jne 0x408883
mov eax, dword [esp + 0x28]
cmp eax, 1
jne 0x40883b
mov edx, dword [esp + 0x10]
mov dword [edx], eax
jmp 0x40887b
cmp eax, 2
jne 0x408854
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4088a1
mov ecx, dword [esp + 0x10]
mov dword [ecx], 2
jmp 0x40886b
cmp eax, 3
jne 0x408883
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4088a1
mov edx, dword [esp + 0x10]
mov dword [edx], 3
push 0
push 0
push 0x10
push ebp
push 0xffffffffffffffff
push eax
push 0
push 0
call ebx
mov dword [esp + 0x1c], 0
mov eax, dword [esp + 0x18]
test eax, eax
je 0x408890
push eax
call dword [esp + 0x24]
cmp dword [esp + 0x1c], 0
je 0x408a84
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
xor eax, eax
push str.Advapi32.dll
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x2c], ebp
jne 0x4088ea
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00412a21
add esp, 0x6f4
ret
push str.LsaOpenPolicy
push ebp
call esi
mov esi, eax
test esi, esi
je 0x408934
push str.LsaQueryInformationPolicy
push ebp
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x408934
push str.LsaFreeMemory
push ebp
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov dword [esp + 0x40], eax
je 0x408934
mov eax, dword [esp + 0x2c]
push str.LsaClose
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, eax
test ebp, ebp
jne 0x40894e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [esp + 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ebx
mov esi, eax
call edi
push ebx
call edi
jmp 0x4088cf
lea ecx, [esp + 0x18]
push ecx
push 0x64
push 0
call dword [esp + 0x3c]
test eax, eax
jne 0x408a75
cmp dword [esp + 0x18], eax
je 0x408a75
lea edx, [esp + 0x28]
push edx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
push 0x80000001
lea eax, [esp + 0x4c]
push eax
push 0
call esi
test eax, eax
jne 0x408a68
mov edx, dword [esp + 0x28]
lea ecx, [esp + 0x34]
push ecx
push 3
push edx
call edi
test eax, eax
jne 0x408a61
mov eax, dword [esp + 0x34]
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.00407380
mov esi, dword [esp + 0x38]
add esp, 8
test esi, esi
je 0x408a58
mov edi, dword [esp + 0x14]
push 0
push 0
push 0x10
push edi
push 0xffffffffffffffff
push esi
push 0
push 0
call ebx
mov edx, dword [esp + 0x34]
cmp dword [edx + 8], 0
je 0x4089fe
mov eax, dword [esp + 0x10]
mov dword [eax], 3
jmp 0x408a47
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 4]
push 0
push 0
push 0x10
lea ecx, [esp + 0x104]
push ecx
push 0xffffffffffffffff
push eax
push 0
push 0
call ebx
lea ecx, [esp + 0xf8]
push ecx
push edi
call fcn.00413d2f
add esp, 8
test eax, eax
jne 0x408a3d
mov edx, dword [esp + 0x10]
mov dword [edx], 1
jmp 0x408a47
mov eax, dword [esp + 0x10]
mov dword [eax], 2
push esi
mov dword [esp + 0x20], 0
call fcn.00412262
add esp, 4
mov ecx, dword [esp + 0x34]
push ecx
call dword [esp + 0x44]
mov edx, dword [esp + 0x28]
push edx
call ebp
mov eax, dword [esp + 0x18]
test eax, eax
je 0x408a75
push eax
call dword [esp + 0x24]
cmp dword [esp + 0x1c], 0
jne 0x408b78
mov ebp, dword [esp + 0x14]
cmp dword [esp + 0x38], 0
je 0x408b78
mov eax, dword [esp + 0x10]
cmp dword [eax], 3
jne 0x408b78
mov ecx, dword [esp + 0x24]
push str.DsGetDcNameA
push ecx
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x408b32
lea edx, [esp + 0x14]
push edx
push 0x10000
push 0
push 0
push ebp
push 0
call eax
test eax, eax
jne 0x408b25
mov esi, dword [esp + 0x14]
test esi, esi
je 0x408b32
push 0x208
push eax
lea eax, [esp + 0x100]
push eax
call fcn.00412590
add esp, 0xc
push 0x104
lea ecx, [esp + 0xfc]
push ecx
add esi, 0xc
push esi
call dword [sym.imp.ole32.dll_StringFromGUID2]
mov edx, dword [esp + 0x718]
mov eax, dword [esp + 0x38]
push 0
push 0
push edx
push eax
push 0xffffffffffffffff
lea ecx, [esp + 0x10c]
push ecx
push 0
push 0
call ebx
mov eax, dword [esp + 0x14]
test eax, eax
je 0x408b32
push eax
call dword [esp + 0x24]
push 0x9c
lea edx, [esp + 0x60]
push 0
push edx
call fcn.00412590
add esp, 0xc
lea eax, [esp + 0x5c]
push eax
mov dword [esp + 0x60], 0x9c
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x408b78
cmp dword [esp + 0x60], 5
jb 0x408b78
cmp byte [esp + 0xf6], 2
jne 0x408b78
mov ecx, dword [esp + 0x10]
mov dword [ecx], 4
mov edi, dword [esp + 0x3c]
test edi, edi
je 0x408d67
push str.GetComputerNameExA
push 0x42af30
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x408c08
lea edx, [esp + 0x10]
push edx
push 0
push 3
mov dword [esp + 0x1c], 0
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
mov eax, dword [esp + 0x10]
jne 0x408bd4
test eax, eax
jne 0x408bd6
mov eax, 0x400
mov dword [esp + 0x10], eax
jmp 0x408bd8
test eax, eax
jbe 0x408c08
push eax
call fcn.00412f17
add esp, 4
test eax, eax
mov dword [edi], eax
je 0x408c11
lea ecx, [esp + 0x10]
push ecx
push eax
push 3
call esi
test eax, eax
jne 0x408c08
mov edx, dword [edi]
push edx
call fcn.00412262
add esp, 4
mov dword [edi], 0
jmp 0x408c11
cmp dword [edi], 0
jne 0x408d67
lea eax, [esp + 0x14]
push eax
mov ebx, 1
push ebx
push 0
push str.SYSTEMCurrentControlSetServicesTcpipParameters
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x408d5c
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x304]
push edx
mov byte [esp + 0x308], al
lea eax, [esp + 0x18]
push eax
push 0
push str.Domain
push ecx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x38], 0x400
call esi
test eax, eax
jne 0x408d5c
cmp dword [esp + 0x10], ebx
jne 0x408d5c
lea edx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x18]
mov byte [esp + 0xfc], al
lea eax, [esp + 0xfc]
push eax
lea ecx, [esp + 0x18]
push ecx
push 0
push str.Hostname
push edx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x38], 0x104
call esi
test eax, eax
jne 0x408d5c
cmp dword [esp + 0x10], ebx
jne 0x408d5c
cmp byte [esp + 0xf8], al
je 0x408d5c
lea eax, [esp + 0x300]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x408ce0
sub eax, edx
mov esi, eax
lea eax, [esp + 0xf8]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x408cf7
sub eax, edx
add eax, 1
test esi, esi
jle 0x408d0d
lea eax, [eax + esi + 1]
push eax
call fcn.00412f17
add esp, 4
test eax, eax
mov dword [edi], eax
je 0x408d5c
test esi, esi
jle 0x408d40
lea ecx, [esp + 0x300]
push ecx
lea edx, [esp + 0xfc]
push edx
push str._s._s
push eax
call fcn.00413e72
add esp, 0x10
jmp 0x408d5c
lea ecx, [esp + 0xf8]
mov edx, eax
lea esp, [esp]
mov al, byte [ecx]
mov byte [edx], al
add ecx, ebx
add edx, ebx
test al, al
jne 0x408d50
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ecx
call esi
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x408d7f
push eax
call esi
mov eax, dword [esp + 0x1c]
jmp 0x4088d1
mov ecx, dword [esp + 0x6f4]
pop ebp
xor ecx, esp
mov eax, 0x57
call fcn.00412a21
add esp, 0x6f4
ret