Function at 0x402140
Capabilities:
Check if file exists
Copy file
Get common file path
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x72c
mov ebx, dword [ebp + 0x10]
call dword [sym.imp.comctl32.dll_InitCommonControls]
xor eax, eax
mov word [ebp - 0x6f8], ax
test byte [section..data], 8
jne 0x4025d8
cmp word [ebx], 0
je 0x402611
mov eax, ebx
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x402180
sub eax, ebx
add eax, 2
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov edx, dword [sym.imp.kernel32.dll_HeapAlloc]
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x6fc], edx
mov dword [esp], eax
call edx
sub esp, 0xc
mov edi, eax
test eax, eax
je 0x402490
mov edx, dword [ebp - 0x6fc]
xor eax, eax
lea esi, [esi]
movzx esi, word [ebx + eax]
mov word [edi + eax], si
add eax, 2
test si, si
jne 0x4021d0
mov dword [esp + 8], 0x44
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [ebp - 0x708], eax
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edx
mov dword [ebp - 0x700], eax
sub esp, 0xc
test eax, eax
je 0x40297f
movzx edx, word [edi]
test dx, dx
je 0x4028a7
mov word [ebp - 0x70a], si
xor ebx, ebx
mov esi, edi
mov edi, edx
mov dword [ebp - 0x704], 0x10
mov dword [ebp - 0x6fc], 0
jmp 0x40226b
cmp dword [ebp - 0x6fc], 1
mov edi, esi
je 0x4023c0
lea esi, [edi + 2]
movzx edi, word [edi + 2]
test di, di
je 0x4022c0
movzx eax, di
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_iswspace]
test eax, eax
jne 0x402250
cmp di, 0x22
je 0x4024d0
mov edi, esi
mov esi, dword [ebp - 0x6fc]
test esi, esi
jne 0x40225f
mov dword [ebp - 0x6fc], 1
mov eax, dword [ebp - 0x704]
dec eax
cmp eax, ebx
jle 0x40241d
mov eax, dword [ebp - 0x700]
lea esi, [edi + 2]
mov dword [eax + ebx*4], edi
movzx edi, word [edi + 2]
inc ebx
test di, di
jne 0x40226b
mov eax, dword [ebp - 0x700]
movzx esi, word [ebp - 0x70a]
mov dword [eax + ebx*4], 0
test byte [section..data], 8
jne 0x402620
test ebx, ebx
jle 0x4023aa
mov dword [ebp - 0x704], 0
xor edi, edi
mov dword [ebp - 0x6fc], ebx
mov eax, dword [ebp - 0x700]
lea ebx, [edi*4]
mov ecx, dword [eax + edi*4]
movzx eax, word [ecx]
and eax, 0xfffffffd
cmp ax, 0x2d
je 0x402530
mov ebx, dword [ebp - 0x704]
test ebx, ebx
je 0x402858
mov ebx, dword [ebp - 0x6fc]
cmp si, 0x43
je 0x4026e0
test si, si
je 0x4027e0
lea ebx, [ebp - 0x6f8]
cmp si, 0x45
je 0x40287a
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathAddBackslashW]
sub esp, 4
cmp si, 0x42
jbe 0x4023aa
cmp si, 0x44
jne 0x4023aa
mov dword [0x403100], 1
mov eax, dword [ebp - 0x704]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], sym._ExtCabCallback_16
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._SetupIterateCabinetW_16
sub esp, 0x10
test eax, eax
jne 0x4023aa
test byte [section..data], 2
jne 0x4028d1
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
lea edi, [esi + 2]
xor eax, eax
mov word [edi - 2], ax
movzx esi, word [esi + 2]
test si, si
je 0x4022c0
movzx eax, si
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_iswspace]
test eax, eax
jne 0x402520
cmp si, 0x22
jne 0x402291
mov esi, edi
cmp word [esi + 2], 0
lea edi, [esi + 2]
je 0x4022c0
mov dword [ebp - 0x6fc], 2
mov eax, dword [ebp - 0x704]
dec eax
cmp eax, ebx
jg 0x4022aa
shl dword [ebp - 0x704], 1
mov eax, dword [ebp - 0x704]
mov dword [esp + 4], 0
lea eax, [eax*4 + 4]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x700]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x708]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
mov dword [ebp - 0x700], eax
sub esp, 0x10
test eax, eax
jne 0x4022aa
mov dword [esp + 8], edi
mov eax, dword [ebp - 0x708]
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
test byte [section..data], 2
je 0x4023aa
mov dword [esp + 0xc], str.Command_line_parsing_failed_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x4023aa
mov eax, dword [ebp - 0x6fc]
cmp eax, 1
jne 0x4024e8
xor edi, edi
mov word [esi], di
jmp 0x4023f6
cmp eax, 2
jne 0x4023f6
movzx edx, word [esi + 2]
xor eax, eax
mov word [esi], ax
test dx, dx
je 0x4022c0
movzx eax, dx
mov dword [ebp - 0x6fc], edx
lea edi, [esi + 2]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_iswspace]
test eax, eax
je 0x4025c0
mov dword [ebp - 0x6fc], 0
jmp 0x40225f
movzx eax, word [ecx + 2]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_towupper]
cmp ax, 0x4c
je 0x402809
ja 0x4025a0
cmp ax, 0x41
je 0x4026a8
lea ecx, [eax - 0x43]
cmp cx, 2
ja 0x4023aa
test si, si
jne 0x4023aa
mov esi, eax
inc edi
cmp edi, dword [ebp - 0x6fc]
jl 0x4022fb
mov edx, dword [ebp - 0x704]
mov ebx, dword [ebp - 0x6fc]
test edx, edx
jne 0x40232f
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
cmp ax, 0x59
jne 0x4023aa
mov dword [0x403048], 1
jmp 0x40256b
mov edx, dword [ebp - 0x6fc]
cmp dx, 0x22
jne 0x402291
jmp 0x4023f4
mov eax, ebx
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0xc], str.cmdline:__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.get_extrac_args
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
cmp word [ebx], 0
jne 0x402175
mov eax, 2
jmp 0x40218e
mov dword [esp], section..data
call sym.___wine_dbg_get_channel_flags
test al, 8
je 0x4022e1
test ebx, ebx
jle 0x4023aa
mov word [ebp - 0x6fc], si
xor edi, edi
mov esi, ebx
mov ebx, dword [ebp - 0x700]
jmp 0x402655
inc edi
cmp edi, esi
je 0x402697
test byte [section..data], 8
je 0x402650
mov eax, dword [ebx + edi*4]
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x10], edi
inc edi
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], str.arg__d:__s_n
mov dword [esp + 8], str.get_extrac_args
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
cmp edi, esi
jne 0x402655
mov ebx, esi
movzx esi, word [ebp - 0x6fc]
jmp 0x4022e9
test byte [section..data], 1
je 0x40256b
mov dword [esp + 0xc], str._A_not_implemented_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x40256b
lea eax, [edi + 1]
cmp eax, ebx
jne 0x4023aa
mov eax, dword [ebp - 0x700]
lea ebx, [ebp - 0x6f8]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x104
mov eax, dword [eax + edi*4]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub esp, 0x10
test eax, eax
je 0x4023aa
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathAddBackslashW]
sub esp, 4
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathIsDirectoryW]
sub esp, 4
test eax, eax
jne 0x402909
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathFileExistsW]
sub esp, 4
test eax, eax
je 0x4027aa
mov eax, dword [0x403048]
test eax, eax
jne 0x4027aa
lea esi, [ebp - 0x2e8]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.Overwrite___s__
mov dword [esp + 4], 0x168
mov dword [esp], esi
call sym._swprintf.constprop.0
mov dword [esp + 0xc], 0x34
mov dword [esp + 8], str.Extract
mov dword [esp + 4], esi
mov dword [esp], 0
call dword [sym.imp.user32.dll_MessageBoxW]
sub esp, 0x10
cmp eax, 6
jne 0x4023aa
test byte [section..data], 8
jne 0x40293a
mov eax, dword [ebp - 0x704]
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CopyFileW]
sub esp, 0xc
jmp 0x4023aa
cmp ebx, edi
jle 0x402863
cmp word [ebp - 0x6f8], 0
je 0x402888
lea ebx, [ebp - 0x6f8]
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathAddBackslashW]
sub esp, 4
jmp 0x402374
inc edi
cmp edi, dword [ebp - 0x6fc]
jge 0x4023aa
lea eax, [ebp - 0x6f8]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x700]
mov dword [esp + 4], 0x104
mov eax, dword [eax + ebx + 4]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub esp, 0x10
test eax, eax
jne 0x40256b
jmp 0x4023aa
mov dword [ebp - 0x704], ecx
jmp 0x40256b
lea ebx, [ebp - 0x6f8]
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathAddBackslashW]
sub esp, 4
jmp 0x40236a
cmp word [ebp - 0x6f8], 0
jne 0x4027f8
lea ebx, [ebp - 0x6f8]
mov dword [esp], 0x104
mov dword [esp + 4], ebx
call dword [sym.imp.kernel32.dll_GetCurrentDirectoryW]
sub esp, 8
jmp 0x4027f8
mov eax, dword [ebp - 0x700]
mov dword [eax], 0
test byte [section..data], 8
je 0x4023aa
mov dword [esp], section..data
call sym.___wine_dbg_get_channel_flags
jmp 0x4023aa
mov eax, dword [ebp - 0x704]
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0xc], str.Could_not_extract_cab_file__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.extract
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x4023aa
mov eax, dword [ebp - 0x704]
mov dword [esp], eax
call dword [sym.imp.shlwapi.dll_PathFindFileNameW]
sub esp, 4
mov dword [esp + 4], ebx
lea ebx, [ebp - 0x4f0]
mov dword [esp + 8], eax
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathCombineW]
sub esp, 0xc
jmp 0x402742
mov eax, ebx
call sym._wine_dbgstr_wn.constprop.0
mov esi, eax
mov eax, dword [ebp - 0x704]
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.copying__s_to__s_n
mov dword [esp + 8], str.copy_file
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4027b7
mov dword [esp + 8], edi
jmp 0x402470