Function at 0x4019e0
Capabilities:
Reference sql statements
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
mov ebx, edx
sub esp, 0x44c
mov dword [ebp - 0x428], 0
mov dword [ebp - 0x424], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x40000000
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov edi, eax
cmp eax, 0xffffffff
je 0x401b10
lea eax, [ebp - 0x428]
mov dword [esp + 4], str.SELECT_Data_FROM__Streams_WHERE_Name___
mov dword [esp + 8], eax
mov eax, dword [esi]
mov dword [esp], eax
call sub.msi.dll_MsiDatabaseOpenViewW
sub esp, 0xc
test eax, eax
je 0x401ac0
xor esi, esi
test byte [section..data], 2
jne 0x401ca0
mov eax, dword [ebp - 0x424]
test eax, eax
je 0x401a92
mov dword [esp], eax
call sub.msi.dll_MsiCloseHandle
sub esp, 4
mov eax, dword [ebp - 0x428]
test eax, eax
jne 0x401b00
cmp edi, 0xffffffff
je 0x401aad
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 1
call sub.msi.dll_MsiCreateRecord
sub esp, 4
mov dword [ebp - 0x424], eax
test eax, eax
jne 0x401be0
test byte [section..data], 2
jne 0x401d30
mov eax, dword [ebp - 0x428]
xor esi, esi
test eax, eax
je 0x401aa1
lea esi, [esi]
lea esi, [esi]
mov dword [esp], eax
call sub.msi.dll_MsiViewClose
sub esp, 4
jmp 0x401a9c
xor esi, esi
test byte [section..data], 2
je 0x401a7d
test ebx, ebx
je 0x401f30
mov eax, ebx
shr eax, 0x10
je 0x401f00
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, str._invalid_
test esi, esi
jne 0x401c6b
cmp word [ebx], 0
je 0x401b6a
lea esi, [esi]
nop
add esi, 1
cmp word [ebx + esi*2], 0
jne 0x401b60
mov eax, 0x224c
mov dword [ebp - 0x42c], ebx
lea edx, [ebp - 0x416]
mov word [ebp - 0x418], ax
lea eax, [ebp - 0x2f6]
lea ecx, [esi - 1]
cmp edx, eax
ja 0x401c40
test esi, esi
jle 0x401c40
add dword [ebp - 0x42c], 2
mov eax, dword [ebp - 0x42c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x401e53
ja 0x401e34
cmp ax, 9
je 0x401ee3
cmp ax, 0xa
jne 0x401e83
mov eax, 0x6e5c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x401b82
mov dword [esp + 8], ebx
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msi.dll_MsiRecordSetStringW
sub esp, 0xc
test eax, eax
je 0x401cd0
xor esi, esi
test byte [section..data], 2
je 0x401a7d
mov dword [esp + 0xc], str.Failed_to_add_stream_filename_to_MSI_record._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
mov byte [edx], 0x22
lea eax, [edx + 1]
test ecx, ecx
jle 0x401c5a
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x418]
mov dword [esp], eax
call fcn.00403820
mov dword [esp + 0x10], eax
xor esi, esi
mov dword [esp + 0xc], str.Failed_to_open_destination_file__s._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
mov dword [esp + 0xc], str.Failed_to_open__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
mov eax, dword [ebp - 0x424]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x428]
mov dword [esp], eax
call sub.msi.dll_MsiViewExecute
sub esp, 8
test eax, eax
je 0x401d60
xor esi, esi
test byte [section..data], 2
je 0x401a7d
mov dword [esp + 0xc], str.Failed_to_query_stream_from__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
mov dword [esp + 0xc], str.Failed_to_create_MSI_record._n
xor esi, esi
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
mov eax, dword [ebp - 0x424]
mov dword [esp], eax
call sub.msi.dll_MsiCloseHandle
lea eax, [ebp - 0x424]
mov dword [ebp - 0x424], 0
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x428]
mov dword [esp], eax
call sub.msi.dll_MsiViewFetch
sub esp, 8
test eax, eax
jne 0x401f40
mov dword [ebp - 0x420], 0x400
lea ebx, [ebp - 0x418]
lea esi, [ebp - 0x420]
mov eax, dword [ebp - 0x424]
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebx
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msi.dll_MsiRecordReadStream
sub esp, 0x10
test eax, eax
jne 0x401fb8
lea eax, [ebp - 0x41c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x420]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x401f80
mov eax, dword [ebp - 0x420]
cmp eax, dword [ebp - 0x41c]
jne 0x401f80
cmp eax, 0x400
je 0x401db4
mov esi, 1
jmp 0x401a7d
cmp ax, 0x22
je 0x401e70
cmp ax, 0x5c
jne 0x401e83
mov ebx, 0x5c5c
add edx, 2
mov esi, ecx
mov word [edx - 2], bx
jmp 0x401b82
mov eax, CreateFileW
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x401b82
mov esi, 0x225c
add edx, 2
mov word [edx - 2], si
mov esi, ecx
jmp 0x401b82
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x401f20
mov esi, eax
mov byte [edx], 0x5c
add edx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefopen_database]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [edx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefopen_database]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefopen_database]
and esi, 0xf
mov byte [edx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefopen_database]
mov byte [edx - 1], al
mov esi, ecx
mov byte [edx - 2], bl
jmp 0x401b82
mov eax, reloc.shlwapi.dll_PathAddBackslashW
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x401b82
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.004010c0
jmp 0x401c6b
mov byte [edx], al
mov esi, ecx
add edx, 1
jmp 0x401b82
mov eax, str._null_
jmp 0x401c6b
xor esi, esi
test byte [section..data], 2
je 0x401a7d
mov dword [esp + 0xc], str.Failed_to_query_row_from__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
xor esi, esi
test byte [section..data], 2
je 0x401a7d
mov dword [esp + 0xc], str.Failed_to_write_stream_to_destination_file._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d
xor esi, esi
test byte [section..data], 2
je 0x401a7d
mov dword [esp + 0xc], str.Failed_to_read_stream_from__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call fcn.00401300
jmp 0x401a7d