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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [0x4110f0]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x18
mov dword [esp + 4], 1
mov dword [esp], 0x411080
call sym._fread
cmp eax, 0x18
je 0x4013f7
mov dword [esp], str.file_read_error_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
cmp byte [0x411080], 0x43
jne 0x401433
cmp byte [0x411081], 0x49
jne 0x401433
cmp byte [0x411082], 0x53
jne 0x401433
cmp byte [0x411083], 0x4f
jne 0x401433
cmp dword [0x411090], 0
je 0x401433
mov eax, dword [0x411088]
or eax, dword [0x41108c]
test eax, eax
jne 0x40144b
mov dword [esp], str.ciso_file_format_error_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov eax, dword [0x411090]
mov edx, 0
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [0x411088]
mov edx, dword [0x41108c]
mov dword [esp], eax
mov dword [esp + 4], edx
call sym.___udivdi3
mov dword [0x411110], eax
mov eax, dword [0x411110]
shl eax, 2
add eax, 4
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sym._malloc
mov dword [0x411010], eax
mov eax, dword [0x411090]
mov dword [esp], eax
call sym._malloc
mov dword [0x411018], eax
mov eax, dword [0x411090]
add eax, eax
mov dword [esp], eax
call sym._malloc
mov dword [0x41101c], eax
cmp dword [0x411010], 0
je 0x4014d8
cmp dword [0x411018], 0
je 0x4014d8
cmp dword [0x41101c], 0
jne 0x4014f0
mov dword [esp], str.Cant_allocate_memory_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov eax, dword [ebp - 0x28]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [0x411010]
mov dword [esp], eax
call sym._memset
mov eax, dword [0x4110f0]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x411010]
mov dword [esp], eax
call sym._fread
cmp eax, dword [ebp - 0x28]
je 0x40154e
mov dword [esp], str.file_read_error_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov eax, dword [0x4110e0]
mov dword [esp + 8], eax
mov eax, dword [0x411070]
mov dword [esp + 4], eax
mov dword [esp], str.Decompress__s_to__s_n
call sym._printf
mov eax, dword [0x411088]
mov edx, dword [0x41108c]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp], str.Total_File_Size__ld_bytes_n
call sym._printf
mov eax, dword [0x411090]
mov dword [esp + 4], eax
mov dword [esp], str.block_size_______d__bytes_n
call sym._printf
mov eax, dword [0x411110]
mov dword [esp + 4], eax
mov dword [esp], str.total_blocks_____d__blocks_n
call sym._printf
movzx ecx, byte [0x411095]
mov eax, 1
shl eax, cl
mov dword [esp + 4], eax
mov dword [esp], str.index_align______d_n
call sym._printf
mov dword [0x4110c0], 0
mov dword [0x4110c4], 0
mov dword [0x4110c8], 0
mov ecx, dword [0x411110]
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov eax, edx
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0x2c]
cmp eax, dword [0x411110]
jge 0x40195a
lea eax, [ebp - 0x40]
dec dword [eax]
cmp dword [ebp - 0x40], 0
jg 0x401662
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x40], eax
mov edx, dword [ebp - 0x2c]
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x5c], eax
mov eax, edx
mov ecx, dword [ebp - 0x5c]
cdq
idiv dword [ecx]
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], eax
mov dword [esp], str.decompress__d___r
call sym._printf
mov dword [esp + 0xc], 0x38
mov dword [esp + 8], 0x40d0d0
mov dword [esp + 4], 0xfffffff1
mov dword [esp], 0x4110a0
call sym._inflateInit2_
test eax, eax
je 0x4016c2
mov ecx, dword [0x4110b8]
mov dword [ebp - 0x4c], ecx
cmp dword [0x4110b8], 0
jne 0x4016a3
mov dword [ebp - 0x4c], 0x40d0d6
mov eax, dword [ebp - 0x4c]
mov dword [esp + 4], eax
mov dword [esp], str.deflateInit_:__s_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov eax, dword [ebp - 0x2c]
lea edx, [eax*4]
mov eax, dword [0x411010]
mov eax, dword [edx + eax]
mov dword [ebp - 0xc], eax
mov eax, 0x80000000
and eax, dword [ebp - 0xc]
mov dword [ebp - 0x44], eax
lea eax, [ebp - 0xc]
and dword [eax], 0x7fffffff
movzx ecx, byte [0x411095]
mov eax, dword [ebp - 0xc]
shl eax, cl
mov edx, 0
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], edx
cmp dword [ebp - 0x44], 0
je 0x40171a
mov eax, dword [0x411090]
mov edx, 0
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], edx
jmp 0x40174f
mov eax, dword [ebp - 0x2c]
shl eax, 2
add eax, dword [0x411010]
add eax, 4
mov eax, dword [eax]
and eax, 0x7fffffff
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
sub eax, edx
movzx ecx, byte [0x411095]
shl eax, cl
mov edx, 0
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], edx
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
mov eax, dword [0x4110f0]
mov dword [esp], eax
call sym._fseek
mov eax, dword [0x4110f0]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x41101c]
mov dword [esp], eax
call sym._fread
mov dword [0x4110a4], eax
mov eax, dword [0x4110a4]
mov edx, 0
mov ecx, edx
xor ecx, dword [ebp - 0x1c]
xor eax, dword [ebp - 0x20]
or eax, ecx
test eax, eax
je 0x4017cc
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.block_d_:_read_error_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
cmp dword [ebp - 0x44], 0
je 0x4017fa
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [0x41101c]
mov dword [esp + 4], eax
mov eax, dword [0x411018]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x34], eax
jmp 0x4018c5
mov eax, dword [0x411018]
mov dword [0x4110ac], eax
mov eax, dword [0x411090]
mov dword [0x4110b0], eax
mov eax, dword [0x41101c]
mov dword [0x4110a0], eax
mov dword [esp + 4], 3
mov dword [esp], 0x4110a0
call sym._inflate
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 1
je 0x40187b
mov eax, dword [ebp - 0x38]
mov dword [esp + 0xc], eax
mov ecx, dword [0x4110b8]
mov dword [ebp - 0x50], ecx
cmp dword [0x4110b8], 0
jne 0x401855
mov dword [ebp - 0x50], str.error
mov eax, dword [ebp - 0x50]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.block__d:inflate_:__s__d__n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov edx, dword [0x4110b0]
mov eax, dword [0x411090]
sub eax, edx
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
cmp eax, dword [0x411090]
je 0x4018c5
mov eax, dword [0x411090]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.block__d_:_block_size_error__d____d_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov eax, dword [0x411100]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x411018]
mov dword [esp], eax
call sym._fwrite
cmp eax, dword [ebp - 0x34]
je 0x40190b
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.block__d_:_Write_error_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
mov dword [esp], 0x4110a0
call sym._inflateEnd
test eax, eax
je 0x401950
mov ecx, dword [0x4110b8]
mov dword [ebp - 0x54], ecx
cmp dword [0x4110b8], 0
jne 0x401934
mov dword [ebp - 0x54], str.error
mov eax, dword [ebp - 0x54]
mov dword [esp + 4], eax
mov dword [esp], str.inflateEnd_:__s_n
call sym._printf
mov dword [ebp - 0x48], 1
jmp 0x40196d
lea eax, [ebp - 0x2c]
inc dword [eax]
jmp 0x40161b
mov dword [esp], str.ciso_decompress_completed_n
call sym._printf
mov dword [ebp - 0x48], 0
mov eax, dword [ebp - 0x48]
leave
ret