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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov edi, eax
mov esi, 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
cmp eax, 0xffffffff
mov ebx, eax
je 0x401b60
lea eax, [ebp - 0x428]
mov dword [esp + 4], str.SELECT_Data_FROM__Streams_WHERE_Name___
mov dword [esp + 8], eax
mov eax, dword [edi]
mov dword [esp], eax
call sym._MsiDatabaseOpenViewW_12
sub esp, 0xc
test eax, eax
je 0x401b10
xor edi, edi
test byte [0x404000], 2
jne 0x401ce0
mov eax, dword [ebp - 0x424]
test eax, eax
jne 0x401c70
mov eax, dword [ebp - 0x428]
test eax, eax
jne 0x401b50
cmp ebx, 0xffffffff
je 0x401b06
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 1
call sym._MsiCreateRecord_4
sub esp, 4
test eax, eax
mov dword [ebp - 0x424], eax
jne 0x401c80
test byte [0x404000], 2
jne 0x401e60
mov eax, dword [ebp - 0x428]
xor edi, edi
test eax, eax
je 0x401afa
lea esi, [esi]
lea edi, [edi]
mov dword [esp], eax
call sym._MsiViewClose_4
sub esp, 4
jmp 0x401af5
xor edi, edi
test byte [0x404000], 2
je 0x401add
test esi, esi
je 0x401e9a
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x401d10
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
sub esp, 8
test eax, eax
mov edx, str._invalid_
jne 0x401d25
cmp word [esi], 0
je 0x401f1e
nop
add eax, 1
cmp word [esi + eax*2], 0
jne 0x401bb0
lea edx, [ebp - 0x416]
mov byte [ebp - 0x418], 0x4c
mov byte [ebp - 0x417], 0x22
mov dword [ebp - 0x42c], ebx
lea ebx, [ebp - 0x2f6]
sub eax, 1
lea ecx, [eax + 1]
cmp edx, ebx
ja 0x401c30
test ecx, ecx
jle 0x401c30
add esi, 2
movzx ecx, word [esi - 2]
cmp cx, 0xd
je 0x401e30
ja 0x401db0
cmp cx, 9
je 0x401e50
cmp cx, 0xa
jne 0x401dd0
lea ebx, [ebp - 0x2f6]
mov byte [edx], 0x5c
mov byte [edx + 1], 0x6e
add edx, 2
sub eax, 1
cmp edx, ebx
lea ecx, [eax + 1]
jbe 0x401be4
lea esi, [esi]
test eax, eax
mov ebx, dword [ebp - 0x42c]
mov byte [edx], 0x22
jle 0x401ea4
lea eax, [edx + 4]
mov byte [edx + 1], 0x2e
mov byte [edx + 2], 0x2e
mov byte [edx + 3], 0x2e
mov byte [eax], 0
lea eax, [ebp - 0x418]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov edx, eax
jmp 0x401d25
mov dword [esp], eax
call sym._MsiCloseHandle_4
sub esp, 4
jmp 0x401aeb
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._MsiRecordSetStringW_12
sub esp, 0xc
test eax, eax
je 0x401d54
xor edi, edi
test byte [0x404000], 2
je 0x401add
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], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
mov dword [esp + 0xc], str.Failed_to_open__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf.constprop.8
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.Failed_to_open_destination_file__s._n
xor edi, edi
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
mov eax, dword [ebp - 0x424]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x428]
mov dword [esp], eax
call sym._MsiViewExecute_8
sub esp, 8
test eax, eax
je 0x401eac
xor edi, edi
test byte [0x404000], 2
je 0x401add
mov dword [esp + 0xc], str.Failed_to_query_stream_from__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
cmp cx, 0x22
je 0x401e40
cmp cx, 0x5c
jne 0x401dd0
mov byte [edx], 0x5c
mov byte [edx + 1], 0x5c
add edx, 2
jmp 0x401bd4
lea edi, [ecx - 0x20]
cmp di, 0x5e
jbe 0x401e90
mov edi, ecx
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefopen_database]
mov edi, ecx
shr di, 8
and edi, 0xf
mov byte [edx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefopen_database]
mov edi, ecx
shr di, 4
and ecx, 0xf
and edi, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefopen_database]
mov byte [edx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefopen_database]
mov byte [edx - 1], cl
mov byte [edx - 2], bl
jmp 0x401bd4
mov byte [edx], 0x5c
mov byte [edx + 1], 0x72
add edx, 2
jmp 0x401bd4
mov byte [edx], 0x5c
mov byte [edx + 1], 0x22
add edx, 2
jmp 0x401bd4
mov byte [edx], 0x5c
mov byte [edx + 1], 0x74
add edx, 2
jmp 0x401bd4
mov dword [esp + 0xc], str.Failed_to_create_MSI_record._n
mov dword [esp + 8], str.extract_stream
xor edi, edi
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
mov byte [edx], cl
add edx, 1
jmp 0x401bd4
mov edx, str._null_
jmp 0x401d25
lea eax, [edx + 1]
jmp 0x401c50
mov eax, dword [ebp - 0x424]
mov dword [esp], eax
call sym._MsiCloseHandle_4
lea eax, [ebp - 0x424]
sub esp, 4
mov dword [ebp - 0x424], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x428]
mov dword [esp], eax
call sym._MsiViewFetch_8
sub esp, 8
test eax, eax
je 0x401f25
xor edi, edi
test byte [0x404000], 2
je 0x401add
mov dword [esp + 0xc], str.Failed_to_query_row_from__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
xor eax, eax
jmp 0x401bba
mov dword [ebp - 0x420], 0x400
lea esi, [ebp - 0x418]
lea edi, [ebp - 0x420]
jmp 0x401f89
lea eax, [ebp - 0x41c]
mov dword [esp + 0x10], 0
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x420]
mov dword [esp + 8], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x401fe6
mov eax, dword [ebp - 0x420]
cmp eax, dword [ebp - 0x41c]
jne 0x401fe6
cmp eax, 0x400
jne 0x40201e
mov eax, dword [ebp - 0x424]
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._MsiRecordReadStream_16
sub esp, 0x10
test eax, eax
je 0x401f40
xor edi, edi
test byte [0x404000], 2
je 0x401add
mov dword [esp + 0xc], str.Failed_to_read_stream_from__Streams_table._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
xor edi, edi
test byte [0x404000], 2
je 0x401add
mov dword [esp + 0xc], str.Failed_to_write_stream_to_destination_file._n
mov dword [esp + 8], str.extract_stream
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.10
jmp 0x401add
mov edi, 1
jmp 0x401add