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

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0xd0
mov eax, dword [0x4110f0]
mov dword [esp], eax
call sym._check_file_size
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], edx
mov eax, dword [0x411110]
shl eax, 2
add eax, 4
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._malloc
mov dword [0x411010], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._malloc
mov dword [0x411014], 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 0x401a08
cmp dword [0x411014], 0
je 0x401a08
cmp dword [0x411018], 0
je 0x401a08
cmp dword [0x41101c], 0
jne 0x401a23
mov dword [esp], str.Cant_allocate_memory_n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [0x411010]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [0x411014]
mov dword [esp], eax
call sym._memset
mov dword [esp + 8], 0x40
mov dword [esp + 4], 0
lea eax, [ebp - 0x68]
mov dword [esp], eax
call sym._memset
mov dword [0x4110c0], 0
mov dword [0x4110c4], 0
mov dword [0x4110c8], 0
mov eax, dword [0x4110e0]
mov dword [esp + 8], eax
mov eax, dword [0x411070]
mov dword [esp + 4], eax
mov dword [esp], str.Compress__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
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 eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.compress_level___d_n
call sym._printf
mov eax, dword [0x411100]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x18
mov dword [esp + 4], 1
mov dword [esp], 0x411080
call sym._fwrite
mov eax, dword [0x411100]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x411010]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x20]
add eax, 0x18
mov edx, 0
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], edx
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 - 0x74], eax
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 - 0x78], eax
movzx ecx, byte [0x411095]
mov eax, 1
shl eax, cl
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x80]
dec eax
mov dword [ebp - 0x84], eax
mov dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x24]
cmp eax, dword [0x411110]
jge 0x401fed
lea eax, [ebp - 0x78]
dec dword [eax]
cmp dword [ebp - 0x78], 0
jg 0x401ca9
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x78], eax
cmp dword [ebp - 0x24], 0
je 0x401c4e
mov ecx, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
mov eax, ecx
mov edx, ebx
shld edx, eax, 2
shl eax, 2
add eax, ecx
adc edx, ebx
mov ecx, eax
mov ebx, edx
shld ebx, ecx, 2
shl ecx, 2
add eax, ecx
adc edx, ebx
mov ecx, eax
mov ebx, edx
shld ebx, ecx, 2
shl ecx, 2
mov eax, dword [ebp - 0x24]
shl eax, 0xb
cdq
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov dword [esp], ecx
mov dword [esp + 4], ebx
call sym.___udivdi3
mov dword [ebp - 0x90], eax
mov dword [ebp - 0x8c], edx
jmp 0x401c62
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x8c], 0
mov eax, dword [ebp - 0x90]
mov edx, dword [ebp - 0x8c]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov edx, dword [ebp - 0x24]
lea ecx, [ebp - 0x74]
mov dword [ebp - 0xac], ecx
mov eax, edx
mov ecx, dword [ebp - 0xac]
cdq
idiv dword [ecx]
mov dword [ebp - 0xac], eax
mov eax, dword [ebp - 0xac]
mov dword [esp + 4], eax
mov dword [esp], str.compress__3d___avarage_rate__3d___r
call sym._printf
mov dword [esp + 0x1c], 0x38
mov dword [esp + 0x18], 0x40d0d0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 8
mov dword [esp + 0xc], 0xfffffff1
mov dword [esp + 8], 8
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], 0x4110a0
call sym._deflateInit2_
test eax, eax
je 0x401d34
mov edx, dword [0x4110b8]
mov dword [ebp - 0x94], edx
cmp dword [0x4110b8], 0
jne 0x401d0f
mov dword [ebp - 0x94], 0x40d0d6
mov ecx, dword [ebp - 0x94]
mov dword [esp + 4], ecx
mov dword [esp], str.deflateInit_:__s_n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
mov eax, dword [ebp - 0x84]
and eax, dword [ebp - 0x18]
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
je 0x401dad
mov edx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0x80]
sub eax, edx
mov dword [ebp - 0x7c], eax
mov eax, dword [0x411100]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x7c]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
lea eax, [ebp - 0x68]
mov dword [esp], eax
call sym._fwrite
cmp eax, dword [ebp - 0x7c]
je 0x401d9b
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], str.block__d_:_Write_error_n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
mov eax, dword [ebp - 0x7c]
mov edx, eax
mov ecx, eax
sar ecx, 0x1f
lea eax, [ebp - 0x18]
add dword [eax], edx
adc dword [eax + 4], ecx
mov eax, dword [ebp - 0x24]
lea ebx, [eax*4]
mov esi, dword [0x411010]
movzx ecx, byte [0x411095]
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
shrd eax, edx, cl
shr edx, cl
test cl, 0x20
je 0x401ddb
mov eax, edx
mov edx, 0
mov dword [ebx + esi], eax
mov eax, dword [0x41101c]
mov dword [0x4110ac], eax
mov eax, dword [0x411090]
add eax, eax
mov dword [0x4110b0], eax
mov eax, dword [0x411018]
mov dword [0x4110a0], eax
mov eax, dword [0x4110f0]
mov dword [esp + 0xc], eax
mov eax, dword [0x411090]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x411018]
mov dword [esp], eax
call sym._fread
mov dword [0x4110a4], eax
mov eax, dword [0x4110a4]
cmp eax, dword [0x411090]
je 0x401e59
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], str.block_d_:_read_error_n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
mov dword [esp + 4], 4
mov dword [esp], 0x4110a0
call sym._deflate
mov dword [ebp - 0x70], eax
cmp dword [ebp - 0x70], 1
je 0x401ec7
mov eax, dword [ebp - 0x70]
mov dword [esp + 0xc], eax
mov eax, dword [0x4110b8]
mov dword [ebp - 0x98], eax
cmp dword [0x4110b8], 0
jne 0x401e9b
mov dword [ebp - 0x98], str.error
mov edx, dword [ebp - 0x98]
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], str.block__d:deflate_:__s__d__n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
mov eax, dword [0x411090]
add eax, eax
sub eax, dword [0x4110b0]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x6c]
cmp eax, dword [0x411090]
jb 0x401f31
mov eax, dword [0x411090]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x6c]
mov dword [esp + 8], eax
mov eax, dword [0x411018]
mov dword [esp + 4], eax
mov eax, dword [0x41101c]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp - 0x24]
lea ecx, [eax*4]
mov ebx, dword [0x411010]
mov eax, dword [ebp - 0x24]
lea edx, [eax*4]
mov eax, dword [0x411010]
mov eax, dword [edx + eax]
or eax, 0x80000000
mov dword [ecx + ebx], eax
mov eax, dword [0x411100]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x6c]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x41101c]
mov dword [esp], eax
call sym._fwrite
cmp eax, dword [ebp - 0x6c]
je 0x401f7d
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], str.block__d_:_Write_error_n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
mov eax, dword [ebp - 0x6c]
mov edx, eax
mov ecx, eax
sar ecx, 0x1f
lea eax, [ebp - 0x18]
add dword [eax], edx
adc dword [eax + 4], ecx
mov dword [esp], 0x4110a0
call sym._deflateEnd
test eax, eax
je 0x401fe3
mov ecx, dword [0x4110b8]
mov dword [ebp - 0x9c], ecx
cmp dword [0x4110b8], 0
jne 0x401fbe
mov dword [ebp - 0x9c], str.error
mov eax, dword [ebp - 0x9c]
mov dword [esp + 4], eax
mov dword [esp], str.deflateEnd_:__s_n
call sym._printf
mov dword [ebp - 0x88], 1
jmp 0x4020cf
lea eax, [ebp - 0x24]
inc dword [eax]
jmp 0x401bcc
mov eax, dword [ebp - 0x24]
lea ebx, [eax*4]
mov esi, dword [0x411010]
movzx ecx, byte [0x411095]
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
shrd eax, edx, cl
shr edx, cl
test cl, 0x20
je 0x40201b
mov eax, edx
mov edx, 0
mov dword [ebx + esi], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x18
mov eax, dword [0x411100]
mov dword [esp], eax
call sym._fseek
mov eax, dword [0x411100]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [0x411010]
mov dword [esp], eax
call sym._fwrite
mov ecx, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
mov eax, ecx
mov edx, ebx
shld edx, eax, 2
shl eax, 2
add eax, ecx
adc edx, ebx
mov ecx, eax
mov ebx, edx
shld ebx, ecx, 2
shl ecx, 2
add eax, ecx
adc edx, ebx
mov ecx, eax
mov ebx, edx
shld ebx, ecx, 2
shl ecx, 2
mov eax, dword [0x411088]
mov edx, dword [0x41108c]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov dword [esp], ecx
mov dword [esp + 4], ebx
call sym.___udivdi3
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
mov dword [esp], str.ciso_compress_completed___total_size___8d_bytes___rate__d___n
call sym._printf
mov dword [ebp - 0x88], 0
mov eax, dword [ebp - 0x88]
add esp, 0xd0
pop ebx
pop esi
pop ebp
ret