Function at 0x40cda0
Capabilities:
Link many functions at runtime
Reference sql statements

Disassembly:
push 0xffffffffffffffff
push 0x43f418
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push ebp
push esi
push edi
mov eax, dword [0x456ea4]
xor eax, esp
push eax
lea eax, [esp + 0x3c]
mov dword fs:[0], eax
mov ebx, ecx
xor esi, esi
mov dword [esp + 0x20], esi
call fcn.0041890e
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x40cde9
push 0x80004005
call fcn.00406210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x38], eax
mov dword [esp + 0x44], esi
call fcn.0041890e
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x40ce17
push 0x80004005
call fcn.00406210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
lea ecx, [ebx + 0x14c]
mov byte [esp + 0x44], 1
call fcn.004217e5
push str.msi.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
cmp edi, esi
je 0x40d0fb
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.MsiGetActiveDatabase
push edi
call ebp
push str.MsiCloseHandle
push edi
mov esi, eax
call ebp
mov ecx, dword [esp + 0x4c]
push ecx
mov dword [esp + 0x2c], eax
call esi
test eax, eax
mov dword [esp + 0x1c], eax
je 0x40d0d4
call fcn.0041890e
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40ce95
push 0x80004005
call fcn.00406210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x34], eax
push str.MsiDatabaseOpenViewW
push edi
mov byte [esp + 0x4c], 2
call ebp
push str.MsiViewExecute
push edi
mov esi, eax
call ebp
lea ecx, [ebx + 0x5c]
push ecx
lea edx, [esp + 0x30]
push str.SELECT_Client_FROM_ADSCompClients_WHERE_Component
push edx
mov dword [esp + 0x3c], eax
call fcn.00406010
push 0x446ffc
push eax
lea eax, [esp + 0x2c]
push eax
mov byte [esp + 0x5c], 3
call fcn.00405f60
add esp, 0x18
mov eax, dword [eax]
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x4c]
push ecx
push eax
push edx
mov byte [esp + 0x50], 4
call esi
mov esi, eax
mov eax, dword [esp + 0x18]
neg esi
sbb esi, esi
add eax, 0xfffffff0
add esi, 1
mov byte [esp + 0x44], 3
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cf2d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
mov byte [esp + 0x44], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cf52
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
je 0x40d093
mov ecx, dword [esp + 0x4c]
push 0
push ecx
call dword [esp + 0x38]
test eax, eax
je 0x40cf84
mov edx, dword [ebx + 0x1c]
mov eax, dword [edx + 0x68]
add ebx, 0x1c
push str.Couldnt_Open_View
push 1
push ebx
call eax
add esp, 0xc
jmp 0x40d084
push str.MsiViewFetch
push edi
call ebp
mov edx, dword [esp + 0x4c]
lea ecx, [esp + 0x18]
push ecx
push edx
mov dword [esp + 0x38], eax
call eax
test eax, eax
jne 0x40d074
jmp 0x40cfb0
push str.MsiRecordGetStringW
push edi
mov dword [esp + 0x2c], 0x800
call ebp
mov ecx, dword [esp + 0x24]
mov esi, eax
lea eax, [esp + 0x24]
push eax
push ecx
lea ecx, [esp + 0x1c]
call fcn.00406ae0
mov edx, dword [esp + 0x1c]
push eax
push 1
push edx
call esi
test eax, eax
jne 0x40d048
mov edx, dword [esp + 0x14]
test edx, edx
je 0x40d005
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40cff0
sub eax, esi
sar eax, 1
js 0x40d0ca
cmp eax, dword [edx - 8]
jg 0x40d0ca
mov dword [edx - 0xc], eax
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x14]
mov word [ecx + eax*2], 0
push edx
lea ecx, [ebx + 0x14c]
call fcn.00421851
mov edx, dword [esp + 0x14]
mov ecx, dword [ebx + 0x1c]
push edx
lea eax, [ebx + 0x1c]
push str.Read_Client_from_Table:__s
push 0xa
push eax
mov eax, dword [ecx + 0x68]
call eax
add esp, 0x10
jmp 0x40d05e
mov ecx, dword [ebx + 0x1c]
mov edx, dword [ecx + 0x68]
lea eax, [ebx + 0x1c]
push str.___ReadClientsFromTable:_MsiRecordgetString_failed
push 0
push eax
call edx
add esp, 0xc
mov ecx, dword [esp + 0x4c]
lea eax, [esp + 0x18]
push eax
push ecx
call dword [esp + 0x38]
test eax, eax
je 0x40cfb0
cmp dword [esp + 0x18], 0
je 0x40d084
mov edx, dword [esp + 0x1c]
push edx
call dword [esp + 0x2c]
push str.MsiViewClose
push edi
call ebp
mov ecx, dword [esp + 0x4c]
push ecx
call eax
mov edx, dword [esp + 0x1c]
push edx
call dword [esp + 0x2c]
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
mov byte [esp + 0x44], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0f2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40d11b
push 0x80070057
call fcn.00406210
mov ecx, dword [ebx + 0x1c]
mov edx, dword [ecx + 0x68]
add ebx, 0x1c
push str.ReadClientsFromTable:_MsiGetActiveDatabase_Failed
push 0
push ebx
call edx
add esp, 0xc
mov dword [esp + 0x20], 0xffffffff
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40d11b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebx + 0x1c]
mov edx, dword [ecx + 0x68]
push eax
add ebx, 0x1c
push str.LoadLibrary_msi.dll_Failed__error:_d
push esi
push ebx
mov dword [esp + 0x30], eax
call edx
add esp, 0x10
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x44], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d140
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
mov dword [esp + 0x44], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d168
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 4