Function at 0x40b060
Capabilities:
Link many functions at runtime
Reference sql statements
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43f0b6
mov eax, dword fs:[0]
push eax
sub esp, 0x1c8
mov eax, dword [0x456ea4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], ecx
push str.msi.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x18], eax
lea ecx, [ebp - 0x34]
call fcn.00406900
mov dword [ebp - 4], 0
mov eax, dword [ebp + 0xc]
push eax
lea ecx, [ebp - 0x38]
call fcn.00406960
mov byte [ebp - 4], 1
mov eax, dword [ebp + 0x10]
push eax
lea ecx, [ebp - 0x3c]
call fcn.00406960
mov byte [ebp - 4], 2
mov dword [ebp - 0x30], 0
cmp dword [ebp - 0x18], 0
jne 0x40b117
mov dword [ebp - 0x1c4], 0xfffffff6
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x3c]
call fcn.004069e0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x38]
call fcn.004069e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x34]
call fcn.004069e0
mov eax, dword [ebp - 0x1c4]
jmp 0x40b44c
push str.MsiOpenDatabaseW
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x40], eax
push str.MsiDatabaseOpenViewW
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x44], eax
push str.MsiViewExecute
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x48], eax
push str.MsiViewFetch
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x4c], eax
push str.MsiViewClose
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x50], eax
push str.MsiCloseHandle
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x54], eax
push str.MsiCreateRecord
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x58], eax
push str.MsiRecordReadStream
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x1c]
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
call dword [ebp - 0x40]
push 0x446ffc
lea eax, [ebp - 0x38]
push eax
push str.SELECT__FROM_Binary_WHERE_Name
lea ecx, [ebp - 0x1c0]
push ecx
call fcn.00406010
add esp, 0xc
mov dword [ebp - 0x1c8], eax
mov edx, dword [ebp - 0x1c8]
mov dword [ebp - 0x1cc], edx
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x1cc]
push eax
lea ecx, [ebp - 0x1bc]
push ecx
call fcn.00405f60
add esp, 0xc
mov dword [ebp - 0x1d0], eax
mov edx, dword [ebp - 0x1d0]
mov dword [ebp - 0x1d4], edx
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x1d4]
push eax
lea ecx, [ebp - 0x34]
call fcn.00406a00
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x1bc]
call fcn.004069e0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x1c0]
call fcn.004069e0
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x34]
call fcn.00406a90
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [ebp - 0x44]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x40b408
push 0
mov eax, dword [ebp - 0x20]
push eax
call dword [ebp - 0x48]
test eax, eax
jne 0x40b3f1
push 3
call dword [ebp - 0x58]
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x24]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
call dword [ebp - 0x4c]
test eax, eax
jne 0x40b3db
mov dword [ebp - 0x28], 0
lea eax, [ebp - 0x28]
push eax
push 0
push 2
mov ecx, dword [ebp - 0x24]
push ecx
call dword [ebp - 0x5c]
test eax, eax
jne 0x40b3d2
lea ecx, [ebp - 0x60]
call fcn.00406900
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x28]
add eax, 1
push eax
call fcn.00416652
add esp, 4
mov dword [ebp - 0x1b8], eax
mov ecx, dword [ebp - 0x1b8]
mov dword [ebp - 0x64], ecx
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x64]
push ecx
push 2
mov edx, dword [ebp - 0x24]
push edx
call dword [ebp - 0x5c]
test eax, eax
jne 0x40b3bd
push 0x104
push 0
lea eax, [ebp - 0x16c]
push eax
call fcn.00425f70
add esp, 0xc
push 0
push 0
push 0x104
lea eax, [ebp - 0x16c]
push eax
lea ecx, [ebp - 0x3c]
call fcn.00406b20
push eax
push 0
lea ecx, [ebp - 0x3c]
call fcn.00406ab0
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0x446fb0
lea eax, [ebp - 0x16c]
push eax
call fcn.00427581
add esp, 8
mov dword [ebp - 0x68], eax
cmp dword [ebp - 0x68], 0
je 0x40b373
mov eax, dword [ebp - 0x68]
push eax
mov ecx, dword [ebp - 0x28]
push ecx
push 1
mov edx, dword [ebp - 0x64]
push edx
call fcn.0042743b
add esp, 0x10
mov eax, dword [ebp - 0x68]
push eax
call fcn.00427260
add esp, 4
jmp 0x40b3bb
mov dword [ebp - 0x1b4], 0xffffffff
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x60]
call fcn.004069e0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x3c]
call fcn.004069e0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x38]
call fcn.004069e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x34]
call fcn.004069e0
mov eax, dword [ebp - 0x1b4]
jmp 0x40b44c
jmp 0x40b3c4
mov dword [ebp - 0x30], 0xfffffffe
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x60]
call fcn.004069e0
jmp 0x40b3d9
mov dword [ebp - 0x30], 0xfffffffd
jmp 0x40b3e2
mov dword [ebp - 0x30], 0xfffffffc
cmp dword [ebp - 0x24], 0
je 0x40b3ef
mov eax, dword [ebp - 0x24]
push eax
call dword [ebp - 0x54]
jmp 0x40b3f8
mov dword [ebp - 0x30], 0xfffffffb
mov eax, dword [ebp - 0x20]
push eax
call dword [ebp - 0x50]
mov eax, dword [ebp - 0x20]
push eax
call dword [ebp - 0x54]
jmp 0x40b40f
mov dword [ebp - 0x30], 0xfffffffa
mov eax, dword [ebp - 0x1c]
push eax
call dword [ebp - 0x54]
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x1b0], eax
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x3c]
call fcn.004069e0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x38]
call fcn.004069e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x34]
call fcn.004069e0
mov eax, dword [ebp - 0x1b0]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00425f3c
mov esp, ebp
pop ebp
ret 0xc