Function at 0x402890
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x2778
call fcn.00404890
mov eax, dword [ebp - 0x10]
mov esi, edx
mov dword [esp], edx
mov dword [ebp - 0x276c], eax
mov dword [ebp - 0x1c], 0
call sub.cygwin1.dll_fileno
mov dword [esp + 4], 0x10000
mov dword [esp], eax
call sub.cygwin1.dll_setmode
add eax, 1
je case.0x402d02.6
mov eax, dword [ebp - 0x276c]
mov dword [esp], eax
call sub.cygwin1.dll_fileno
mov dword [esp + 4], 0x10000
mov dword [esp], eax
call sub.cygwin1.dll_setmode
add eax, 1
je case.0x402d02.6
mov eax, dword [0x4089d8]
sub eax, 2
cmp eax, 1
jbe 0x402a80
fldz
fstp qword [ebp - 0x2758]
test byte [esi + 0xc], 0x40
jne case.0x402d02.6
mov eax, dword [ebp - 0x276c]
test byte [eax + 0xc], 0x40
je 0x402923
call fcn.00401a60
lea eax, [ebp - 0x24]
mov dword [esp], eax
call sub.cygwin1.dll_time
mov dword [ebp - 0x275c], 0
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x2738]
mov dword [esp + 0x10], edx
lea edx, [ebp - 0x14]
mov dword [esp], edx
mov dword [esp + 0x14], eax
movzx eax, byte [0x409239]
mov dword [esp + 0xc], eax
mov eax, dword [0x4089d0]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x276c]
mov dword [esp + 4], eax
call sub.cygbz2_1.dll_BZ2_bzReadOpen
test eax, eax
mov edi, eax
je 0x402cde
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x402cde
add dword [ebp - 0x275c], 1
jmp 0x4029b3
cmp edx, 4
je 0x4029e4
test byte [esi + 0xc], 0x40
jne case.0x402d02.6
mov eax, dword [0x4089d8]
sub eax, 2
cmp eax, 1
jbe 0x402a08
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x402b70
lea edx, [ebp - 0x14]
lea eax, [ebp - 0x13b0]
mov dword [esp], edx
mov dword [esp + 0xc], 0x1388
mov dword [esp + 8], eax
mov dword [esp + 4], edi
call sub.cygbz2_1.dll_BZ2_bzRead
mov edx, dword [ebp - 0x14]
cmp edx, 0xfffffffb
je 0x402cd1
test edx, edx
jne 0x402990
test eax, eax
jle 0x402995
mov dword [esp + 8], eax
lea eax, [ebp - 0x13b0]
mov dword [esp + 0xc], esi
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.cygwin1.dll_fwrite
jmp 0x402995
cmp byte [0x40818c], 1
jne 0x4029a8
lea edx, [ebp - 0x28]
mov dword [esp], edx
call sub.cygwin1.dll_time
mov eax, dword [ebp - 0x28]
sub eax, dword [ebp - 0x24]
sub eax, 1
jle 0x4029a8
mov eax, dword [ebp - 0x276c]
mov dword [esp], eax
call sub.cygwin1.dll__ftello64
mov dword [ebp - 0x2768], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x2764], edx
mov dword [ebp - 0x24], eax
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._.2f___done_r
fild qword [ebp - 0x2768]
fmul dword [0x406cd8]
fdiv qword [ebp - 0x2758]
fstp qword [esp + 8]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x4029a8
cmp byte [0x40818c], 1
jne 0x402904
mov edx, dword [ebp - 0x276c]
mov dword [esp], edx
call sub.cygwin1.dll__ftello64
mov dword [esp + 0xc], 2
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov dword [ebp - 0x2750], eax
mov eax, dword [ebp - 0x276c]
mov dword [ebp - 0x274c], edx
mov dword [esp], eax
call sub.cygwin1.dll__fseeko64
mov edx, dword [ebp - 0x276c]
mov dword [esp], edx
call sub.cygwin1.dll__ftello64
push edx
mov edx, dword [ebp - 0x274c]
push eax
mov eax, dword [ebp - 0x2750]
fild qword [esp]
add esp, 8
fstp qword [ebp - 0x2758]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x276c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.cygwin1.dll__fseeko64
mov edx, dword [0x4089d0]
test edx, edx
jle 0x40290c
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str.Input_file_size:__ld_n
fnstcw word [ebp - 0x2742]
fld qword [ebp - 0x2758]
movzx edx, word [ebp - 0x2742]
mov dh, 0xc
mov word [ebp - 0x2744], dx
fldcw word [ebp - 0x2744]
fistp dword [esp + 8]
fldcw word [ebp - 0x2742]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x40290c
cmp eax, 4
jne 0x402cde
lea eax, [ebp - 0x1c]
mov dword [esp + 0xc], eax
lea edx, [ebp - 0x14]
lea eax, [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], edx
call sub.cygbz2_1.dll_BZ2_bzReadGetUnused
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x402e9f
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x20]
test ecx, ecx
jle 0x402bc2
xor edx, edx
lea esi, [esi]
movzx eax, byte [ebx + edx]
mov byte [ebp + edx - 0x2738], al
add edx, 1
cmp edx, ecx
jl 0x402bb0
lea eax, [ebp - 0x14]
mov dword [esp], eax
mov dword [esp + 4], edi
call sub.cygbz2_1.dll_BZ2_bzReadClose
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x402e9f
mov eax, dword [ebp - 0x1c]
test eax, eax
jne 0x402938
mov eax, dword [ebp - 0x276c]
call fcn.00401a20
test al, al
je 0x402938
mov edx, dword [ebp - 0x276c]
test byte [edx + 0xc], 0x40
jne case.0x402d02.6
call sub.cygwin1.dll___getreent
cmp dword [eax + 8], esi
je 0x402c2b
mov dword [esp], esi
call sub.cygwin1.dll_fileno
test eax, eax
nop
js case.0x402d02.6
call fcn.00401ab0
mov eax, dword [ebp - 0x276c]
mov dword [esp], eax
call sub.cygwin1.dll_fclose
add eax, 1
je case.0x402d02.6
test byte [esi + 0xc], 0x40
jne case.0x402d02.6
mov dword [esp], esi
nop
call sub.cygwin1.dll_fflush
test eax, eax
jne case.0x402d02.6
call sub.cygwin1.dll___getreent
cmp dword [eax + 8], esi
je 0x402c82
mov dword [esp], esi
call sub.cygwin1.dll_fclose
mov dword [0x409234], 0
add eax, 1
je case.0x402d02.6
cmp dword [0x4089d0], 1
mov dword [0x409234], 0
jle 0x402d8a
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 5
mov dword [esp + 4], 1
mov dword [esp], str._n
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
mov eax, 1
add esp, 0x277c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp byte [0x4089ca], 0
jne 0x402de5
lea eax, [ebp - 0x18]
mov dword [esp], eax
mov dword [esp + 4], edi
call sub.cygbz2_1.dll_BZ2_bzReadClose
mov eax, dword [ebp - 0x14]
add eax, 9
cmp eax, 6
jbe switch.0x00402d02
mov eax, str.decompress:unexpected_error
call fcn.004017a0
jmp dword [eax*4 + 0x406788]
call fcn.00401600
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._n_s:_Data_integrity_error_when_decompressing._n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
call fcn.004012b0
call fcn.00401340
mov eax, 2
call fcn.00401410
call sub.cygwin1.dll___getreent
mov edx, dword [ebp - 0x276c]
cmp dword [eax + 4], edx
je 0x402d5c
mov dword [esp], edx
call sub.cygwin1.dll_fclose
call sub.cygwin1.dll___getreent
cmp dword [eax + 8], esi
je 0x402d6e
mov dword [esp], esi
call sub.cygwin1.dll_fclose
xor eax, eax
cmp dword [ebp - 0x275c], 1
je 0x402cc6
cmp byte [0x4085b0], 0
jne 0x402e6b
mov eax, 1
jmp 0x402cc6
call fcn.004012f0
cmp byte [0x4085b0], 0
je 0x402ddb
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._n_s:_Compressed_file_ends_unexpectedly__n_tperhaps_it_is_corrupted___Possible_reason_follows._n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov eax, dword [0x4089dc]
mov dword [esp], eax
call sub.cygwin1.dll_perror
call fcn.004012b0
call fcn.00401340
mov eax, 2
call fcn.00401410
mov edx, dword [ebp - 0x276c]
mov dword [esp], edx
call sub.cygwin1.dll_rewind
mov eax, dword [ebp - 0x276c]
call fcn.00401a20
test al, al
jne 0x402bfa
mov eax, dword [ebp - 0x276c]
lea edx, [ebp - 0x13b0]
mov dword [esp], edx
mov dword [esp + 8], 0x1388
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fread
mov edx, dword [ebp - 0x276c]
test byte [edx + 0xc], 0x40
jne case.0x402d02.6
test eax, eax
jle 0x402e60
mov dword [esp + 8], eax
lea eax, [ebp - 0x13b0]
mov dword [esp + 0xc], esi
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.cygwin1.dll_fwrite
test byte [esi + 0xc], 0x40
je 0x402df3
jmp case.0x402d02.6
mov ebx, dword [0x4089dc]
call sub.cygwin1.dll___getreent
mov dword [esp + 0xc], 0x4085c0
mov dword [esp + 4], str._n_s:__s:_trailing_garbage_after_EOF_ignored_n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov eax, 1
jmp 0x402cc6
mov eax, str.decompress:bzReadGetUnused
call fcn.004017a0
lea esi, [esi]