Function at 0x402160
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0xec
test eax, eax
mov byte [0x408180], 0
je 0x4022c5
mov eax, dword [0x4089d8]
cmp eax, 2
je 0x4022f5
cmp eax, 3
je 0x402230
sub eax, 1
je 0x4022d2
cmp dword [0x4089d8], 1
je 0x4021b8
mov eax, 0x4085c0
call fcn.00401930
test al, al
je 0x4023c5
xor ebx, ebx
lea esi, [esi]
mov esi, dword [ebx*4 + 0x40500c]
mov eax, 0x4085c0
mov edx, esi
call fcn.00401260
test al, al
jne 0x4022a0
add ebx, 1
cmp ebx, 4
jne 0x4021c0
mov eax, dword [0x4089d8]
sub eax, 2
cmp eax, 1
jbe 0x402603
cmp dword [0x4089d8], 3
je 0x4024e4
mov eax, dword [0x4089d8]
cmp eax, 2
je 0x402375
cmp eax, 3
je 0x40241d
sub eax, 1
je 0x402573
mov eax, str.compress:_bad_srcMode
call fcn.004017a0
nop
lea esi, [esi]
mov edx, ebx
mov eax, 0x4085c0
call fcn.00401380
mov edx, ebx
mov eax, 0x408e20
call fcn.00401380
mov ecx, 0x408e20
mov eax, dword [ecx]
add ecx, 4
lea edx, [eax - 0x1010101]
not eax
and edx, eax
and edx, 0x80808080
je 0x40224d
mov eax, edx
shr eax, 0x10
test edx, 0x8080
cmove edx, eax
lea eax, [ecx + 2]
cmove ecx, eax
add dl, dl
sbb ecx, 3
sub ecx, 0x408e20
mov dword [ecx + 0x408e20], 0x327a622e
mov byte [ecx + 0x408e24], 0
jmp 0x40219d
cmp byte [0x4085b0], 0
jne 0x402540
mov eax, dword [0x408184]
test eax, eax
jle 0x402360
add esp, 0xec
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [0x4089d8], 1
jne 0x402668
mov edx, str._stdin_
mov eax, 0x4085c0
call fcn.00401380
mov edx, str._stdout_
mov eax, 0x408e20
call fcn.00401380
jmp 0x40219d
mov edx, ebx
jmp 0x4022d7
movzx eax, word [ebp - 0xbc]
lea edi, [eax - 1]
test edi, edi
jle 0x4026fc
cmp edi, 1
mov eax, 0x4065b1
mov esi, dword [0x4089dc]
mov ebx, 0x4065b0
cmovne ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 8], esi
mov dword [esp + 4], str._s:_Input_file__s_has__d_other_link_s._n
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov eax, dword [0x408184]
test eax, eax
jg 0x4022ba
lea esi, [esi]
mov dword [0x408184], 1
add esp, 0xec
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x4063d6
mov dword [esp], 0x4085c0
call sub.cygwin1.dll__fopen64
mov dword [ebp - 0xd4], eax
call sub.cygwin1.dll___getreent
mov edi, dword [eax + 8]
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_fileno
mov dword [esp], eax
call sub.cygwin1.dll_isatty
test eax, eax
jne 0x402747
mov esi, dword [ebp - 0xd4]
test esi, esi
jne 0x40245e
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov esi, dword [0x4089dc]
mov ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 8], esi
mov dword [esp + 4], str._s:_Cant_open_input_file__s:__s._n
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ebx, dword [0x408184]
test ebx, ebx
jle 0x402360
add esp, 0xec
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x4063d6
mov dword [esp], 0x4085c0
call sub.cygwin1.dll__fopen64
mov edx, 0x406632
mov dword [ebp - 0xd4], eax
mov eax, 0x408e20
call fcn.00401960
test eax, eax
mov edi, eax
je 0x4027e9
mov edx, dword [ebp - 0xd4]
test edx, edx
je 0x40283b
mov eax, dword [0x4089d0]
test eax, eax
jle 0x4024a1
call sub.cygwin1.dll___getreent
mov dword [esp + 8], 0x4085c0
mov dword [esp + 4], str.___s:
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov eax, 0x4085c0
call fcn.004019c0
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fflush
mov eax, dword [ebp - 0xd4]
mov edx, edi
mov dword [0x409234], edi
mov byte [0x408180], 1
call fcn.00401b00
cmp dword [0x4089d8], 3
mov dword [0x409234], 0
je 0x402710
mov byte [0x408180], 0
add esp, 0xec
pop ebx
pop esi
pop edi
pop ebp
ret
cmp byte [0x4089ca], 0
je 0x402672
mov eax, 0x408e20
call fcn.00401930
test al, al
jne 0x40264a
cmp dword [0x4089d8], 3
jne 0x402201
cmp byte [0x4089ca], 0
je 0x4026de
mov dword [esp + 4], 0x408020
mov dword [esp], 0x4085c0
call sub.cygwin1.dll__stat64
test eax, eax
je 0x402201
call fcn.00401a60
nop
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 8], ebx
mov dword [esp + 4], str._s:_Input_file__s_already_has__s_suffix._n
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x4022ad
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 4]
mov dword [ebp - 0xd4], eax
call sub.cygwin1.dll___getreent
mov edi, dword [eax + 8]
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_fileno
mov dword [esp], eax
call sub.cygwin1.dll_isatty
test eax, eax
je 0x40245e
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._s:_I_wont_write_compressed_data_to_a_terminal._n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._s:_For_help__type:___s___help._n
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov eax, dword [0x408184]
test eax, eax
jg 0x4022ba
jmp 0x402360
lea eax, [ebp - 0x70]
mov dword [esp + 4], eax
mov dword [esp], 0x4085c0
call sub.cygwin1.dll__stat64
mov eax, dword [ebp - 0x60]
and eax, 0xf000
cmp eax, 0x4000
jne 0x4021f4
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 4], str._s:_Input_file__s_is_a_directory._n
mov dword [esp + 8], ebx
jmp 0x4025e6
cmp byte [0x4089ca], 0
je 0x4027c5
mov dword [esp], 0x408e20
call sub.cygwin1.dll_remove
jmp 0x402503
mov eax, str.compress:_bad_modes_n
call fcn.004017a0
lea eax, [ebp - 0xd0]
mov dword [esp + 4], eax
mov dword [esp], 0x4085c0
call sub.cygwin1.dll__lstat64
test eax, eax
jne 0x4026a2
mov eax, dword [ebp - 0xc0]
and eax, 0xf000
cmp eax, 0x8000
je 0x4027b0
cmp byte [0x4085b0], 0
je 0x4022ad
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 4], str._s:_Input_file__s_is_not_a_normal_file._n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x4022ad
lea eax, [ebp - 0xd0]
mov dword [esp + 4], eax
mov dword [esp], 0x4085c0
call sub.cygwin1.dll__lstat64
test eax, eax
je 0x4022f9
cmp dword [0x4089d8], 3
je 0x40251d
jmp 0x402201
mov eax, 0x408e20
call fcn.00402120
cmp byte [0x409238], 0
mov byte [0x408180], 0
jne 0x4024d2
mov dword [esp], 0x4085c0
call sub.cygwin1.dll_remove
test eax, eax
je 0x4024d2
jmp 0x402539
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._s:_I_wont_write_compressed_data_to_a_terminal._n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._s:_For_help__type:___s___help._n
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov edi, dword [ebp - 0xd4]
test edi, edi
je 0x4022ad
mov eax, dword [ebp - 0xd4]
mov dword [esp], eax
call sub.cygwin1.dll_fclose
jmp 0x4022ad
cmp dword [0x4089d8], 3
jne 0x402201
lea esi, [esi]
jmp 0x4024f1
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 0xc], 0x408e20
mov dword [esp + 4], str._s:_Output_file__s_already_exists._n
mov dword [esp + 8], ebx
jmp 0x4025e6
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov esi, dword [0x4089dc]
mov ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x408e20
mov dword [esp + 8], esi
mov dword [esp + 4], str._s:_Cant_create_output_file__s:__s._n
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ecx, dword [ebp - 0xd4]
test ecx, ecx
jne 0x40279d
jmp 0x4022ad
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov esi, dword [0x4089dc]
mov ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 8], esi
mov dword [esp + 4], str._s:_Cant_open_input_file__s:__s._n
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov dword [esp], edi
call sub.cygwin1.dll_fclose
jmp 0x4022ad