Function at 0x401000
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1954
call fcn.00407f50
push ebx
push esi
push edi
mov dword [ebp - 0x31c], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x42c], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x428], 0
mov dword [ebp - 0x434], 0
mov dword [ebp - 0x430], 0
push 0x1508
push 0
lea eax, [ebp - 0x193c]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
cmp dword [ebp + 8], 3
jle 0x4011c1
push 0x103
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 4]
push edx
lea eax, [ebp - 0x111c]
push eax
call sub.MSVCRT.dll_wcsncpy
add esp, 0xc
mov word [ebp - 0xf16], 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 8]
push edx
call sub.MSVCRT.dll__wtoi
add esp, 4
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 0xc]
push ecx
call sub.MSVCRT.dll__wtoi
add esp, 4
mov dword [ebp - 0x42c], eax
cmp dword [ebp - 0x42c], 1
je 0x4010d1
cmp dword [ebp - 8], 4
jne 0x4010d1
mov dword [ebp - 8], 0
cmp dword [ebp - 0x42c], 1
jne 0x401115
cmp dword [ebp + 8], 4
jle 0x40110b
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 0x10]
push eax
call sub.MSVCRT.dll__wtoi
add esp, 4
test eax, eax
jne 0x4010ff
mov dword [ebp - 0x848], 0
jmp 0x401109
mov dword [ebp - 0x848], 1
jmp 0x401115
mov dword [ebp - 0x848], 0
cmp dword [ebp + 8], 4
jle 0x40113f
push 0x103
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 0x10]
push edx
lea eax, [ebp - 0xf14]
push eax
call sub.MSVCRT.dll_wcsncpy
add esp, 0xc
mov word [ebp - 0xd0e], 0
cmp dword [ebp - 0x42c], 4
jne 0x4011c1
cmp dword [ebp + 8], 5
jge 0x401157
mov dword [ebp - 8], 0
jmp 0x40116a
cmp dword [ebp - 8], 1
je 0x40116a
cmp dword [ebp + 8], 6
jge 0x40116a
mov dword [ebp - 8], 0
cmp dword [ebp - 8], 0
je 0x4011c1
push 0x103
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 0x14]
push edx
lea eax, [ebp - 0xaa0]
push eax
call sub.MSVCRT.dll_wcsncpy
add esp, 0xc
mov word [ebp - 0x89a], 0
cmp dword [ebp + 8], 6
jl 0x4011c1
cmp dword [ebp - 8], 1
je 0x4011c1
push 0x27
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 0x18]
push edx
lea eax, [ebp - 0x898]
push eax
call sub.MSVCRT.dll_wcsncpy
add esp, 0xc
mov word [ebp - 0x84a], 0
cmp dword [ebp - 8], 1
jl 0x4011fb
cmp dword [ebp - 8], 4
jg 0x4011fb
cmp dword [ebp - 0x42c], 1
jl 0x4011fb
cmp dword [ebp - 0x42c], 4
jg 0x4011fb
cmp dword [ebp - 0x42c], 1
je 0x401205
lea ecx, [ebp - 0xf14]
push ecx
call sub.MSVCRT.dll_wcslen
add esp, 4
test eax, eax
ja 0x401205
mov eax, 0x20000100
jmp 0x40196f
push str.MSSQLServerCurrentVersion
lea edx, [ebp - 0x111c]
push edx
lea eax, [ebp - 0x210]
push eax
call fcn.00401bd0
add esp, 0xc
lea ecx, [ebp - 0x430]
push ecx
push 0x20019
push 0
lea edx, [ebp - 0x210]
push edx
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40128c
mov dword [ebp - 0x1940], 4
lea eax, [ebp - 0x1940]
push eax
push 0x40f0c4
lea ecx, [ebp - 0x1944]
push ecx
push 0
push str.Language
mov edx, dword [ebp - 0x430]
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov eax, dword [ebp - 0x430]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x430], 0
push 0x40b0bc
lea ecx, [ebp - 0x111c]
push ecx
lea edx, [ebp - 0x210]
push edx
call fcn.00401bd0
add esp, 0xc
lea eax, [ebp - 0x430]
push eax
push 0x20019
push 0
lea ecx, [ebp - 0x210]
push ecx
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x401309
mov dword [ebp - 0x1948], 4
lea edx, [ebp - 0x1948]
push edx
push 0x40f0c8
lea eax, [ebp - 0x194c]
push eax
push 0
push str.Debug
mov ecx, dword [ebp - 0x430]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0x430]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [0x40f0c8], 0
je 0x40132f
push 0x200004
push str.XPADSI_main
push str.Do_you_want_to_debug_
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp eax, 6
jne 0x40132f
int3
lea eax, [ebp - 0x424]
push eax
lea ecx, [ebp - 0x111c]
push ecx
call fcn.00404557
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x401369
mov edx, dword [ebp - 4]
push edx
push str.Could_not_query_SQL_instance_service_account.
call fcn.00401ce0
add esp, 8
mov eax, 0x20000004
jmp 0x40196f
lea eax, [ebp - 0x424]
push eax
push str.LocalSystem
call sub.MSVCRT.dll__wcsicmp
add esp, 8
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x428], eax
cmp dword [ebp - 8], 3
jne 0x40139b
cmp dword [ebp - 0x42c], 1
je 0x4014ed
cmp dword [ebp - 0x428], 0
jne 0x4014ed
cmp dword [ebp - 8], 1
jne 0x40142b
cmp dword [ebp - 0x42c], 1
jne 0x40142b
mov dword [ebp - 0x1950], 0
push 1
lea ecx, [ebp - 0x193c]
push ecx
call fcn.00401976
add esp, 8
mov dword [ebp - 0x1950], eax
cmp dword [ebp - 0x1950], 0
je 0x401424
cmp dword [ebp - 0x1950], 0x20000006
jne 0x401406
push 0
push 0x40b178
call fcn.00401ce0
add esp, 8
mov eax, 0x20000006
jmp 0x40196f
mov edx, dword [ebp - 0x1950]
push edx
push str.Cannot_start_helper_service_to_create_SCP_object.
call fcn.00401ce0
add esp, 8
mov eax, 0x20000005
jmp 0x40196f
xor eax, eax
jmp 0x40196f
lea eax, [ebp - 0x193c]
push eax
lea ecx, [ebp - 0x318]
push ecx
call fcn.00404841
add esp, 8
test eax, eax
jne 0x4014d4
lea edx, [ebp - 0x318]
push edx
lea eax, [ebp - 0x424]
push eax
call sub.MSVCRT.dll__wcsicmp
add esp, 8
test eax, eax
jne 0x401465
jmp 0x4014d2
mov dword [ebp - 0x1954], 0
push 2
lea ecx, [ebp - 0x193c]
push ecx
call fcn.00401976
add esp, 8
mov dword [ebp - 0x1954], eax
cmp dword [ebp - 0x1954], 0
je 0x4014d2
cmp dword [ebp - 0x1954], 0x20000006
jne 0x4014b4
push 0
push str.SQL_AD_Helper_service_is_busy__please_try_again_later.
call fcn.00401ce0
add esp, 8
mov eax, 0x20000006
jmp 0x40196f
mov edx, dword [ebp - 0x1954]
push edx
push str.Cannot_start_helper_service_to_update_DACLs_of_SCP_and_its_child_objects.
call fcn.00401ce0
add esp, 8
mov eax, 0x20000005
jmp 0x40196f
jmp 0x4014ed
push 0
push str.Could_not_find_SQL_Server_instance_service_account_in_the_registry.
call fcn.00401ce0
add esp, 8
mov eax, 0x20000003
jmp 0x40196f
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x31c], 0
jge 0x401522
mov eax, dword [ebp - 0x31c]
push eax
push str.CoInitialize_failed.
call fcn.00401ce0
add esp, 8
mov eax, 0x20000001
jmp 0x40196f
push str.activeds.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x434], eax
cmp dword [ebp - 0x434], 0
jne 0x40154b
mov dword [ebp - 0x31c], 0x20000007
jmp 0x40196d
push str.ADsGetObject
mov ecx, dword [ebp - 0x434]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x40f0b8], eax
cmp dword [0x40f0b8], 0
jne 0x40157c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x31c], eax
jmp 0x40196b
push str.FreeADsMem
mov edx, dword [ebp - 0x434]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x40f0bc], eax
cmp dword [0x40f0bc], 0
jne 0x4015ad
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x31c], eax
jmp 0x401969
cmp dword [ebp - 8], 4
jne 0x4015d8
cmp dword [ebp - 0x42c], 1
jne 0x4015d8
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00407c0e
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 8], 1
jne 0x4016ee
cmp dword [ebp - 0x42c], 1
jne 0x40161c
mov ecx, dword [ebp - 0x428]
neg ecx
sbb ecx, ecx
not ecx
lea edx, [ebp - 0x424]
and ecx, edx
push ecx
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00407020
add esp, 0x10
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 2
jne 0x401656
mov ecx, dword [ebp - 0x428]
neg ecx
sbb ecx, ecx
not ecx
lea edx, [ebp - 0x424]
and ecx, edx
push ecx
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00405bd0
add esp, 0x10
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 4
jne 0x4016c9
mov ecx, dword [ebp - 0x428]
neg ecx
sbb ecx, ecx
not ecx
lea edx, [ebp - 0x424]
and ecx, edx
push ecx
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00406789
add esp, 0x10
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x31c], 0
je 0x4016c9
mov ecx, dword [ebp - 0x31c]
and ecx, 0xffff
cmp ecx, 0x1392
jne 0x4016c9
lea edx, [ebp - 0x193c]
push edx
push 1
push SysStringLen
call fcn.00406a93
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 3
jne 0x4016ee
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00406474
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 8], 2
jne 0x401874
cmp dword [ebp - 0x42c], 1
jne 0x401765
lea ecx, [ebp - 0x193c]
push ecx
push 1
push SysStringLen
call fcn.00407783
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x31c], 0
jne 0x401728
jmp 0x401765
mov edx, dword [ebp - 0x31c]
and edx, 0xffff
cmp edx, 0x2030
je 0x40174e
mov eax, dword [ebp - 0x31c]
and eax, 0xffff
cmp eax, 0x202b
jne 0x401765
push 1
lea ecx, [ebp - 0x193c]
push ecx
call fcn.00401976
add esp, 8
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 2
jne 0x4017d8
lea edx, [ebp - 0x193c]
push edx
push 1
push SysStringLen
call fcn.00405ccc
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x31c], 0
jne 0x401795
jmp 0x4017d8
mov eax, dword [ebp - 0x31c]
and eax, 0xffff
cmp eax, 0x2030
jne 0x4017d8
mov ecx, dword [ebp - 0x428]
neg ecx
sbb ecx, ecx
not ecx
lea edx, [ebp - 0x424]
and ecx, edx
push ecx
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00405bd0
add esp, 0x10
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 4
jne 0x401874
lea ecx, [ebp - 0x193c]
push ecx
push 1
push SysStringLen
call fcn.00406a93
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x31c], 0
je 0x40184f
mov edx, dword [ebp - 0x31c]
and edx, 0xffff
cmp edx, 0x2030
jne 0x40184f
mov eax, dword [ebp - 0x428]
neg eax
sbb eax, eax
not eax
lea ecx, [ebp - 0x424]
and eax, ecx
push eax
lea edx, [ebp - 0x193c]
push edx
push 1
push SysStringLen
call fcn.00406789
add esp, 0x10
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 3
jne 0x401874
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.0040658d
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 8], 3
jne 0x40190d
cmp dword [ebp - 0x42c], 1
jne 0x40189e
push 3
lea ecx, [ebp - 0x193c]
push ecx
call fcn.00401976
add esp, 8
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 2
jne 0x4018c3
lea edx, [ebp - 0x193c]
push edx
push 1
push SysStringLen
call fcn.00405f51
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 4
jne 0x4018e8
lea eax, [ebp - 0x193c]
push eax
push 1
push SysStringLen
call fcn.00406e4c
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x42c], 3
jne 0x40190d
lea ecx, [ebp - 0x193c]
push ecx
push 1
push SysStringLen
call fcn.00406681
add esp, 0xc
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x434], 0
je 0x401923
mov edx, dword [ebp - 0x434]
push edx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
call dword [sym.imp.ole32.dll_CoUninitialize]
cmp dword [ebp - 0x31c], 0
jne 0x401936
xor eax, eax
jmp 0x40196f
mov eax, dword [ebp - 0x31c]
and eax, 0x20000000
test eax, eax
je 0x40194d
mov eax, dword [ebp - 0x31c]
jmp 0x40196f
mov ecx, dword [ebp - 0x31c]
push ecx
push str.Operation_failed.
call fcn.00401ce0
add esp, 8
mov eax, dword [ebp - 0x31c]
jmp 0x40196f
jmp 0x40190d
jmp 0x40190d
jmp 0x40190d
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret