Function at 0x411230
Capabilities:
Initialize winsock library
Move file
Query environment variable
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x238
mov edi, dword [ecx]
mov esi, dword [ecx + 4]
call fcn.0040f7e0
mov dword [ebp - 0x1c], 0
call sub.msvcrt.dll__getpid
mov dword [esp], eax
call sub.msvcrt.dll_srand
lea eax, [ebp - 0x200]
mov dword [esp + 4], eax
mov dword [esp], 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
sub esp, 8
test eax, eax
jne 0x411aa8
movzx eax, word [ebp - 0x200]
cmp al, 2
jne 0x411a8a
shr ax, 8
cmp al, 2
jne 0x411a8a
mov dword [ebp - 0x20c], 0
xor ebx, ebx
mov dword [ebp - 0x214], 0
mov dword [esp + 8], str.A:k:o:i:Vsqu:
mov dword [esp + 4], esi
mov dword [esp], edi
call fcn.00410c10
cmp eax, 0xffffffff
je 0x4113f6
sub eax, 0x41
cmp eax, 0x34
ja case.0x4112dd.66
jmp dword [eax*4 + 0x4138a8]
mov eax, dword [0x418430]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [0x4183f8], eax
jmp case.0x4112dd.66
mov dword [0x4183fc], 1
jmp case.0x4112dd.66
mov eax, dword [ebp - 0x214]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [0x418430]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [ebp - 0x214], eax
jmp case.0x4112dd.66
mov eax, dword [ebp - 0x20c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [0x418430]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [ebp - 0x20c], eax
jmp case.0x4112dd.66
mov ecx, dword [0x418430]
mov edx, ebx
lea eax, [ebp - 0x1c]
call fcn.00401550
mov ebx, eax
jmp case.0x4112dd.66
mov dword [esp], str.zsync_v0.6.2__compiled_Dec_27_2011_01:44:35__nBy_Colin_Phipps__cph_moria.org.uk__nPublished_under_the_Artistic_License_v2__see_the_COPYING_file_for_details.
call sub.msvcrt.dll_puts
mov dword [esp], 0
call sub.msvcrt.dll_exit
nop
mov eax, dword [0x418430]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [esp + 4], 0x3d
mov dword [esp], eax
mov dword [ebp - 0x210], eax
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4119c0
mov dword [esp + 4], 0x3a
mov dword [esp], eax
mov dword [ebp - 0x220], eax
call sub.msvcrt.dll_strchr
mov edx, dword [ebp - 0x220]
test eax, eax
je 0x4119c0
mov byte [eax], 0
add eax, 1
mov byte [edx], 0
add edx, 1
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x210]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00402b40
jmp case.0x4112dd.66
mov eax, dword [0x412120]
cmp eax, edi
je 0x411a56
sub edi, 1
cmp eax, edi
jl 0x411a22
mov dword [esp], 0
call sub.msvcrt.dll__isatty
test eax, eax
jne 0x411428
mov dword [0x4183fc], 1
mov dword [esp], str.http_proxy
call sub.msvcrt.dll_getenv
test eax, eax
je 0x411440
mov dword [esp], eax
call fcn.00402a40
mov eax, dword [ebp - 0x20c]
mov dword [esp + 4], eax
mov eax, dword [0x412120]
mov eax, dword [esi + eax*4]
mov dword [esp], eax
call fcn.00401870
test eax, eax
mov dword [ebp - 0x218], eax
je 0x4119b4
cmp dword [ebp - 0x214], 0
je 0x411924
mov edi, dword [ebp - 0x214]
xor edx, edx
or esi, 0xffffffff
mov eax, edx
mov ecx, esi
repne scasb al, byte es:[edi]
mov byte [ebp - 0x220], dl
not ecx
add ecx, 5
mov dword [esp], ecx
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x21c], eax
mov eax, dword [ebp - 0x214]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
movzx edx, byte [ebp - 0x220]
mov ecx, esi
mov edi, dword [ebp - 0x21c]
mov eax, edx
mov edx, dword [ebp - 0x21c]
repne scasb al, byte es:[edi]
not ecx
lea eax, [edx + ecx - 1]
mov dword [eax], 0x7261702e
mov word [eax + 4], 0x74
mov eax, dword [ebp - 0x214]
mov dword [esp + 4], 4
mov dword [esp], eax
call sub.msvcrt.dll__access
test eax, eax
je 0x41189a
mov edx, dword [ebp - 0x21c]
mov dword [esp + 4], 4
mov dword [esp], edx
call sub.msvcrt.dll__access
test eax, eax
je 0x411883
cmp dword [ebp - 0x1c], 0
jle 0x41159c
xor eax, eax
mov dword [ebp - 0x20c], ebx
mov ebx, eax
nop
mov eax, dword [ebp - 0x218]
mov dword [esp], eax
call fcn.00406b20
cmp eax, 1
jg 0x41159c
test ebx, ebx
je 0x4117c1
mov edx, dword [ebp - 0x20c]
xor esi, esi
xor edi, edi
mov edx, dword [edx + ebx*4]
mov dword [ebp - 0x210], edx
nop
mov edx, dword [ebp - 0x20c]
mov eax, dword [edx + esi*4]
mov edx, dword [ebp - 0x210]
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.msvcrt.dll_strcmp
test eax, eax
mov eax, 1
cmove edi, eax
add esi, 1
cmp esi, ebx
jne 0x411560
test edi, edi
je 0x4117c1
add ebx, 1
cmp dword [ebp - 0x1c], ebx
jg 0x411530
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x218]
mov dword [esp + 8], 0
mov dword [esp], eax
call fcn.00406b50
mov eax, dword [ebp - 0x24]
or eax, dword [ebp - 0x28]
jne 0x4115ce
cmp dword [0x4183fc], 0
je 0x4118dc
mov edx, dword [ebp - 0x21c]
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00406dd0
test eax, eax
jne 0x4119a8
mov eax, dword [ebp - 0x218]
mov dword [esp], eax
call fcn.00401f60
test eax, eax
jne 0x4119f4
cmp dword [0x4183fc], 0
je 0x411872
mov eax, dword [ebp - 0x218]
mov dword [esp], eax
call fcn.00406e60
test eax, eax
jne 0x4117e1
cmp dword [0x4183fc], 0
je 0x411861
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x218]
mov dword [esp], eax
call fcn.00406b10
mov dword [ebp - 0x210], eax
mov eax, dword [ebp - 0x218]
mov dword [ebp - 0x21c], edx
mov dword [esp], eax
call fcn.00406fc0
cmp dword [ebp - 0x214], 0
mov dword [ebp - 0x20c], eax
je 0x411909
mov edi, dword [ebp - 0x214]
xor edx, edx
or esi, 0xffffffff
mov eax, edx
mov ecx, esi
repne scasb al, byte es:[edi]
mov byte [ebp - 0x220], dl
not ecx
add ecx, 7
mov dword [esp], ecx
call sub.msvcrt.dll_malloc
mov ebx, eax
mov eax, dword [ebp - 0x214]
mov dword [esp], ebx
mov edi, ebx
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcpy
movzx edx, byte [ebp - 0x220]
mov ecx, esi
mov eax, edx
repne scasb al, byte es:[edi]
not ecx
lea eax, [ebx + ecx - 1]
mov dword [eax], 0x2d737a2e
mov dword [eax + 4], 0x646c6f
mov eax, dword [ebp - 0x214]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll__access
test eax, eax
je 0x4118cf
mov eax, dword [ebp - 0x214]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20c]
mov dword [esp], eax
call sub.msvcrt.dll_rename
test eax, eax
jne 0x411824
cmp dword [ebp - 0x21c], 0xffffffff
je 0x411949
lea eax, [ebp - 0x70]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x214]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__stat64]
test eax, eax
je 0x41195b
mov dword [esp], str.stat
call sub.msvcrt.dll_perror
mov dword [esp], ebx
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x214]
mov dword [esp], eax
call sub.msvcrt.dll_free
cmp dword [0x4183fc], 0
jne 0x411798
mov eax, dword [0x4183f0]
mov edx, dword [0x4183f4]
mov dword [esp], str.used__lld_local__fetched__lld_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 0x10], edx
mov edx, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
call sub.msvcrt.dll_printf
mov eax, dword [0x4183f8]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x20c]
mov dword [esp], eax
call sub.msvcrt.dll_free
lea esp, [ebp - 0x10]
xor eax, eax
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov edx, dword [ebp - 0x20c]
mov eax, dword [edx + ebx*4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x218]
mov dword [esp], eax
call fcn.004016b0
jmp 0x411594
cmp eax, 1
je 0x4118b1
add eax, 1
lea esi, [esi]
jne 0x411634
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [ebp - 0x21c]
mov dword [esp + 4], str.Aborting__download_available_in__s_n
add eax, 0x40
mov dword [esp + 8], edx
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call sub.msvcrt.dll_exit
mov dword [esp], 0x41367c
call sub.msvcrt.dll_perror
mov eax, dword [ebp - 0x20c]
mov dword [esp + 4], str.Unable_to_back_up_old_file__s___completed_download_left_in__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x214]
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
jmp 0x41174c
mov dword [esp], str.no_recognised_checksum_found
call sub.msvcrt.dll_puts
jmp 0x411634
mov dword [esp], str.verifying_download...
call sub.msvcrt.dll_printf
jmp 0x411611
mov ecx, dword [ebp - 0x21c]
mov edx, ebx
lea eax, [ebp - 0x1c]
call fcn.00401550
mov ebx, eax
jmp 0x41151e
mov ecx, dword [ebp - 0x214]
mov edx, ebx
lea eax, [ebp - 0x1c]
call fcn.00401550
mov ebx, eax
jmp 0x411500
cmp dword [0x4183fc], 0
jne 0x411634
mov dword [esp], str.checksum_matches_OK
call sub.msvcrt.dll_puts
jmp 0x411634
mov dword [esp], ebx
call sub.msvcrt.dll__unlink
jmp 0x41174c
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x137
mov dword [esp + 4], 1
mov dword [esp], str.No_relevent_local_data_found___I_will_be_downloading_the_whole_file._If_thats_not_what_you_want__CTRL_C_out._You_should_specify_the_local_file_is_the_old_version_of_the_file_to_download_with__i__you_might_have_to_decompress_it_with_gzip__d_first_._Or_perhaps_you_just_have_no_data_that_helps_download_the_file_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4115ce
mov eax, dword [ebp - 0x20c]
mov dword [esp], str.No_filename_specified_for_download___completed_download_left_in__s_n
mov dword [esp + 4], eax
call sub.msvcrt.dll_printf
jmp 0x411762
mov eax, dword [0x412120]
mov eax, dword [esi + eax*4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x218]
mov dword [esp], eax
call fcn.00401980
mov dword [ebp - 0x214], eax
jmp 0x411475
cmp dword [ebp - 0x210], 0xffffffff
jne 0x411722
jmp 0x41174c
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x210]
mov dword [ebp - 0x34], edx
mov edx, dword [ebp - 0x21c]
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x214]
mov dword [ebp - 0x2c], edx
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__utime64]
test eax, eax
je 0x41174c
mov dword [esp], str.utime
call sub.msvcrt.dll_perror
jmp 0x41174c
mov dword [esp], 0x41367c
call sub.msvcrt.dll_perror
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x24
mov dword [esp + 4], 1
mov dword [esp], str._A_takes_hostnameusername:password_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [ebp - 0x21c]
mov dword [esp + 4], str.failed_to_retrieve_all_remaining_blocks___no_valid_download_URLs_remain._Incomplete_transfer_left_in__s._n_If_this_is_the_download_filename_with_.part_appended__zsync_will_automatically_pick_this_up_and_reuse_the_data_it_has_already_done_if_you_retry_in_this_dir.__n
add eax, 0x40
mov dword [esp + 8], edx
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 3
call sub.msvcrt.dll_exit
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x34
mov dword [esp + 4], 1
mov dword [esp], str.Usage:_zsync_http:__example.com_some_filename.zsync_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 3
call sub.msvcrt.dll_exit
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x4e
mov dword [esp + 4], 1
mov dword [esp], str.No_.zsync_file_specified._nUsage:_zsync_http:__example.com_some_filename.zsync_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 3
call sub.msvcrt.dll_exit
mov dword [esp], str.Could_not_find_a_usable_version_of_Winsock.dll
call sub.msvcrt.dll_puts
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov dword [esp + 4], eax
mov dword [esp], str.WSAStartup_failed_with_error:__d_n
call sub.msvcrt.dll_printf
mov dword [esp], 1
call sub.msvcrt.dll_exit
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop