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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x46c
mov dword [esp + 0x454], 0x10
mov dword [esp + 0x458], 4
mov dword [esp + 0x45c], 1
mov dword [esp + 4], 1
mov dword [esp], 0x50
call sub.msvcrt.dll_calloc
test eax, eax
mov ebp, eax
je 0x4063f6
mov dword [eax + 0x48], 0xffffffff
lea ebx, [esp + 0x30]
mov dword [eax + 0x4c], 0xffffffff
lea eax, [esp + 0x430]
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], eax
nop
mov edx, dword [esp + 0x480]
mov dword [esp + 4], 0x400
mov dword [esp], ebx
mov dword [esp + 8], edx
call sub.msvcrt.dll_fgets
test eax, eax
je 0x4063d0
cmp byte [esp + 0x30], 0xa
je 0x406568
mov eax, ebx
mov ecx, dword [eax]
add eax, 4
lea edx, [ecx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x406190
mov ecx, edx
shr ecx, 0x10
test edx, 0x8080
cmove edx, ecx
lea ecx, [eax + 2]
cmove eax, ecx
add dl, dl
sbb eax, 3
sub eax, ebx
sub eax, 1
js 0x4061e3
movzx edx, byte [ebx + eax]
cmp dl, 0xd
je 0x4061da
cmp dl, 0xa
je 0x4061da
cmp dl, 0x20
jne 0x4061e3
mov byte [ebx + eax], 0
sub eax, 1
jns 0x4061c7
mov dword [esp + 4], 0x3a
mov dword [esp], ebx
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4063d0
cmp byte [eax + 1], 0x20
jne 0x4063d0
mov byte [eax], 0
mov edi, str.zsync
mov ecx, 6
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
lea edx, [eax + 2]
jne 0x406272
mov edi, str.0.0.4
mov ecx, 6
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40679a
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov ecx, edx
or ecx, eax
je 0x406160
mov esi, dword [ebp + 0x14]
test esi, esi
je 0x406160
xor edi, edi
add eax, esi
adc edx, edi
add eax, 0xffffffff
adc edx, 0xffffffff
mov dword [esp + 8], esi
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040fe10
mov dword [ebp + 0x10], eax
jmp 0x406160
mov edi, str.Min_Version
mov ecx, 0xc
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4062b0
mov ecx, 6
mov edi, str.0.6.2
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
seta al
setb cl
sub al, cl
test al, al
jle 0x40622f
mov dword [esp + 8], edx
mov dword [esp + 4], str.control_file_indicates_that_zsync__s_or_better_is_required_n
jmp 0x4063dc
mov edi, str.Length
mov ecx, 7
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x406403
mov edi, str.Filename
mov ecx, 9
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x406417
mov edi, str.Z_Filename
mov ecx, 0xb
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x4064c0
mov edi, 0x41456f
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x4064d6
mov edi, str.Z_URL
mov ecx, 6
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x40651f
mov edi, str.Blocksize
mov ecx, 0xa
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x4066f0
mov edi, str.Hash_Lengths
mov ecx, 0xd
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x4067d9
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40642d
mov edi, str.Z_Map2
mov ecx, 7
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40642d
mov dword [esp], edx
call sub.msvcrt.dll_atoi
test eax, eax
mov esi, eax
js 0x406a29
lea eax, [eax*4]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov edi, eax
je 0x40622f
mov ecx, dword [esp + 0x480]
mov dword [esp + 8], esi
mov dword [esp + 4], 4
mov dword [esp], eax
mov dword [esp + 0xc], ecx
call sub.msvcrt.dll_fread
cmp esi, eax
ja 0x406a60
mov dword [esp + 4], esi
mov dword [esp], edi
call fcn.00408ca0
mov dword [ebp + 0x28], eax
mov dword [esp], edi
call sub.msvcrt.dll_free
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
jmp 0x406235
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Bad_line___not_a_zsync_file____s__n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], ebp
xor ebp, ebp
call sub.msvcrt.dll_free
add esp, 0x46c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], edx
call dword [sym.imp.msvcrt.dll__atoi64]
mov dword [ebp + 8], eax
mov dword [ebp + 0xc], edx
jmp 0x406235
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov edx, dword [ebp + 0xc]
mov dword [ebp + 0x38], eax
mov eax, dword [ebp + 8]
jmp 0x406235
mov edi, str.SHA_1
mov ecx, 6
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x406717
mov edi, str.Safe
mov ecx, 5
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x406975
mov edi, str.Recompress
mov ecx, 0xb
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x40685d
mov ecx, 6
mov edi, str.MTime
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
setb cl
sub al, cl
movsx eax, al
test eax, eax
je 0x4069a9
mov edi, dword [esp + 0x24]
test edi, edi
je 0x4064aa
mov eax, dword [esp + 0x24]
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
jne 0x40622f
mov dword [esp + 8], ebx
mov dword [esp + 4], str.unrecognised_tag__s___you_need_a_newer_version_of_zsync._n
jmp 0x4063dc
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov edx, dword [ebp + 0xc]
mov dword [ebp + 0x3c], eax
mov eax, dword [ebp + 8]
jmp 0x406235
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov esi, eax
mov eax, dword [ebp + 0x20]
test esi, esi
je 0x406511
mov edx, dword [ebp + 0x24]
mov dword [esp], eax
lea edx, [edx*4 + 4]
mov dword [esp + 4], edx
call sub.msvcrt.dll_realloc
test eax, eax
je 0x406a97
mov edx, dword [ebp + 0x24]
mov dword [eax + edx*4], esi
add edx, 1
mov dword [ebp + 0x24], edx
mov dword [ebp + 0x20], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
jmp 0x406235
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov esi, eax
mov eax, dword [ebp + 0x2c]
test esi, esi
je 0x40655a
mov edx, dword [ebp + 0x30]
mov dword [esp], eax
lea edx, [edx*4 + 4]
mov dword [esp + 4], edx
call sub.msvcrt.dll_realloc
test eax, eax
je 0x406a97
mov edx, dword [ebp + 0x30]
mov dword [eax + edx*4], esi
add edx, 1
mov dword [ebp + 0x30], edx
mov dword [ebp + 0x2c], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
jmp 0x406235
mov eax, dword [ebp + 0xc]
or eax, dword [ebp + 8]
je 0x406763
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x406763
mov edx, dword [esp + 0x454]
mov edi, dword [esp + 0x458]
mov dword [esp + 4], eax
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x45c]
mov ecx, dword [esp + 0x24]
mov dword [esp + 8], edi
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], ecx
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call fcn.004096b0
test eax, eax
mov dword [ebp], eax
je 0x4066e1
mov esi, dword [ebp + 0x10]
test esi, esi
jle 0x4063f6
sub ebx, edi
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
add ebx, 4
mov dword [esp + 0x28], ebx
xor ebx, ebx
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x480]
jmp 0x40666d
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x430]
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp], ecx
mov dword [esp + 4], edx
call sub.msvcrt.dll_fread
test eax, eax
je 0x4066a3
movzx eax, word [esp + 0x30]
mov dword [esp], eax
call esi
sub esp, 4
mov word [esp + 0x30], ax
movzx eax, word [esp + 0x32]
mov dword [esp], eax
call esi
sub esp, 4
mov word [esp + 0x32], ax
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x430]
mov dword [esp + 4], ebx
add ebx, 1
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp]
mov dword [esp], eax
call fcn.004098a0
cmp ebx, dword [ebp + 0x10]
jge 0x4063f6
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
mov word [esp + 0x30], 0
mov word [esp + 0x32], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], ecx
call sub.msvcrt.dll_fread
test eax, eax
jne 0x4065f0
mov eax, dword [esp + 0x480]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 4], str.short_read_on_control_file___s_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [ebp]
mov dword [esp], eax
call fcn.00409830
mov dword [esp], ebp
xor ebp, ebp
call sub.msvcrt.dll_free
jmp 0x4063f6
mov dword [esp], edx
call sub.msvcrt.dll_atol
lea edx, [eax - 1]
test edx, eax
mov dword [ebp + 0x14], eax
je 0x40622f
mov dword [esp + 8], eax
mov dword [esp + 4], str.nonsensical_blocksize_Iu_n
jmp 0x4063dc
mov dword [esp], edx
mov dword [esp + 0x20], edx
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x20]
cmp eax, 0x28
je 0x40698c
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x30
mov dword [esp + 4], 1
mov dword [esp], str.SHA_1_digest_from_control_file_is_wrong_length._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
jmp 0x406235
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x39
mov dword [esp + 4], 1
mov dword [esp], str.Not_a_zsync_file__looked_for_Blocksize_and_Length_lines__n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], ebp
xor ebp, ebp
call sub.msvcrt.dll_free
jmp 0x4063f6
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x42
mov dword [esp + 4], 1
mov dword [esp], str.This_version_of_zsync_is_not_compatible_with_zsync_0.0.4_streams._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], ebp
xor ebp, ebp
call sub.msvcrt.dll_free
add esp, 0x46c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x454]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x458]
mov dword [esp + 0xc], eax
lea eax, [esp + 0x45c]
mov dword [esp], edx
mov dword [esp + 0x20], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str._d__d__d
call sub.msvcrt.dll_sscanf
mov edx, dword [esp + 0x20]
cmp eax, 3
jne 0x40684c
mov eax, dword [esp + 0x458]
test eax, eax
jle 0x40684c
cmp eax, 4
jg 0x40684c
mov eax, dword [esp + 0x454]
cmp eax, 2
jle 0x40684c
cmp eax, 0x10
jg 0x40684c
mov eax, dword [esp + 0x45c]
cmp eax, 2
jg 0x40684c
test eax, eax
jg 0x40622f
mov dword [esp + 8], edx
mov dword [esp + 4], str.nonsensical_hash_lengths_line__s_n
jmp 0x4063dc
mov dword [esp], edx
call sub.msvcrt.dll__strdup
test eax, eax
mov esi, eax
mov dword [ebp + 0x44], eax
je 0x40622f
mov dword [esp + 4], 0x20
mov dword [esp], eax
call sub.msvcrt.dll_strchr
test eax, eax
mov edx, eax
je 0x406a9c
cmp byte [edx], 0
je 0x406897
mov byte [edx], 0
add edx, 1
mov edi, str.__best
mov ecx, 7
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
cmp byte [edx], 0
je 0x406aad
mov edi, str.__rsync
mov ecx, 8
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
mov edi, str.__rsync___best
mov ecx, 0xf
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
mov edi, str.__best___no_name
mov ecx, 0x11
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
mov edi, str.__no_name
mov ecx, 0xa
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
mov edi, str.__rsync___no_name
mov ecx, 0x12
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
mov edi, str.__rsync___best___no_name
mov ecx, 0x19
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x406aad
mov eax, dword [ebp + 0x40]
test eax, eax
jne 0x40622f
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x21
mov dword [esp + 4], 1
mov dword [esp], str.bad_recompress_options__rejected_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [ebp + 0x44]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
jmp 0x406235
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 8]
jmp 0x406235
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov edx, dword [ebp + 0xc]
mov dword [ebp + 0x1c], str.SHA_1
mov dword [ebp + 0x18], eax
mov eax, dword [ebp + 8]
jmp 0x406235
mov edi, dword [esp + 0x28]
mov ecx, 9
rep stosd dword es:[edi], eax
lea eax, [esp + 0x430]
mov dword [esp], edx
mov dword [esp + 0x20], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str._a___d__b__Y__H:_M:_S__z
call fcn.004049b0
mov edx, dword [esp + 0x20]
test eax, eax
je 0x4069fc
lea eax, [esp + 0x430]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__mktime64]
mov dword [ebp + 0x48], eax
mov eax, dword [ebp + 8]
mov dword [ebp + 0x4c], edx
mov edx, dword [ebp + 0xc]
jmp 0x406235
lea ecx, [esp + 0x430]
mov dword [esp + 8], ecx
mov dword [esp], edx
mov dword [esp + 4], str._d__b__Y__H:_M:_S__z
call fcn.004049b0
mov edx, 0xffffffff
mov ecx, eax
mov eax, 0xffffffff
test ecx, ecx
jne 0x4069db
jmp 0x4069eb
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0xf
mov dword [esp + 4], 1
mov dword [esp], str.bad_Z_Map_line_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], ebp
xor ebp, ebp
call sub.msvcrt.dll_free
jmp 0x4063f6
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x1a
mov dword [esp + 4], 1
mov dword [esp], str.premature_EOF_after_Z_Map_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], ebp
xor ebp, ebp
call sub.msvcrt.dll_free
jmp 0x4063f6
call fcn.00411ad0
mov dword [esp], esi
nop
call sub.msvcrt.dll_strlen
lea edx, [esi + eax]
jmp 0x40688c
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov dword [ebp + 0x40], eax
jmp 0x40692f