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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6e4
mov eax, dword [ebp + 8]
test eax, eax
push ebx
push esi
push edi
mov dword [esp + 0x14], 0xffffffff
mov dword [esp + 0x20], 0
je 0x4032db
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4032db
mov dword [eax], 0
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x402cd8
mov dword [eax], 0
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x402ce2
mov byte [eax], 0
xor eax, eax
mov ecx, 0x25
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x48]
push eax
mov dword [esp + 0x4c], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x402d2c
cmp dword [esp + 0x58], 2
je 0x402d17
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.Netapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
mov dword [esp + 0x18], edi
jne 0x402d39
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.NetApiBufferFree
push edi
call esi
test eax, eax
mov dword [esp + 0x1c], eax
je 0x402d5f
push str.NetWkstaGetInfo
push edi
call esi
test eax, eax
mov dword [esp + 0x24], eax
jne 0x402d77
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esp + 0x4c], 5
mov ebx, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
jb 0x402e1b
push str.NetGetJoinInformation
push edi
mov dword [esp + 0x14], 0
call esi
xor esi, esi
test eax, eax
je 0x402e04
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x10]
push edx
push esi
call eax
test eax, eax
jne 0x402e04
mov eax, dword [esp + 0x10]
cmp eax, 1
jne 0x402dc3
mov eax, dword [ebp + 0xc]
mov dword [eax], 1
jmp 0x402e00
cmp eax, 2
jne 0x402ddb
mov eax, dword [esp + 0xc]
cmp eax, esi
je 0x402e1b
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 2
jmp 0x402df1
cmp eax, 3
jne 0x402e04
mov eax, dword [esp + 0xc]
cmp eax, esi
je 0x402e1b
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 3
mov edx, dword [ebp + 8]
push esi
push esi
push 0x10
push edx
push 0xffffffffffffffff
push eax
push esi
push esi
call ebx
mov dword [esp + 0x14], esi
mov eax, dword [esp + 0xc]
cmp eax, esi
je 0x402e11
push eax
call dword [esp + 0x20]
cmp dword [esp + 0x14], esi
je 0x402ff9
xor esi, esi
push str.Advapi32.dll
mov dword [esp + 0x2c], esi
mov dword [esp + 0x14], esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
cmp ebx, esi
mov dword [esp + 0x20], ebx
jne 0x402e56
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.LsaOpenPolicy
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x402ea4
push str.LsaQueryInformationPolicy
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x402ea4
push str.LsaFreeMemory
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov dword [esp + 0x2c], eax
je 0x402ea4
mov ecx, dword [esp + 0x20]
push str.LsaClose
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
test ebx, ebx
jne 0x402ec5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [esp + 0x18]
mov edi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ebx
mov esi, eax
call edi
push ebx
call edi
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [esp + 0x10]
push edx
push 0x64
push 0
call dword [esp + 0x30]
test eax, eax
jne 0x402fe7
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea ecx, [esp + 0x28]
push ecx
mov dword [esp + 0x3c], eax
push 0x80000001
mov dword [esp + 0x44], eax
lea edx, [esp + 0x38]
mov dword [esp + 0x48], eax
push edx
push eax
mov dword [esp + 0x54], eax
call edi
test eax, eax
jne 0x402fda
mov ecx, dword [esp + 0x28]
lea eax, [esp + 0xc]
push eax
push 3
push ecx
call esi
test eax, eax
jne 0x402fd3
mov edx, dword [esp + 0xc]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.00402590
mov esi, dword [esp + 0x2c]
add esp, 8
test esi, esi
je 0x402fca
mov ecx, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0
push 0
push 0x10
push ecx
push 0xffffffffffffffff
push esi
push 0
push 0
call edi
mov edx, dword [esp + 0xc]
mov eax, dword [edx + 8]
test eax, eax
je 0x402f6f
mov eax, dword [ebp + 0xc]
mov dword [eax], 3
jmp 0x402fb9
mov edx, dword [esp + 0x10]
mov eax, dword [edx + 4]
push 0
push 0
push 0x10
lea ecx, [esp + 0xf4]
push ecx
push 0xffffffffffffffff
push eax
push 0
push 0
call edi
mov edx, dword [ebp + 8]
lea ecx, [esp + 0xe8]
push ecx
push edx
call fcn.0040c75e
add esp, 8
test eax, eax
jne 0x402fb0
mov eax, dword [ebp + 0xc]
mov dword [eax], 1
jmp 0x402fb9
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 2
push esi
mov dword [esp + 0x18], 0
call fcn.0040bf42
add esp, 4
mov edx, dword [esp + 0xc]
push edx
call dword [esp + 0x30]
mov eax, dword [esp + 0x28]
push eax
call ebx
mov eax, dword [esp + 0x10]
test eax, eax
je 0x402fe7
push eax
call dword [esp + 0x20]
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x4030d6
mov ebx, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4030d6
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 3
jne 0x4030d6
mov edx, dword [esp + 0x18]
push str.DsGetDcNameA
push edx
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x403098
mov edx, dword [ebp + 8]
lea ecx, [esp + 0x10]
push ecx
push 0x10000
push 0
push 0
push edx
push 0
call eax
test eax, eax
jne 0x40308b
mov ecx, 0x82
lea edi, [esp + 0xe8]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x10]
push 0x104
lea eax, [esp + 0xec]
push eax
add ecx, 0xc
push ecx
call dword [sym.imp.ole32.dll_StringFromGUID2]
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x14]
push 0
push 0
push edx
push eax
push 0xffffffffffffffff
lea ecx, [esp + 0xfc]
push ecx
push 0
push 0
call ebx
mov eax, dword [esp + 0x10]
test eax, eax
je 0x403098
push eax
call dword [esp + 0x20]
xor eax, eax
lea edx, [esp + 0x48]
mov ecx, 0x27
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
push edx
mov dword [esp + 0x4c], 0x9c
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x4030d6
cmp dword [esp + 0x4c], 5
jb 0x4030d6
cmp byte [esp + 0xe2], 2
jne 0x4030d6
mov eax, dword [ebp + 0xc]
mov dword [eax], 4
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x4032b8
push str.GetComputerNameExA
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x403165
lea ecx, [esp + 0xc]
push ecx
push 0
push 3
mov dword [esp + 0x18], 0
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
mov eax, dword [esp + 0xc]
jne 0x403131
test eax, eax
jne 0x403133
mov eax, 0x400
mov dword [esp + 0xc], eax
jmp 0x403135
test eax, eax
jbe 0x403165
push eax
call fcn.0040c2e2
add esp, 4
test eax, eax
mov dword [ebx], eax
je 0x40316e
lea edx, [esp + 0xc]
push edx
push eax
push 3
call esi
test eax, eax
jne 0x403165
mov eax, dword [ebx]
push eax
call fcn.0040bf42
add esp, 4
mov dword [ebx], 0
jmp 0x40316e
cmp dword [ebx], 0
jne 0x4032b8
lea ecx, [esp + 0x10]
push ecx
mov edi, 1
push edi
push 0
push str.SYSTEMCurrentControlSetServicesTcpipParameters
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4032ad
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [esp + 0x1c]
push edx
mov edx, dword [esp + 0x14]
mov byte [esp + 0x2f4], al
lea eax, [esp + 0x2f4]
push eax
lea ecx, [esp + 0x14]
push ecx
push 0
push str.Domain
push edx
mov dword [esp + 0x24], edi
mov dword [esp + 0x34], 0x400
call esi
test eax, eax
jne 0x4032ad
cmp dword [esp + 0xc], edi
jne 0x4032ad
lea eax, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0xec]
push ecx
lea edx, [esp + 0x14]
push edx
push 0
push str.Hostname
push eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x34], 0x104
mov byte [esp + 0x100], 0
call esi
test eax, eax
jne 0x4032ad
cmp dword [esp + 0xc], edi
jne 0x4032ad
mov al, byte [esp + 0xe8]
test al, al
je 0x4032ad
lea eax, [esp + 0x2f0]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403240
sub eax, edx
mov esi, eax
lea eax, [esp + 0xe8]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403255
sub eax, edx
inc eax
test esi, esi
jle 0x403267
lea eax, [eax + esi + 1]
push eax
call fcn.0040c2e2
add esp, 4
test eax, eax
mov dword [ebx], eax
je 0x4032ad
test esi, esi
jle 0x40329a
lea ecx, [esp + 0x2f0]
push ecx
lea edx, [esp + 0xec]
push edx
push str._s._s
push eax
call fcn.0040c706
add esp, 0x10
jmp 0x4032ad
lea ecx, [esp + 0xe8]
mov edx, eax
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x4032a3
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ecx
call esi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4032d0
push eax
call esi
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0x57
pop ebx
mov esp, ebp
pop ebp
ret