Function at 0x402c80
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 0x4032cb
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4032cb
mov dword [eax], 0
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x402cc8
mov dword [eax], 0
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x402cd2
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 0x402d1c
cmp dword [esp + 0x58], 2
je 0x402d07
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 0x402d29
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 0x402d4f
push str.NetWkstaGetInfo
push edi
call esi
test eax, eax
mov dword [esp + 0x24], eax
jne 0x402d67
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 0x402e0b
push str.NetGetJoinInformation
push edi
mov dword [esp + 0x14], 0
call esi
xor esi, esi
test eax, eax
je 0x402df4
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x10]
push edx
push esi
call eax
test eax, eax
jne 0x402df4
mov eax, dword [esp + 0x10]
cmp eax, 1
jne 0x402db3
mov eax, dword [ebp + 0xc]
mov dword [eax], 1
jmp 0x402df0
cmp eax, 2
jne 0x402dcb
mov eax, dword [esp + 0xc]
cmp eax, esi
je 0x402e0b
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 2
jmp 0x402de1
cmp eax, 3
jne 0x402df4
mov eax, dword [esp + 0xc]
cmp eax, esi
je 0x402e0b
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 0x402e01
push eax
call dword [esp + 0x20]
cmp dword [esp + 0x14], esi
je 0x402fe9
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 0x402e46
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 0x402e94
push str.LsaQueryInformationPolicy
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x402e94
push str.LsaFreeMemory
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov dword [esp + 0x2c], eax
je 0x402e94
mov ecx, dword [esp + 0x20]
push str.LsaClose
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
test ebx, ebx
jne 0x402eb5
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 0x402fd7
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 0x402fca
mov ecx, dword [esp + 0x28]
lea eax, [esp + 0xc]
push eax
push 3
push ecx
call esi
test eax, eax
jne 0x402fc3
mov edx, dword [esp + 0xc]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.00402580
mov esi, dword [esp + 0x2c]
add esp, 8
test esi, esi
je 0x402fba
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 0x402f5f
mov eax, dword [ebp + 0xc]
mov dword [eax], 3
jmp 0x402fa9
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.0040c70e
add esp, 8
test eax, eax
jne 0x402fa0
mov eax, dword [ebp + 0xc]
mov dword [eax], 1
jmp 0x402fa9
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 2
push esi
mov dword [esp + 0x18], 0
call fcn.0040bef2
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 0x402fd7
push eax
call dword [esp + 0x20]
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x4030c6
mov ebx, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4030c6
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 3
jne 0x4030c6
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 0x403088
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 0x40307b
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 0x403088
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 0x4030c6
cmp dword [esp + 0x4c], 5
jb 0x4030c6
cmp byte [esp + 0xe2], 2
jne 0x4030c6
mov eax, dword [ebp + 0xc]
mov dword [eax], 4
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x4032a8
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 0x403155
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 0x403121
test eax, eax
jne 0x403123
mov eax, 0x400
mov dword [esp + 0xc], eax
jmp 0x403125
test eax, eax
jbe 0x403155
push eax
call fcn.0040c292
add esp, 4
test eax, eax
mov dword [ebx], eax
je 0x40315e
lea edx, [esp + 0xc]
push edx
push eax
push 3
call esi
test eax, eax
jne 0x403155
mov eax, dword [ebx]
push eax
call fcn.0040bef2
add esp, 4
mov dword [ebx], 0
jmp 0x40315e
cmp dword [ebx], 0
jne 0x4032a8
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 0x40329d
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 0x40329d
cmp dword [esp + 0xc], edi
jne 0x40329d
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 0x40329d
cmp dword [esp + 0xc], edi
jne 0x40329d
mov al, byte [esp + 0xe8]
test al, al
je 0x40329d
lea eax, [esp + 0x2f0]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403230
sub eax, edx
mov esi, eax
lea eax, [esp + 0xe8]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403245
sub eax, edx
inc eax
test esi, esi
jle 0x403257
lea eax, [eax + esi + 1]
push eax
call fcn.0040c292
add esp, 4
test eax, eax
mov dword [ebx], eax
je 0x40329d
test esi, esi
jle 0x40328a
lea ecx, [esp + 0x2f0]
push ecx
lea edx, [esp + 0xec]
push edx
push str._s._s
push eax
call fcn.0040c6b6
add esp, 0x10
jmp 0x40329d
lea ecx, [esp + 0xe8]
mov edx, eax
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x403293
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 0x4032c0
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