Function at 0x408d00
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2094
call fcn.0040a7b0
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 0x408d86
push esi
push str._cdiff_apply:_Cant_duplicate_descriptor__d_n
call fcn.00409df0
add esp, 8
or eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a4d6
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 0x408dcb
push str._cdiff_apply:_Cant_allocate_memory_for_line_n
call fcn.00409df0
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.0040a4d6
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 0x408e10
push str._cdiff_apply:_Cant_allocate_memory_for_lbuf_n
call fcn.00409df0
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.0040a4d6
mov esp, ebp
pop ebp
ret
cmp word [ebp + 0xc], 1
jne 0x4093bf
push 2
push 0xfffffea2
push edi
call dword [sym.imp.MSVCR110.dll__lseek]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x408e40
push 0xfffffea2
push str._cdiff_apply:_lseek_desc___d__SEEK_END__failed_n
jmp 0x4093de
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 0x408e74
push 0x15e
push str._cdiff_apply:_Cant_read__d_bytes_n
jmp 0x4093de
mov eax, 0x15d
mov dword [ebp - 0x2058], eax
nop
cmp byte [eax + esi], 0x3a
je 0x408e99
dec eax
mov dword [ebp - 0x2058], eax
jns 0x408e80
push str._cdiff_apply:_No_digital_signature_in_cdiff_file_n
jmp 0x40904b
inc eax
add eax, esi
mov dword [ebp - 0x2078], eax
jne 0x408eae
push str._cdiff_apply:_No_digital_signature_in_cdiff_file_n
jmp 0x40904b
lea eax, [ebp - 0x2054]
push eax
push edi
call dword [sym.imp.MSVCR110.dll__fstat64i32]
add esp, 8
cmp eax, 0xffffffff
jne 0x408ece
push str._cdiff_apply:_Cant_fstat_file_n
jmp 0x40904b
mov eax, dword [ebp - 0x2040]
add eax, 0xfffffea2
add eax, dword [ebp - 0x2058]
mov dword [ebp - 0x2060], eax
jns 0x408ef1
push str._cdiff_apply:_compressed_data_end_offset___0_n
jmp 0x40904b
push 0
push 0
push edi
call dword [sym.imp.MSVCR110.dll__lseek]
add esp, 0xc
cmp eax, 0xffffffff
je 0x409046
call sub.libeay32.dll_EVP_MD_CTX_create
mov dword [ebp - 0x2058], eax
test eax, eax
jne 0x408f41
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.0040a4d6
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 0x408ff0
jmp 0x408f80
mov edx, dword [ebp - 0x2074]
lea ecx, [eax + edx]
mov dword [ebp - 0x2074], ecx
cmp ecx, dword [ebp - 0x2060]
jge 0x408fd2
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 0x408f80
jmp 0x408ff0
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 0x409033
push str._cdiff_apply:_Incorrect_digital_signature_n
jmp 0x40904b
push 0
push 0
push edi
call dword [sym.imp.MSVCR110.dll__lseek]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40907a
push str._cdiff_apply:_lseek_desc__0__SEEK_SET__failed_n
call fcn.00409df0
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.0040a4d6
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 0x4090b9
mov eax, dword [ebp - 0x2078]
inc ebx
cmp byte [eax], 0x3a
jne 0x4090b1
inc esi
cmp esi, 3
je 0x4090b9
cmp ebx, 0x1fff
jl 0x409080
mov esi, dword [ebp - 0x2070]
cmp ebx, 0x2000
jae 0x409693
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 0x40912e
push str._cdiff_apply:_Incorrect_file_format_n
call fcn.00409df0
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.0040a4d6
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 0x409183
push edi
push str._cdiff_apply:_Cant_gzdopen_descriptor__d_n
call fcn.00409df0
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.0040a4d6
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x207c]
mov edi, dword [ebp - 0x2068]
test ebx, ebx
je 0x4093b4
lea eax, [ebx + 1]
cmp ebx, dword [ebp - 0x205c]
jb 0x4091a8
mov eax, dword [ebp - 0x205c]
push eax
push esi
push ecx
call sub.libav.dll_Ordinal_44291
add esp, 0xc
test eax, eax
je 0x409368
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4091c0
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 0x4091e5
sub ecx, edx
je 0x4092d1
cmp byte [esi], 0x23
jne 0x4092ab
push 6
push str.LSIZE
push esi
call dword [sym.imp.MSVCR110.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x4092d1
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 0x4092d1
mov ecx, dword [ebp - 0x205c]
push ecx
lea eax, [ecx - 0x8020]
cmp eax, 0x9f7fe0
ja 0x409289
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 0x4092dc
test ebx, ebx
je 0x4092dc
mov ecx, dword [ebp - 0x2058]
mov edi, ebx
mov ebx, dword [ebp - 0x2070]
mov esi, eax
jmp 0x40918f
push str.cdiff_apply:_Ignoring_new_buffer_size_request___invalid_size__d_n
call fcn.00409df0
mov ecx, dword [ebp - 0x2058]
add esp, 8
mov dword [ebp - 0x205c], 0x8020
jmp 0x40918f
push dword [ebp - 0x205c]
lea eax, [ebp - 0x2094]
push edi
push eax
push esi
call fcn.00409740
add esp, 0x10
cmp eax, 0xffffffff
je 0x40935a
inc dword [ebp - 0x206c]
mov ecx, dword [ebp - 0x2058]
jmp 0x40918f
push dword [ebp - 0x205c]
push str._cdiff_apply:_Cant_resize_line_buffer_to__d_bytes_n
call fcn.00409df0
lea eax, [ebp - 0x2094]
push eax
call fcn.004096a0
push dword [ebp - 0x2058]
call sub.libav.dll_Ordinal_44293
mov eax, dword [ebp - 0x2060]
add esp, 0x10
test eax, eax
jne 0x409337
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
test ebx, ebx
je 0x409340
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.0040a4d6
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.0040a4d6
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 0x409375
mov eax, dword [ebp - 0x2064]
inc eax
push eax
push str._cdiff_apply:_Premature_EOF_at_line__d_n
call fcn.00409df0
lea eax, [ebp - 0x2094]
push eax
call fcn.004096a0
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.0040a4d6
mov esp, ebp
pop ebp
ret
push ecx
call sub.libav.dll_Ordinal_44293
jmp 0x409552
push 0x40fe08
push edi
call dword [sym.imp.MSVCR110.dll__fdopen]
add esp, 8
mov dword [ebp - 0x2058], eax
test eax, eax
jne 0x40940d
push edi
push str._cdiff_apply:_fdopen___failed_for_descriptor__d_n
call fcn.00409df0
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.0040a4d6
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 0x409545
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 0x409444
sub ecx, edx
je 0x40952c
cmp byte [esi], 0x23
jne 0x409506
push 6
push str.LSIZE
push esi
call dword [sym.imp.MSVCR110.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x40952c
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 0x40952c
mov ecx, dword [ebp - 0x205c]
push ecx
lea eax, [ecx - 0x8020]
cmp eax, 0x9f7fe0
ja 0x4094ed
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 0x4095a0
test edi, edi
je 0x4095a0
mov ebx, edi
mov edi, dword [ebp - 0x2058]
mov esi, eax
mov dword [ebp - 0x2068], ebx
jmp 0x40952c
push str.cdiff_apply:_Ignoring_new_buffer_size_request___invalid_size__d_n
call fcn.00409df0
add esp, 8
mov dword [ebp - 0x205c], 0x8020
jmp 0x40952c
push dword [ebp - 0x205c]
lea eax, [ebp - 0x2094]
push ebx
push eax
push esi
call fcn.00409740
add esp, 0x10
cmp eax, 0xffffffff
je 0x40961f
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 0x409430
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 0x409666
push eax
push str.cdiff_apply:_File__s_was_not_properly_closed_n
call fcn.00409df0
lea eax, [ebp - 0x2094]
push eax
call fcn.004096a0
add esp, 0xc
or eax, 0xffffffff
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a4d6
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x205c]
push str._cdiff_apply:_Cant_resize_line_buffer_to__d_bytes_n
call fcn.00409df0
lea eax, [ebp - 0x2094]
push eax
call fcn.004096a0
push dword [ebp - 0x2058]
call dword [sym.imp.MSVCR110.dll_fclose]
mov eax, dword [ebp - 0x2060]
add esp, 0x10
test eax, eax
jne 0x4095fc
push esi
mov esi, dword [sym.imp.MSVCR110.dll_free]
call esi
test edi, edi
je 0x409605
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.0040a4d6
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.0040a4d6
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.00409df0
lea eax, [ebp - 0x2094]
push eax
call fcn.004096a0
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.0040a4d6
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.00409df0
mov ecx, dword [ebp - 4]
add esp, 0xc
xor ecx, ebp
pop ebx
pop edi
xor eax, eax
pop esi
call fcn.0040a4d6
mov esp, ebp
pop ebp
ret
call fcn.0040a6d6
int3