Function at 0x401ba0
Capabilities:
Get common file path
Get file size
Read file on windows

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x1044
call fcn.00402828
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x1030], edx
lea edx, [ebp - 0x1024]
mov dword [ebp - 0x1034], ecx
mov ebx, eax
mov dword [ebp - 0x101c], 0
call fcn.00401340
test eax, eax
je 0x401520
lea esp, [ebp - 0xc]
mov ebx, 1
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov eax, dword [ebp - 0x1024]
mov dword [esp], eax
call sub.msi.dll_MsiCloseHandle
lea eax, [ebp - 0x1020]
sub esp, 4
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x10012
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.ole32.dll_StgOpenStorage]
sub esp, 0x18
mov esi, eax
test eax, eax
jne 0x4016b0
mov eax, dword [ebp - 0x1030]
movzx ebx, word [eax]
test bx, bx
je 0x401780
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x401588
sub eax, dword [ebp - 0x1030]
cmp eax, 0x3e
ja 0x4016f8
mov esi, eax
add eax, 4
mov dword [esp], eax
sar esi, 1
call dword [sym.imp.ucrtbase.dll_malloc]
mov dword [ebp - 0x1038], eax
test eax, eax
je 0x4016f8
mov eax, dword [ebp - 0x1030]
mov edx, dword [ebp - 0x1038]
add esi, 1
mov dword [ebp - 0x1028], eax
lea esi, [esi]
nop
mov eax, dword [ebp - 0x1028]
lea ecx, [eax + 2]
movzx eax, bx
test eax, eax
je 0x40179d
cmp eax, 0x7f
ja 0x401690
lea edi, [eax - 0x30]
cmp edi, 9
jbe 0x401770
lea edi, [eax - 0x41]
cmp edi, 0x19
jbe 0x401840
lea edi, [eax - 0x61]
cmp edi, 0x19
jbe 0x401868
cmp bx, 0x2e
je 0x401b00
cmp eax, 0x5f
jne 0x401690
mov edi, 0x483f
mov eax, dword [ebp - 0x1028]
movzx eax, word [eax + 2]
lea ebx, [eax - 1]
cmp ebx, 0x7e
ja 0x401760
lea ebx, [eax - 0x30]
cmp ebx, 9
jbe 0x401853
lea ebx, [eax - 0x41]
cmp ebx, 0x19
jbe 0x401850
lea ebx, [eax - 0x61]
cmp ebx, 0x19
jbe 0x401a98
cmp eax, 0x2e
je 0x401b93
mov ebx, 0xffffffc0
cmp eax, 0x5f
jne 0x401760
mov ecx, dword [ebp - 0x1028]
add ebx, edi
add ecx, 4
lea esi, [esi]
add edx, 2
mov word [edx - 2], bx
test esi, esi
je 0x401a18
mov dword [ebp - 0x1028], ecx
movzx ebx, word [ecx]
sub esi, 1
jmp 0x4015d8
test byte [section..data], 4
je 0x401508
mov eax, ebx
call fcn.00401060
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_open_storage__s__0x_08lx__n
mov dword [esp + 8], str.add_stream
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401508
mov esi, dword [sym.imp.ucrtbase.dll_free]
mov dword [ebp - 0x1038], 0
mov ebx, 1
test byte [section..data], 4
jne 0x401a59
lea esi, [esi]
mov eax, dword [ebp - 0x1038]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x101c]
test eax, eax
je 0x401740
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [ebp - 0x1020]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov eax, ebx
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov ebx, edi
jmp 0x401690
lea edi, [eax + 0x47d0]
jmp 0x40162d
mov dword [esp], 4
call dword [sym.imp.ucrtbase.dll_malloc]
mov edx, eax
test eax, eax
je 0x4016f8
mov dword [ebp - 0x1038], eax
mov eax, dword [ebp - 0x1020]
xor ecx, ecx
mov edi, dword [ebp - 0x1038]
mov word [edx], cx
lea ecx, [ebp - 0x101c]
mov edx, dword [eax]
mov dword [esp + 4], edi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1011
mov dword [esp], eax
call dword [edx + 0xc]
sub esp, 0x18
mov edi, eax
test eax, eax
je 0x401878
mov esi, dword [sym.imp.ucrtbase.dll_free]
mov ebx, 1
test byte [section..data], 4
je 0x401720
mov eax, dword [ebp - 0x1038]
call fcn.00401060
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_create_stream__s__0x_08lx__n
mov dword [esp + 8], str.add_stream
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401720
lea edi, [eax + 0x47c9]
jmp 0x40162d
lea ebx, [eax - 0x37]
add ebx, 0x3ffffc0
shl ebx, 6
jmp 0x40167e
lea edi, [eax + 0x47c3]
jmp 0x40162d
mov eax, dword [ebp - 0x1034]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x401aa0
lea eax, [ebp - 0x1018]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
cmp eax, 0xffffffff
je 0x401a30
mov edx, dword [ebp - 0x1018]
test edx, edx
jne 0x401a30
mov ecx, eax
mov eax, dword [ebp - 0x101c]
xor ebx, ebx
mov dword [ebp - 0x1030], ecx
mov edx, dword [eax]
mov dword [ebp - 0x102c], ebx
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
test eax, eax
jne 0x401b0a
mov dword [ebp - 0x1028], esi
mov ebx, dword [ebp - 0x1030]
lea edi, [ebp - 0x1010]
mov dword [ebp - 0x1034], eax
mov esi, dword [ebp - 0x102c]
jmp 0x401983
mov eax, dword [ebp - 0x1014]
test eax, eax
je 0x4019b7
mov edx, dword [ebp - 0x101c]
mov ecx, dword [edx]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], edx
call dword [ecx + 0x10]
sub esp, 0x10
test eax, eax
jne 0x4019b7
mov eax, dword [ebp - 0x1014]
xor edx, edx
sub ebx, eax
sbb esi, edx
lea eax, [ebp - 0x1014]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1028]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x401948
mov dword [ebp - 0x102c], esi
mov esi, dword [ebp - 0x1028]
mov dword [ebp - 0x1030], ebx
mov ebx, dword [ebp - 0x1034]
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, dword [ebp - 0x1030]
mov edi, dword [ebp - 0x102c]
sub esp, 4
or edi, eax
jne 0x401b52
mov eax, dword [ebp - 0x1020]
mov edx, dword [eax]
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x24]
mov esi, dword [sym.imp.ucrtbase.dll_free]
sub esp, 8
jmp 0x401720
mov eax, dword [ebp - 0x1038]
mov esi, dword [sym.imp.ucrtbase.dll_free]
mov dword [esp], eax
call esi
jmp 0x4016fe
test byte [section..data], 4
jne 0x401b1a
mov dword [esp], esi
mov ebx, 1
call dword [sym.imp.kernel32.dll_CloseHandle]
mov esi, dword [sym.imp.ucrtbase.dll_free]
sub esp, 4
jmp 0x401720
mov eax, dword [ebp - 0x1030]
call fcn.00401060
mov dword [esp + 0xc], str.failed_to_encode_stream_name__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.add_stream
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401720
lea ebx, [eax - 0x3d]
jmp 0x401853
mov esi, dword [sym.imp.ucrtbase.dll_free]
mov ebx, 1
test byte [section..data], 4
je 0x401720
mov eax, dword fs:[0x18]
mov edi, dword [eax + 0x34]
mov eax, dword [ebp - 0x1034]
call fcn.00401060
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_open_file__s___lu__n
mov dword [esp + 8], str.add_stream
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401720
mov edi, 0x483e
jmp 0x40162d
mov esi, dword [sym.imp.ucrtbase.dll_free]
mov ebx, 1
jmp 0x401720
mov eax, dword [ebp - 0x1034]
call fcn.00401060
mov dword [esp + 0xc], str.file__s_too_big_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.add_stream
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401a3d
mov esi, dword [sym.imp.ucrtbase.dll_free]
mov ebx, 1
test byte [section..data], 4
je 0x401720
mov dword [esp + 0xc], str.failed_to_write_stream_contents_n
mov dword [esp + 8], str.add_stream
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401720
mov ebx, 0xffffff80
jmp 0x40167e
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x28
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
cmp eax, 2
jle 0x401bbd
mov edx, dword [ebx + 4]
cmp word [edx], 0x2d
je 0x401be0
mov dword [esp], str.Usage:_winemsibuilder__OPTION___MSIFILE__..._nOptions:_n___i_package.msi_table1.idt__table2.idt_..._____Import_one_or_more_tables_into_the_database._n___a_package.msi_stream_file____________________Add_stream_to_storage_with_contents_of_file._n_nExisting_tables_or_streams_will_be_overwritten._If_package.msi_does_not_exist_a_new_file_nwill_be_created_with_an_empty_database._n
call fcn.004014a0
mov edx, 1
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
movzx edx, word [edx + 2]
cmp dx, 0x61
je 0x401d20
cmp dx, 0x69
jne 0x401ce0
cmp eax, 3
je 0x401bbd
mov eax, dword [ebx + 8]
lea edx, [ebp - 0x10]
call fcn.00401340
mov edx, 1
test eax, eax
jne 0x401bce
mov dword [ebp - 0x1c], edx
mov edi, dword [sym.imp.kernel32.dll_GetCurrentDirectoryW]
mov dword [esp + 4], 0
mov dword [esp], 0
call edi
lea ecx, [eax + 1]
sub esp, 8
lea eax, [ecx + ecx]
mov dword [ebp - 0x18], ecx
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_malloc]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x1c]
mov esi, eax
mov eax, dword [ebp - 0x10]
test esi, esi
mov dword [ebp - 0x14], eax
je 0x401ddb
mov dword [esp + 4], esi
mov dword [esp], ecx
call edi
mov eax, dword [ebx + 0xc]
sub esp, 8
test eax, eax
je 0x401d40
lea edi, [ebx + 0xc]
jmp 0x401c86
mov eax, dword [edi + 4]
add edi, 4
test eax, eax
je 0x401d40
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.msi.dll_MsiDatabaseImportW
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x401c78
mov edx, 1
test byte [section..data], 2
jne 0x401d9d
mov dword [ebp - 0x18], edx
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_free]
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sub.msi.dll_MsiCloseHandle
mov edx, dword [ebp - 0x18]
sub esp, 4
jmp 0x401bce
test byte [section..data], 4
je 0x401bbd
mov dword [esp + 0xc], str.unknown_option_n
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004012f0
jmp 0x401bbd
cmp eax, 4
jle 0x401bbd
mov ecx, dword [ebx + 0x10]
mov edx, dword [ebx + 0xc]
mov eax, dword [ebx + 8]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp 0x4014c0
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sub.msi.dll_MsiDatabaseCommit
xor edx, edx
sub esp, 4
test eax, eax
je 0x401cb4
mov edx, 1
test byte [section..data], 2
je 0x401cb4
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_commit_changes___u__n
mov dword [esp + 8], str.import_tables
mov dword [esp + 4], 0x403000
mov dword [esp], 1
mov dword [ebp - 0x18], edx
call fcn.004012f0
mov edx, dword [ebp - 0x18]
jmp 0x401cb4
mov eax, dword [edi]
mov dword [ebp - 0x18], edx
call fcn.00401060
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_import_table__s___u__n
mov dword [esp + 8], str.import_tables
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call fcn.004012f0
mov edx, dword [ebp - 0x18]
jmp 0x401cb4
mov dword [esp], eax
mov dword [ebp - 0x18], edx
call sub.msi.dll_MsiCloseHandle
mov edx, dword [ebp - 0x18]
push eax
jmp 0x401bce