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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6f8
mov eax, dword [0x44e824]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
xor edx, edx
or dword [ebp - 0x6b8], 0xffffffff
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x6b4], eax
mov dword [ebp - 0x6d8], ecx
mov dword [ebp - 0x6c0], edx
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x6d4], edi
test eax, eax
je 0x4063d7
test esi, esi
je 0x4063d7
mov dword [esi], edx
test edi, edi
je 0x405d73
mov dword [edi], edx
test ecx, ecx
je 0x405d79
mov byte [ecx], dl
push 0x9c
push edx
lea eax, [ebp - 0x6a8]
push eax
call fcn.00414350
add esp, 0xc
mov dword [ebp - 0x6a8], 0x94
lea eax, [ebp - 0x6a8]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
jne 0x405db4
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4063da
cmp dword [ebp - 0x698], 2
je 0x405dc5
or eax, 0xffffffff
jmp 0x4063da
push str.Netapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
je 0x405da9
push str.NetApiBufferFree
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x6bc], eax
test eax, eax
jne 0x405e02
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, esi
jmp 0x4063da
push str.NetWkstaGetInfo
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x6cc], eax
test eax, eax
je 0x405dec
cmp dword [ebp - 0x6a4], 5
jb 0x405ec5
and dword [ebp - 0x6b0], 0
push str.NetGetJoinInformation
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x405ea3
lea ecx, [ebp - 0x6ac]
push ecx
lea ecx, [ebp - 0x6b0]
push ecx
push 0
call eax
test eax, eax
jne 0x405ea3
inc eax
cmp dword [ebp - 0x6ac], eax
jne 0x405e5f
mov dword [esi], eax
jmp 0x405e9c
push 2
pop eax
cmp dword [ebp - 0x6ac], eax
je 0x405e75
push 3
pop eax
cmp dword [ebp - 0x6ac], eax
jne 0x405ea3
cmp dword [ebp - 0x6b0], 0
je 0x405ec5
mov dword [esi], eax
xor eax, eax
push eax
push eax
push 0x10
push dword [ebp - 0x6b4]
push 0xffffffffffffffff
push dword [ebp - 0x6b0]
push eax
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
and dword [ebp - 0x6b8], 0
cmp dword [ebp - 0x6b0], 0
je 0x405eb8
push dword [ebp - 0x6b0]
call dword [ebp - 0x6bc]
cmp dword [ebp - 0x6b8], 0
je 0x4060e1
and dword [ebp - 0x6c8], 0
and dword [ebp - 0x6b0], 0
push str.Advapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x6c0], eax
test eax, eax
je 0x405dec
push str.LsaOpenPolicy
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x6ac], eax
test eax, eax
jne 0x405f1d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov edi, eax
push ebx
call esi
push ebx
call esi
mov eax, edi
jmp 0x4063da
push str.LsaQueryInformationPolicy
push dword [ebp - 0x6c0]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x6d0], eax
test eax, eax
je 0x405f02
push str.LsaFreeMemory
push dword [ebp - 0x6c0]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x6dc], eax
test eax, eax
je 0x405f02
push str.LsaClose
push dword [ebp - 0x6c0]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x6e0], eax
test eax, eax
je 0x405f02
lea eax, [ebp - 0x6b0]
push eax
push 0x64
push 0
call dword [ebp - 0x6cc]
test eax, eax
jne 0x4060d4
cmp dword [ebp - 0x6b0], eax
je 0x4060d4
push 6
pop ecx
lea edi, [ebp - 0x6f8]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x6c8]
push eax
push 0x80000001
lea eax, [ebp - 0x6f8]
push eax
push 0
call dword [ebp - 0x6ac]
test eax, eax
jne 0x4060b9
lea eax, [ebp - 0x6c4]
push eax
push 3
push dword [ebp - 0x6c8]
call dword [ebp - 0x6d0]
test eax, eax
jne 0x4060ad
mov eax, dword [ebp - 0x6c4]
mov dword [ebp - 0x6cc], eax
movzx eax, word [eax]
add eax, 2
push eax
mov dword [ebp - 0x6d0], eax
call fcn.004188c5
mov edi, eax
pop ecx
test edi, edi
je 0x4060a1
push dword [ebp - 0x6d0]
push 0
push edi
call fcn.00414350
mov eax, dword [ebp - 0x6cc]
movzx ecx, word [eax]
push ecx
push dword [eax + 4]
push edi
call fcn.004158d0
add esp, 0x18
xor eax, eax
push eax
push eax
push 0x10
push dword [ebp - 0x6b4]
push 0xffffffffffffffff
push edi
push eax
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov eax, dword [ebp - 0x6c4]
xor ecx, ecx
cmp dword [eax + 8], ecx
je 0x406057
mov dword [esi], 3
jmp 0x406093
push ecx
push ecx
push 0x10
lea eax, [ebp - 0x108]
push eax
mov eax, dword [ebp - 0x6b0]
push 0xffffffffffffffff
push dword [eax + 4]
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea eax, [ebp - 0x108]
push eax
push dword [ebp - 0x6b4]
call fcn.0041bb48
pop ecx
pop ecx
xor ecx, ecx
test eax, eax
setne cl
inc ecx
mov dword [esi], ecx
push edi
call fcn.004188c0
and dword [ebp - 0x6b8], 0
pop ecx
push dword [ebp - 0x6c4]
call dword [ebp - 0x6dc]
push dword [ebp - 0x6c8]
call dword [ebp - 0x6e0]
cmp dword [ebp - 0x6b0], 0
je 0x4060ce
push dword [ebp - 0x6b0]
call dword [ebp - 0x6bc]
mov edi, dword [ebp - 0x6d4]
cmp dword [ebp - 0x6b8], 0
jne 0x4061e4
cmp dword [ebp - 0x6d8], 0
je 0x4061e4
cmp dword [esi], 3
jne 0x4061e4
and dword [ebp - 0x6ac], 0
push str.DsGetDcNameA
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40619b
lea ecx, [ebp - 0x6ac]
push ecx
push 0x10000
xor ecx, ecx
push ecx
push ecx
push dword [ebp - 0x6b4]
push ecx
call eax
test eax, eax
jne 0x406186
cmp dword [ebp - 0x6ac], eax
je 0x40619b
push 0x208
push eax
lea eax, [ebp - 0x20c]
push eax
call fcn.00414350
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x104
push eax
mov eax, dword [ebp - 0x6ac]
add eax, 0xc
push eax
call dword [sym.imp.ole32.dll_StringFromGUID2]
xor ecx, ecx
lea eax, [ebp - 0x20c]
push ecx
push ecx
push dword [ebp + 0x18]
push dword [ebp - 0x6d8]
push 0xffffffffffffffff
push eax
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp dword [ebp - 0x6ac], 0
je 0x40619b
push dword [ebp - 0x6ac]
call dword [ebp - 0x6bc]
push 0x9c
lea eax, [ebp - 0x6a8]
push 0
push eax
call fcn.00414350
add esp, 0xc
mov dword [ebp - 0x6a8], 0x9c
lea eax, [ebp - 0x6a8]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x4061e4
cmp dword [ebp - 0x6a4], 5
jb 0x4061e4
cmp byte [ebp - 0x60e], 2
jne 0x4061e4
mov dword [esi], 4
test edi, edi
je 0x4063b9
push str.GetComputerNameExA
push 0x438344
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40626b
and dword [ebp - 0x6ac], 0
lea eax, [ebp - 0x6ac]
push eax
push 0
push 3
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
mov eax, dword [ebp - 0x6ac]
jne 0x40623f
test eax, eax
jne 0x406243
mov eax, 0x400
mov dword [ebp - 0x6ac], eax
test eax, eax
je 0x40626b
push eax
call fcn.004188c5
mov dword [edi], eax
pop ecx
test eax, eax
je 0x40626b
lea ecx, [ebp - 0x6ac]
push ecx
push eax
push 3
call esi
test eax, eax
jne 0x40626b
push dword [edi]
call fcn.004188c0
and dword [edi], 0
pop ecx
cmp dword [edi], 0
jne 0x4063b9
lea eax, [ebp - 0x6b4]
push eax
push 1
push 0
push str.SYSTEMCurrentControlSetServicesTcpipParameters
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4063ad
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov byte [ebp - 0x60c], al
lea eax, [ebp - 0x6bc]
push eax
lea eax, [ebp - 0x60c]
mov dword [ebp - 0x6ac], 1
push eax
lea eax, [ebp - 0x6ac]
mov dword [ebp - 0x6bc], 0x400
push eax
push 0
push str.Domain
push dword [ebp - 0x6b4]
call esi
test eax, eax
jne 0x4063ad
inc eax
cmp dword [ebp - 0x6ac], eax
jne 0x4063ad
mov dword [ebp - 0x6ac], eax
lea eax, [ebp - 0x6bc]
push eax
lea eax, [ebp - 0x108]
mov dword [ebp - 0x6bc], 0x104
push eax
lea eax, [ebp - 0x6ac]
mov byte [ebp - 0x108], 0
push eax
push 0
push str.Hostname
push dword [ebp - 0x6b4]
call esi
test eax, eax
jne 0x4063ad
cmp dword [ebp - 0x6ac], 1
jne 0x4063ad
cmp byte [ebp - 0x108], al
je 0x4063ad
lea esi, [ebp - 0x60c]
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x406349
sub esi, ecx
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40635b
sub ecx, edx
inc ecx
test esi, esi
jle 0x40636c
inc ecx
add ecx, esi
push ecx
call fcn.004188c5
pop ecx
mov ecx, eax
mov dword [edi], ecx
test ecx, ecx
je 0x4063ad
test esi, esi
jle 0x40639d
lea eax, [ebp - 0x60c]
push eax
lea eax, [ebp - 0x108]
push eax
push str._s._s
push ecx
call fcn.004011e8
add esp, 0x10
jmp 0x4063ad
lea edx, [ebp - 0x108]
mov al, byte [edx]
inc edx
mov byte [ecx], al
inc ecx
test al, al
jne 0x4063a3
push dword [ebp - 0x6b4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ebx
call esi
mov eax, dword [ebp - 0x6c0]
test eax, eax
je 0x4063cf
push eax
call esi
mov eax, dword [ebp - 0x6b8]
jmp 0x4063da
push 0x57
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00412e47
mov esp, ebp
pop ebp
ret