Function at 0x401250
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x54c
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
call sym.___main
cmp esi, 2
jle 0x4014dc
mov eax, dword [ebx + 4]
cmp esi, 3
jne 0x4013f0
movzx edx, byte [eax]
and edx, 0xfffffffd
cmp dl, 0x2d
je 0x40156b
xor edx, edx
lea esi, [ebp - 0x41c]
mov dword [esp + 4], 0x104
mov dword [esp + 0xc], edx
mov dword [esp + 8], esi
mov dword [esp], eax
mov edi, dword [sym.imp.kernel32.dll_GetFullPathNameA]
call edi
lea eax, [ebp - 0x530]
sub esp, 0x10
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x214]
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.setupapi.dll_SetupGetFileCompressionInfoExA]
sub esp, 0x1c
test eax, eax
je 0x401513
mov edx, dword [ebx + 4]
movzx eax, byte [edx]
and eax, 0xfffffffd
cmp al, 0x2d
jne 0x401454
add edx, 1
mov dword [esp + 4], 0x40302b
mov dword [esp], edx
mov edx, dword [sym.imp.kernel32.dll_lstrcmpA]
mov dword [ebp - 0x538], edx
call edx
test eax, eax
push ecx
push ecx
mov edx, dword [ebp - 0x538]
je 0x401354
mov eax, dword [ebx + 4]
movzx ecx, byte [eax]
and ecx, 0xfffffffd
cmp cl, 0x2d
jne 0x401454
add eax, 1
mov dword [esp + 4], 0x40302d
mov dword [esp], eax
call edx
push edx
push edx
test eax, eax
jne 0x401454
mov eax, dword [ebp - 0x530]
cmp eax, 1
je 0x4016ca
cmp eax, 2
jne 0x40169c
lea eax, [ebp - 0x110]
mov byte [ebp - 0x110], 0
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], sym._set_outfile_16
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.setupapi.dll_SetupIterateCabinetA]
sub esp, 0x10
test eax, eax
je 0x40171b
lea eax, [ebp - 0x534]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x318]
mov dword [ebp - 0x538], eax
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], 0x104
call edi
mov eax, dword [ebp - 0x534]
lea ecx, [ebp - 0x110]
sub esp, 0x10
mov byte [eax], 0
mov dword [esp + 4], ecx
mov eax, dword [ebp - 0x538]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strcat]
jmp 0x40147d
xor ecx, ecx
lea esi, [ebp - 0x41c]
mov dword [esp], eax
mov edi, dword [sym.imp.kernel32.dll_GetFullPathNameA]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
mov dword [esp + 4], 0x104
call edi
lea eax, [ebp - 0x530]
sub esp, 0x10
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x214]
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.setupapi.dll_SetupGetFileCompressionInfoExA]
sub esp, 0x1c
test eax, eax
je 0x401513
lea eax, [ebp - 0x318]
xor ecx, ecx
mov dword [esp + 0xc], ecx
mov dword [ebp - 0x538], eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0x104
mov eax, dword [ebx + 8]
mov dword [esp], eax
call edi
sub esp, 0x10
mov eax, dword [ebp - 0x538]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_lstrcmpiA]
push edx
push edx
test eax, eax
je 0x401685
mov eax, dword [ebp - 0x530]
cmp eax, 1
je 0x4015d7
cmp eax, 2
je 0x40152b
xor eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x538]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_CopyFileA]
sub esp, 0xc
test eax, eax
je 0x4016b3
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.Usage:_n
call sym._myprintf
mov eax, dword [ebx]
mov dword [esp], str._t_s_infile_outfile_n
mov dword [esp + 4], eax
call sym._myprintf
mov eax, dword [ebx]
mov dword [esp], str._t_s__r_infile_n
mov dword [esp + 4], eax
call sym._myprintf
mov eax, 1
jmp 0x4014d4
mov dword [esp + 8], esi
mov eax, dword [ebx]
mov dword [esp], str._s:_cant_open_input_file__s_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
mov eax, dword [ebp - 0x538]
mov dword [esp + 8], sym._extract_callback_16
mov dword [esp], esi
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 4], eax
call dword [sym.imp.setupapi.dll_SetupIterateCabinetA]
sub esp, 0x10
test eax, eax
jne 0x4014d2
mov eax, dword [ebx]
mov dword [esp], str._s:_cabinet_extraction_failed_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
add eax, 1
mov dword [esp + 4], 0x40302b
mov esi, dword [sym.imp.kernel32.dll_lstrcmpA]
mov dword [esp], eax
call esi
push edx
push edx
test eax, eax
je 0x4015b7
mov eax, dword [ebx + 4]
movzx edx, byte [eax]
and edx, 0xfffffffd
cmp dl, 0x2d
jne 0x40128b
add eax, 1
mov dword [esp + 4], 0x40302d
mov dword [esp], eax
call esi
push esi
push esi
test eax, eax
je 0x4015b7
mov eax, dword [ebx + 4]
jmp 0x40128b
xor edi, edi
lea esi, [ebp - 0x41c]
mov dword [esp + 4], 0x104
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov eax, dword [ebx + 8]
jmp 0x4012a3
mov edx, dword [sym.imp.kernel32.dll_LZOpenFileA]
xor eax, eax
mov dword [esp], esi
mov dword [esp + 8], eax
lea eax, [ebp - 0x52c]
mov dword [esp + 4], eax
mov dword [ebp - 0x53c], edx
call edx
mov edx, dword [ebp - 0x53c]
sub esp, 0xc
test eax, eax
mov edi, eax
js 0x401513
lea eax, [ebp - 0x4a4]
mov dword [esp + 8], 0x1001
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x538]
mov dword [esp], eax
call edx
sub esp, 0xc
mov esi, eax
test eax, eax
js 0x4016f0
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_LZCopy]
push edx
push edx
mov dword [ebp - 0x538], eax
mov dword [esp], edi
mov edi, dword [sym.imp.kernel32.dll_LZClose]
call edi
push ecx
mov dword [esp], esi
call edi
push esi
mov eax, dword [ebp - 0x538]
test eax, eax
jns 0x4014d2
mov dword [esp + 8], eax
mov eax, dword [ebx]
mov dword [esp], str._s:_LZCopy_failed__error_is__d_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
mov eax, dword [ebx]
mov dword [esp], str._s:_cant_expand_file_to_itself_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
mov eax, dword [ebx]
mov dword [esp], str._s:_cant_determine_original_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
mov eax, dword [ebx]
mov dword [esp], str._s:_CopyFileA_failed_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
lea eax, [ebp - 0x110]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetExpandedNameA]
lea eax, [ebp - 0x318]
push edi
push edi
mov dword [ebp - 0x538], eax
jmp 0x40147d
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_LZClose]
push edi
mov eax, dword [ebp - 0x538]
mov dword [esp + 8], eax
mov eax, dword [ebx]
mov dword [esp], str._s:_cant_open_output_file__s_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c
mov eax, dword [ebx]
mov dword [esp], str._s:_cant_determine_original_name_n
mov dword [esp + 4], eax
call sym._myprintf
jmp 0x40150c