Function at 0x408c60
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2094
call fcn.0040a710
mov eax, dword [0x413080]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
xorps xmm0, xmm0
push edi
push esi
mov dword [ebp - 0x2064], 0
mov dword [ebp - 0x206c], 0
mov dword [ebp - 0x205c], 0x8020
movq qword [ebp - 0x2094], xmm0
movq qword [ebp - 0x208c], xmm0
movq qword [ebp - 0x2084], xmm0
call dword [sym.imp.MSVCR110.dll__dup]
mov edi, eax
add esp, 4
cmp edi, 0xffffffff
jne 0x408ce6
push esi
push str._cdiff_apply:_Cant_duplicate_descriptor__d_n
call fcn.00409d50
add esp, 8
or eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push ebx
mov ebx, dword [ebp - 0x205c]
push ebx
call dword [sym.imp.MSVCR110.dll_malloc]
mov esi, eax
add esp, 4
mov dword [ebp - 0x2070], esi
test esi, esi
jne 0x408d2b
push str._cdiff_apply:_Cant_allocate_memory_for_line_n
call fcn.00409d50
push edi
call dword [sym.imp.MSVCR110.dll__close]
add esp, 8
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.MSVCR110.dll_malloc]
mov ebx, eax
add esp, 4
mov dword [ebp - 0x2068], ebx
test ebx, ebx
jne 0x408d70
push str._cdiff_apply:_Cant_allocate_memory_for_lbuf_n
call fcn.00409d50
push edi
call dword [sym.imp.MSVCR110.dll__close]
push esi
call dword [sym.imp.MSVCR110.dll_free]
add esp, 0xc
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
cmp word [ebp + 0xc], 1
jne 0x40931f
push 2
push 0xfffffea2
push edi
call dword [sym.imp.MSVCR110.dll__lseek]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x408da0
push 0xfffffea2
push str._cdiff_apply:_lseek_desc___d__SEEK_END__failed_n
jmp 0x40933e
push dword [ebp - 0x205c]
push 0
push esi
call sub.MSVCR110.dll_memset
push 0x15e
push esi
push edi
call dword [sym.imp.MSVCR110.dll__read]
add esp, 0x18
cmp eax, 0x15e
je 0x408dd4
push 0x15e
push str._cdiff_apply:_Cant_read__d_bytes_n
jmp 0x40933e
mov eax, 0x15d
mov dword [ebp - 0x2058], eax
nop
cmp byte [eax + esi], 0x3a
je 0x408df9
dec eax
mov dword [ebp - 0x2058], eax
jns 0x408de0
push str._cdiff_apply:_No_digital_signature_in_cdiff_file_n
jmp 0x408fab
inc eax
add eax, esi
mov dword [ebp - 0x2078], eax
jne 0x408e0e
push str._cdiff_apply:_No_digital_signature_in_cdiff_file_n
jmp 0x408fab
lea eax, [ebp - 0x2054]
push eax
push edi
call dword [sym.imp.MSVCR110.dll__fstat64i32]
add esp, 8
cmp eax, 0xffffffff
jne 0x408e2e
push str._cdiff_apply:_Cant_fstat_file_n
jmp 0x408fab
mov eax, dword [ebp - 0x2040]
add eax, 0xfffffea2
add eax, dword [ebp - 0x2058]
mov dword [ebp - 0x2060], eax
jns 0x408e51
push str._cdiff_apply:_compressed_data_end_offset___0_n
jmp 0x408fab
push 0
push 0
push edi
call dword [sym.imp.MSVCR110.dll__lseek]
add esp, 0xc
cmp eax, 0xffffffff
je 0x408fa6
call sub.libeay32.dll_EVP_MD_CTX_create
mov dword [ebp - 0x2058], eax
test eax, eax
jne 0x408ea1
push edi
call dword [sym.imp.MSVCR110.dll__close]
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
push ebx
call esi
add esp, 0xc
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push 0
call sub.libeay32.dll_EVP_sha256
push eax
push dword [ebp - 0x2058]
call sub.libeay32.dll_EVP_DigestInit_ex
push 0x2000
lea eax, [ebp - 0x2024]
push eax
push edi
mov dword [ebp - 0x2074], 0
call dword [sym.imp.MSVCR110.dll__read]
add esp, 0x18
test eax, eax
jle 0x408f50
jmp 0x408ee0
mov edx, dword [ebp - 0x2074]
lea ecx, [eax + edx]
mov dword [ebp - 0x2074], ecx
cmp ecx, dword [ebp - 0x2060]
jge 0x408f32
push eax
lea eax, [ebp - 0x2024]
push eax
push dword [ebp - 0x2058]
call sub.libeay32.dll_EVP_DigestUpdate
mov eax, dword [ebp - 0x2074]
mov dword [ebp - 0x2074], eax
push 0x2000
lea eax, [ebp - 0x2024]
push eax
push edi
call dword [sym.imp.MSVCR110.dll__read]
add esp, 0x18
test eax, eax
jg 0x408ee0
jmp 0x408f50
mov eax, dword [ebp - 0x2060]
sub eax, edx
push eax
lea eax, [ebp - 0x2024]
push eax
push dword [ebp - 0x2058]
call sub.libeay32.dll_EVP_DigestUpdate
add esp, 0xc
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x2058]
call sub.libeay32.dll_EVP_DigestFinal_ex
push dword [ebp - 0x2058]
call sub.libeay32.dll_EVP_MD_CTX_destroy
push str.100002053
push str.14783905874077467090262228516557917570254599638376203532031989214105552847269687489771975792123442185817287694951949800908791527542017115600501303394778618535864845235700041590056318230102449612217458549016089313306591388590790796515819654102320725712300822356348724011232654837503241736177907784198700834440681124727060540035754699658105895050096576226753008596881698828185652424901921668758326578462003247906470982092298106789657211905488986281078346361469524484829559560886227198091995498440676639639830463593211386055065360288422394053998134458623712540683294034953818412458362198117811990006021989844180721010947
push dword [ebp - 0x2078]
lea eax, [ebp - 0x24]
push eax
call sub.libav.dll_Ordinal_44216
add esp, 0x20
test eax, eax
je 0x408f93
push str._cdiff_apply:_Incorrect_digital_signature_n
jmp 0x408fab
push 0
push 0
push edi
call dword [sym.imp.MSVCR110.dll__lseek]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x408fda
push str._cdiff_apply:_lseek_desc__0__SEEK_SET__failed_n
call fcn.00409d50
push edi
call dword [sym.imp.MSVCR110.dll__close]
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
push ebx
call esi
add esp, 0x10
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
xor esi, esi
xor ebx, ebx
mov edi, edi
lea eax, [ebp - 0x2024]
add eax, ebx
push 1
push eax
push edi
mov dword [ebp - 0x2078], eax
call dword [sym.imp.MSVCR110.dll__read]
add esp, 0xc
test eax, eax
jle 0x409019
mov eax, dword [ebp - 0x2078]
inc ebx
cmp byte [eax], 0x3a
jne 0x409011
inc esi
cmp esi, 3
je 0x409019
cmp ebx, 0x1fff
jl 0x408fe0
mov esi, dword [ebp - 0x2070]
cmp ebx, 0x2000
jae 0x4095f3
lea eax, [ebp - 0x207c]
push eax
lea eax, [ebp - 0x2024]
push str.ClamAV_Diff:_u:_u:
push eax
mov byte [ebp + ebx - 0x2024], 0
call dword [sym.imp.MSVCR110.dll_sscanf]
add esp, 0xc
cmp eax, 1
je 0x40908e
push str._cdiff_apply:_Incorrect_file_format_n
call fcn.00409d50
push edi
call dword [sym.imp.MSVCR110.dll__close]
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
mov edi, dword [ebp - 0x2068]
push edi
call esi
add esp, 0x10
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push 0x40fe08
push edi
call sub.libav.dll_Ordinal_44292
mov ecx, eax
add esp, 8
mov dword [ebp - 0x2058], ecx
test ecx, ecx
jne 0x4090e3
push edi
push str._cdiff_apply:_Cant_gzdopen_descriptor__d_n
call fcn.00409d50
push edi
call dword [sym.imp.MSVCR110.dll__close]
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
mov edi, dword [ebp - 0x2068]
push edi
call esi
add esp, 0x14
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x207c]
mov edi, dword [ebp - 0x2068]
test ebx, ebx
je 0x409314
lea eax, [ebx + 1]
cmp ebx, dword [ebp - 0x205c]
jb 0x409108
mov eax, dword [ebp - 0x205c]
push eax
push esi
push ecx
call sub.libav.dll_Ordinal_44291
add esp, 0xc
test eax, eax
je 0x4092c8
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x409120
inc dword [ebp - 0x2064]
sub ecx, edx
sub ebx, ecx
push esi
mov dword [ebp - 0x2070], ebx
call sub.libav.dll_Ordinal_44214
mov ecx, esi
add esp, 4
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x409145
sub ecx, edx
je 0x409231
cmp byte [esi], 0x23
jne 0x40920b
push 6
push str.LSIZE
push esi
call dword [sym.imp.MSVCR110.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x409231
lea eax, [ebp - 0x205c]
push eax
push str.LSIZE__u
push esi
call dword [sym.imp.MSVCR110.dll_sscanf]
add esp, 0xc
cmp eax, 1
jne 0x409231
mov ecx, dword [ebp - 0x205c]
push ecx
lea eax, [ecx - 0x8020]
cmp eax, 0x9f7fe0
ja 0x4091e9
mov ebx, dword [sym.imp.MSVCR110.dll_realloc]
push esi
call ebx
push dword [ebp - 0x205c]
mov dword [ebp - 0x2060], eax
push edi
call ebx
mov ebx, eax
mov eax, dword [ebp - 0x2060]
add esp, 0x10
test eax, eax
je 0x40923c
test ebx, ebx
je 0x40923c
mov ecx, dword [ebp - 0x2058]
mov edi, ebx
mov ebx, dword [ebp - 0x2070]
mov esi, eax
jmp 0x4090ef
push str.cdiff_apply:_Ignoring_new_buffer_size_request___invalid_size__d_n
call fcn.00409d50
mov ecx, dword [ebp - 0x2058]
add esp, 8
mov dword [ebp - 0x205c], 0x8020
jmp 0x4090ef
push dword [ebp - 0x205c]
lea eax, [ebp - 0x2094]
push edi
push eax
push esi
call fcn.004096a0
add esp, 0x10
cmp eax, 0xffffffff
je 0x4092ba
inc dword [ebp - 0x206c]
mov ecx, dword [ebp - 0x2058]
jmp 0x4090ef
push dword [ebp - 0x205c]
push str._cdiff_apply:_Cant_resize_line_buffer_to__d_bytes_n
call fcn.00409d50
lea eax, [ebp - 0x2094]
push eax
call fcn.00409600
push dword [ebp - 0x2058]
call sub.libav.dll_Ordinal_44293
mov eax, dword [ebp - 0x2060]
add esp, 0x10
test eax, eax
jne 0x409297
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
test ebx, ebx
je 0x4092a0
push ebx
call esi
add esp, 8
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.MSVCR110.dll_free]
push eax
call esi
push edi
call esi
add esp, 8
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x2064]
push eax
push str._cdiff_apply:_Error_executing_command_at_line__d_n
jmp 0x4092d5
mov eax, dword [ebp - 0x2064]
inc eax
push eax
push str._cdiff_apply:_Premature_EOF_at_line__d_n
call fcn.00409d50
lea eax, [ebp - 0x2094]
push eax
call fcn.00409600
push dword [ebp - 0x2058]
call sub.libav.dll_Ordinal_44293
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
push edi
call esi
add esp, 0x18
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push ecx
call sub.libav.dll_Ordinal_44293
jmp 0x4094b2
push 0x40fe08
push edi
call dword [sym.imp.MSVCR110.dll__fdopen]
add esp, 8
mov dword [ebp - 0x2058], eax
test eax, eax
jne 0x40936d
push edi
push str._cdiff_apply:_fdopen___failed_for_descriptor__d_n
call fcn.00409d50
push edi
call dword [sym.imp.MSVCR110.dll__close]
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
push ebx
call esi
add esp, 0x14
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push eax
push dword [ebp - 0x205c]
push esi
call dword [sym.imp.MSVCR110.dll_fgets]
mov edi, dword [ebp - 0x2058]
add esp, 0xc
test eax, eax
je 0x4094a5
lea esp, [esp]
inc dword [ebp - 0x2064]
push esi
call sub.libav.dll_Ordinal_44214
mov ecx, esi
add esp, 4
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4093a4
sub ecx, edx
je 0x40948c
cmp byte [esi], 0x23
jne 0x409466
push 6
push str.LSIZE
push esi
call dword [sym.imp.MSVCR110.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x40948c
lea eax, [ebp - 0x205c]
push eax
push str.LSIZE__u
push esi
call dword [sym.imp.MSVCR110.dll_sscanf]
add esp, 0xc
cmp eax, 1
jne 0x40948c
mov ecx, dword [ebp - 0x205c]
push ecx
lea eax, [ecx - 0x8020]
cmp eax, 0x9f7fe0
ja 0x40944d
mov edi, dword [sym.imp.MSVCR110.dll_realloc]
push esi
call edi
push dword [ebp - 0x205c]
mov dword [ebp - 0x2060], eax
push ebx
call edi
mov edi, eax
mov eax, dword [ebp - 0x2060]
add esp, 0x10
test eax, eax
je 0x409500
test edi, edi
je 0x409500
mov ebx, edi
mov edi, dword [ebp - 0x2058]
mov esi, eax
mov dword [ebp - 0x2068], ebx
jmp 0x40948c
push str.cdiff_apply:_Ignoring_new_buffer_size_request___invalid_size__d_n
call fcn.00409d50
add esp, 8
mov dword [ebp - 0x205c], 0x8020
jmp 0x40948c
push dword [ebp - 0x205c]
lea eax, [ebp - 0x2094]
push ebx
push eax
push esi
call fcn.004096a0
add esp, 0x10
cmp eax, 0xffffffff
je 0x40957f
inc dword [ebp - 0x206c]
push edi
push dword [ebp - 0x205c]
push esi
call dword [sym.imp.MSVCR110.dll_fgets]
add esp, 0xc
test eax, eax
jne 0x409390
push edi
call dword [sym.imp.MSVCR110.dll_fclose]
mov edi, dword [ebp - 0x2068]
add esp, 4
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
push edi
call esi
mov eax, dword [ebp - 0x2094]
add esp, 8
test eax, eax
je 0x4095c6
push eax
push str.cdiff_apply:_File__s_was_not_properly_closed_n
call fcn.00409d50
lea eax, [ebp - 0x2094]
push eax
call fcn.00409600
add esp, 0xc
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x205c]
push str._cdiff_apply:_Cant_resize_line_buffer_to__d_bytes_n
call fcn.00409d50
lea eax, [ebp - 0x2094]
push eax
call fcn.00409600
push dword [ebp - 0x2058]
call dword [sym.imp.MSVCR110.dll_fclose]
mov eax, dword [ebp - 0x2060]
add esp, 0x10
test eax, eax
jne 0x40955c
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
test edi, edi
je 0x409565
push edi
call esi
add esp, 8
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.MSVCR110.dll_free]
push eax
call esi
push ebx
call esi
add esp, 8
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x2064]
push eax
push str._cdiff_apply:_Error_executing_command_at_line__d_n
call fcn.00409d50
lea eax, [ebp - 0x2094]
push eax
call fcn.00409600
push edi
call dword [sym.imp.MSVCR110.dll_fclose]
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
push ebx
call esi
add esp, 0x18
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x206c]
mov eax, dword [ebp - 0x2064]
push eax
push str.cdiff_apply:_Parsed__d_lines_and_executed__d_commands_n
call fcn.00409d50
mov ecx, dword [ebp - 4]
add esp, 0xc
xor ecx, ebp
pop ebx
pop edi
xor eax, eax
pop esi
call fcn.0040a436
mov esp, ebp
pop ebp
ret
call fcn.0040a636
int3