Function at 0x420570
Capabilities:
Check http status code
Link many functions at runtime
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
mov eax, 0x2a34
call fcn.004a99b0
mov eax, dword [0x5512ec]
xor eax, esp
mov dword [esp + 0x2a30], eax
push ebx
push esi
push edi
mov ebx, edx
mov dword [esp + 0x58], ebx
mov edi, ecx
mov eax, dword [ebp + 8]
xorps xmm0, xmm0
mov dword [esp + 0x70], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x3c], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x5c], eax
lea eax, [esp + 0xf8]
mov dword [esp + 0xa4], eax
xor eax, eax
cmp dword [0x59bb60], 0
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov word [esp + 0xac], ax
mov dword [esp + 0xb0], eax
lea eax, [esp + 0x1b8]
mov dword [esp + 0xd0], 0x532454
mov dword [esp + 0xd4], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x64], 0xffffffff
mov dword [esp + 0x84], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x94], 0x3c
mov dword [esp + 0x98], 0
mov dword [esp + 0x9c], 1
mov dword [esp + 0xa0], 0
mov dword [esp + 0xa8], 0x40
mov dword [esp + 0xb4], 1
mov dword [esp + 0xb8], eax
mov dword [esp + 0xbc], 0x80
mov dword [esp + 0xc0], 0
mov dword [esp + 0xc4], 1
movq qword [esp + 0xc8], xmm0
movlpd qword [esp + 0x48], xmm0
jne 0x4206e9
push str.InternetCrackUrlA
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bb60], eax
test eax, eax
jne 0x4206e9
call fcn.0044b6b0
push eax
push str.WinInet
push str.InternetCrackUrlA
push str.Unable_to_locate__s___in__s.dll:__s
call fcn.0044b0b0
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esp + 0x3c]
jmp 0x421213
cmp dword [0x59bc40], 0
jne 0x42071e
push str.InternetConnectA
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bc40], eax
test eax, eax
jne 0x42071e
call fcn.0044b6b0
push eax
push str.WinInet
push str.InternetConnectA
jmp 0x4206cd
cmp dword [0x59bc10], 0
jne 0x420756
push str.InternetReadFile
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bc10], eax
test eax, eax
jne 0x420756
call fcn.0044b6b0
push eax
push str.WinInet
push str.InternetReadFile
jmp 0x4206cd
cmp dword [0x59bb6c], 0
jne 0x42078e
push str.InternetCloseHandle
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bb6c], eax
test eax, eax
jne 0x42078e
call fcn.0044b6b0
push eax
push str.WinInet
push str.InternetCloseHandle
jmp 0x4206cd
cmp dword [0x59bb68], 0
jne 0x4207c6
push str.HttpOpenRequestA
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bb68], eax
test eax, eax
jne 0x4207c6
call fcn.0044b6b0
push eax
push str.WinInet
push str.HttpOpenRequestA
jmp 0x4206cd
cmp dword [0x59bc54], 0
jne 0x4207fe
push str.HttpSendRequestA
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bc54], eax
test eax, eax
jne 0x4207fe
call fcn.0044b6b0
push eax
push str.WinInet
push str.HttpSendRequestA
jmp 0x4206cd
cmp dword [0x59bc38], 0
jne 0x420836
push str.HttpQueryInfoA
push ecx
call fcn.0041f410
add esp, 4
push eax
call esi
mov dword [0x59bc38], eax
test eax, eax
jne 0x420836
call fcn.0044b6b0
push eax
push str.WinInet
push str.HttpQueryInfoA
jmp 0x4206cd
mov eax, dword [esp + 0x5c]
mov dword [0x55a318], 0
mov dword [0x5a2aec], 0x194
test eax, eax
je 0x420868
push 0
push 0
push 0
push 0
push eax
xor edx, edx
or ecx, 0xffffffff
call fcn.0045e120
add esp, 0x14
test edi, edi
jne 0x420883
push 0xd4
push str.D:_a_rufus_rufus_src_net.c
push str.url___NULL
call fcn.004dfbbc
add esp, 0xc
mov esi, dword [esp + 0x3c]
test esi, esi
je 0x420891
mov dword [esi], 0
test ebx, ebx
je 0x4208cb
mov ecx, ebx
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4208a0
sub ecx, edx
je 0x4208c6
nop dword [eax + eax]
mov al, byte [ebx + ecx]
cmp al, 0x2f
je 0x4208c5
cmp al, 0x5c
je 0x4208c5
sub ecx, 1
jne 0x4208b0
lea eax, [ebx + ecx]
jmp 0x4208f9
inc ecx
lea eax, [ebx + ecx]
jmp 0x4208f9
test edi, edi
jne 0x4208d3
xor eax, eax
jmp 0x4208f9
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4208d8
sub ecx, edx
je 0x4208f6
mov al, byte [edi + ecx]
cmp al, 0x2f
je 0x4208f5
cmp al, 0x5c
je 0x4208f5
sub ecx, 1
jne 0x4208e3
jmp 0x4208f6
inc ecx
lea eax, [edi + ecx]
cmp dword [esp + 0x5c], 0
mov dword [esp + 0x44], eax
je 0x420929
push eax
push 0xc0d
push 0x1388
push 0
push 1
call fcn.0041ed70
add esp, 0x14
push edi
push str.Downloading__s
call fcn.0044b0b0
add esp, 8
test edi, edi
jne 0x420931
xor ecx, ecx
jmp 0x42093f
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x420936
sub ecx, edx
lea eax, [esp + 0x94]
push eax
push 0
push ecx
push edi
call dword [0x59bb60]
test eax, eax
je 0x4211fa
cmp dword [esp + 0xa4], 0
je 0x4211fa
cmp dword [esp + 0xc0], 0
je 0x4211fa
mov ecx, dword [esp + 0x70]
mov edx, 1
mov byte [esp + 0x137], 0
call fcn.004202f0
mov dword [esp + 0x84], eax
test eax, eax
jne 0x4209a6
call fcn.0044b6b0
push eax
push str.Could_not_open_Internet_session:__s
jmp 0x421205
push 0
push 0
push 3
push 0
push 0
push dword [esp + 0xc0]
push dword [esp + 0xbc]
push eax
call dword [0x59bc40]
mov ecx, eax
mov dword [esp + 0x80], ecx
test ecx, ecx
jne 0x4209fa
call fcn.0044b6b0
push eax
movzx eax, word [esp + 0xb0]
push eax
push dword [esp + 0xac]
push str.Could_not_connect_to_server__s:_d:__s
call fcn.0044b0b0
add esp, 0x10
jmp 0x42120d
cmp dword [esp + 0xa0], 4
mov edx, 0x488c600
push 0
mov eax, 0x408c600
cmove eax, edx
push eax
lea eax, [esp + 0xd8]
push eax
push 0
push 0
push dword [esp + 0xd4]
push 0x5325ac
push ecx
call dword [0x59bb68]
mov dword [esp + 0x40], eax
test eax, eax
jne 0x420a52
call fcn.0044b6b0
push eax
push edi
push str.Could_not_open_URL__s:__s
call fcn.0044b0b0
add esp, 0xc
jmp 0x42120d
push 0
push 0
push 0xffffffffffffffff
push str.Accept_Encoding:_gzip__deflate
push eax
call dword [0x59bc54]
test eax, eax
jne 0x420a78
call fcn.0044b6b0
push eax
push str.Unable_to_send_request:__s
jmp 0x421205
push 0
lea eax, [esp + 0x78]
mov dword [esp + 0x78], 4
push eax
push 0x5a2aec
push 0x20000013
push dword [esp + 0x50]
call dword [0x59bc38]
cmp dword [0x5a2aec], 0xc8
je 0x420ae8
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
push 0xc0192efc
mov dword [0x59bc14], 0x2efc
call eax
mov eax, dword [0x5a2aec]
mov edx, str.Unable_to_access_file
cmp eax, 0x194
mov ecx, str.File_not_found
push eax
cmovne ecx, edx
push ecx
push str._s:__d
call fcn.0044b0b0
add esp, 0xc
jmp 0x42120d
push 0
lea eax, [esp + 0x78]
mov dword [esp + 0x78], 0x20
push eax
lea eax, [esp + 0xe0]
push eax
push 5
push dword [esp + 0x50]
call dword [0x59bc38]
test eax, eax
jne 0x420b1f
call fcn.0044b6b0
push eax
push str.Unable_to_retrieve_file_length:__s
jmp 0x421205
push 0xa
lea eax, [esp + 0xdc]
push 0
push eax
call fcn.004e4477
add esp, 0xc
mov dword [esp + 0x70], eax
cmp dword [esp + 0x5c], 0
mov ecx, edx
mov dword [esp + 0x78], ecx
je 0x420eaa
cmp dword [0x55a760], 0
mov edx, 0x52ad5a
mov esi, 0x5393fc
cmove esi, edx
mov edx, ecx
mov ecx, eax
call fcn.004a9840
mov ecx, dword [0x55a740]
movaps xmm1, xmm0
movsd xmm2, qword [0x549a18]
xor eax, eax
movsd qword [esp + 0x68], xmm1
movsd xmm1, qword [0x549a90]
movsd qword [esp + 0x50], xmm0
nop dword [eax]
comisd xmm1, xmm0
ja 0x420ba6
mulsd xmm0, xmm2
inc eax
movsd qword [esp + 0x50], xmm0
cmp eax, 5
jl 0x420b90
test eax, eax
jne 0x420bcf
push dword [ecx + 0x50]
cvttsd2si eax, xmm0
push esi
push eax
push esi
push str._s_d_s__s
push 0x20
push 0x59d920
call fcn.004050d0
add esp, 0x1c
mov esi, str._s_0.0f_s__s
jmp 0x420c4a
push dword [ecx + eax*4 + 0x50]
fld qword [esp + 0x54]
push esi
sub esp, 8
movsd qword [esp], xmm0
mulsd xmm0, qword [0x549a70]
push esi
sub esp, 8
movsd qword [esp + 0xa4], xmm0
fstp qword [esp]
call fcn.00511880
movsd xmm1, qword [esp + 0xa4]
add esp, 8
fstp qword [esp + 0x64]
movsd xmm0, qword [esp + 0x64]
mov esi, str._s_0.0f_s__s
mulsd xmm0, qword [0x549a70]
mov ecx, str._s_0.1f_s__s
mov eax, esi
subsd xmm1, xmm0
movsd xmm0, qword [0x549a40]
comisd xmm0, xmm1
cmovbe eax, ecx
push eax
push 0x20
push 0x59d920
call fcn.004050d0
add esp, 0x20
push 0x59d920
push str.File_length:__s
mov byte [0x59d93f], 0
call fcn.0044b0b0
movsd xmm0, qword [esp + 0x70]
xor eax, eax
mov ecx, dword [0x55a740]
add esp, 8
movsd xmm1, qword [0x549a90]
movsd xmm2, qword [0x549a18]
movsd qword [esp + 0x50], xmm0
cmp dword [0x55a760], eax
je 0x420d83
comisd xmm1, xmm0
ja 0x420ca9
mulsd xmm0, xmm2
inc eax
movsd qword [esp + 0x50], xmm0
cmp eax, 5
jl 0x420c93
test eax, eax
jne 0x420cd8
push dword [ecx + 0x50]
cvttsd2si eax, xmm0
push 0x5393fc
push eax
push 0x5393fc
push str._s_d_s__s
push 0x20
push 0x59d920
call fcn.004050d0
add esp, 0x1c
jmp 0x420d5a
push dword [ecx + eax*4 + 0x50]
fld qword [esp + 0x54]
push 0x5393fc
sub esp, 8
movsd qword [esp], xmm0
mulsd xmm0, qword [0x549a70]
push 0x5393fc
sub esp, 8
movsd qword [esp + 0x84], xmm0
fstp qword [esp]
call fcn.00511880
movsd xmm1, qword [esp + 0x84]
add esp, 8
fstp qword [esp + 0x9c]
movsd xmm0, qword [esp + 0x9c]
mov eax, str._s_0.1f_s__s
mulsd xmm0, qword [0x549a70]
subsd xmm1, xmm0
movsd xmm0, qword [0x549a40]
comisd xmm0, xmm1
cmovbe esi, eax
push esi
push 0x20
push 0x59d920
call fcn.004050d0
add esp, 0x20
mov ecx, edi
mov byte [0x59d93f], 0
lea esi, [esp + 0x138]
mov dword [esp + 0x68], str.__s___s
call fcn.00420160
mov ecx, eax
mov eax, 0x59d920
jmp 0x420e6c
comisd xmm1, xmm0
ja 0x420d99
mulsd xmm0, xmm2
inc eax
movsd qword [esp + 0x50], xmm0
cmp eax, 5
jl 0x420d83
test eax, eax
jne 0x420dc8
push dword [ecx + 0x50]
cvttsd2si eax, xmm0
push 0x52ad5a
push eax
push 0x52ad5a
push str._s_d_s__s
push 0x20
push 0x59d920
call fcn.004050d0
add esp, 0x1c
jmp 0x420e4a
push dword [ecx + eax*4 + 0x50]
fld qword [esp + 0x54]
push 0x52ad5a
sub esp, 8
movsd qword [esp], xmm0
mulsd xmm0, qword [0x549a70]
push 0x52ad5a
sub esp, 8
movsd qword [esp + 0x84], xmm0
fstp qword [esp]
call fcn.00511880
movsd xmm1, qword [esp + 0x84]
add esp, 8
fstp qword [esp + 0x9c]
movsd xmm0, qword [esp + 0x9c]
mov eax, str._s_0.1f_s__s
mulsd xmm0, qword [0x549a70]
subsd xmm1, xmm0
movsd xmm0, qword [0x549a40]
comisd xmm0, xmm1
cmovbe esi, eax
push esi
push 0x20
push 0x59d920
call fcn.004050d0
add esp, 0x20
mov ecx, edi
mov byte [0x59d93f], 0
lea esi, [esp + 0x138]
mov dword [esp + 0x68], 0x532644
call fcn.00420160
mov ecx, 0x59d920
push ecx
push eax
push dword [esp + 0x70]
push 0x80
push esi
call fcn.004050d0
add esp, 0x14
mov byte [esp + 0x1b7], 0
lea eax, [esp + 0x138]
push eax
push 0xc0d
push 0x1388
push 0
push 0
call fcn.0041ed70
mov esi, dword [esp + 0x50]
add esp, 0x14
test ebx, ebx
je 0x420f87
cmp byte [ebx], 0
jne 0x420ec7
push 2
push 1
call fcn.004b6706
add esp, 8
mov esi, eax
jmp 0x420f19
push 0
push 0
push 0xffffffffffffffff
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0xfde9
call ebx
mov edi, eax
cmp edi, 1
jle 0x420f13
push 2
push edi
call fcn.004b6706
mov esi, eax
add esp, 8
test esi, esi
je 0x420f13
push edi
push esi
push 0xffffffffffffffff
push dword [esp + 0x64]
push 0
push 0xfde9
call ebx
cmp eax, edi
je 0x420f15
push esi
call fcn.004d1211
add esp, 4
xor esi, esi
mov ebx, dword [esp + 0x58]
push 0
push 0x80
push 2
push 0
push 1
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x64], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test esi, esi
je 0x420f4b
push esi
call fcn.004d1211
add esp, 4
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
push edi
call eax
cmp dword [esp + 0x64], 0xffffffff
jne 0x42103c
call fcn.0044b6b0
push eax
push dword [esp + 0x48]
push str.Unable_to_create_file__s:__s
call fcn.0044b0b0
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x59bc14], eax
xor edi, edi
jmp 0x42121e
test esi, esi
jne 0x421005
push str.No_buffer_pointer_provided_for_download
call fcn.0044b0b0
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x59bc14], eax
xor edi, edi
mov eax, dword [esp + 0x40]
push eax
call dword [0x59bb6c]
mov eax, dword [esp + 0x80]
test eax, eax
je 0x420fc2
push eax
call dword [0x59bb6c]
mov eax, dword [esp + 0x84]
test eax, eax
je 0x420fd4
push eax
call dword [0x59bb6c]
push dword [0x59bc14]
call dword [sym.imp.KERNEL32.dll_SetLastError]
test edi, edi
je 0x42124e
mov eax, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2a30]
xor ecx, esp
call fcn.004a8b60
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0x70]
push 1
lea eax, [edi + 1]
push eax
call fcn.004b6706
add esp, 8
mov dword [esi], eax
test eax, eax
jne 0x421040
push str.Could_not_allocate_buffer_for_download
call fcn.0044b0b0
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x59bc14], eax
xor edi, edi
jmp 0x42122d
mov edi, dword [esp + 0x70]
test dword [0x55a318], 0x80000000
jne 0x4211c6
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [esp + 0x60]
push eax
push 0x2800
lea eax, [esp + 0x240]
push eax
push dword [esp + 0x4c]
call dword [0x59bc10]
test eax, eax
je 0x421151
mov eax, dword [esp + 0x60]
test eax, eax
je 0x421151
cmp dword [esp + 0x5c], 0
je 0x4210b2
push 0
push dword [esp + 0x7c]
mov edx, 0xca9
mov ecx, 0xfffffffe
push edi
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0045e120
mov eax, dword [esp + 0x74]
add esp, 0x14
test ebx, ebx
je 0x4210fa
push 0
lea ecx, [esp + 0x94]
push ecx
push eax
lea eax, [esp + 0x244]
push eax
push dword [esp + 0x74]
call esi
test eax, eax
je 0x421138
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x90]
cmp eax, ecx
je 0x42111a
push eax
push ecx
push dword [esp + 0x4c]
push str.Error_writing_file__s:_Only__d__d_bytes_written
call fcn.0044b0b0
add esp, 0x10
jmp 0x4211c6
push eax
lea eax, [esp + 0x23c]
push eax
mov eax, dword [esp + 0x44]
mov eax, dword [eax]
add eax, dword [esp + 0x50]
push eax
call fcn.004aab70
mov eax, dword [esp + 0x6c]
add esp, 0xc
add dword [esp + 0x48], eax
adc dword [esp + 0x4c], 0
test dword [0x55a318], 0x80000000
je 0x421056
jmp 0x4211c6
call fcn.0044b6b0
push eax
push dword [esp + 0x48]
push str.Error_writing_file__s:__s
call fcn.0044b0b0
add esp, 0xc
jmp 0x4211c6
mov eax, dword [esp + 0x78]
cmp dword [esp + 0x48], edi
jne 0x4211a5
cmp dword [esp + 0x4c], eax
jne 0x4211a5
cmp dword [esp + 0x5c], 0
mov dword [0x5a2aec], 0xc8
mov dword [esp + 0x7c], 1
je 0x4211c6
push 0
push eax
push edi
push eax
push edi
mov edx, 0xca9
mov ecx, 0xfffffffe
call fcn.0045e120
add esp, 0x14
push dword [esp + 0x44]
push str.Successfully_downloaded__s
call fcn.0044b0b0
add esp, 8
jmp 0x4211c6
push eax
push edi
push dword [esp + 0x54]
push dword [esp + 0x54]
push str.Could_not_download_complete_file___read:__lld_bytes__expected:__lld_bytes
call fcn.0044b0b0
add esp, 0x14
mov dword [0x55a318], 0xc003001d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esp + 0x64]
mov dword [0x59bc14], eax
cmp esi, 0xffffffff
je 0x4211e8
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 0x7c]
test edi, edi
jne 0x420fa5
mov esi, dword [esp + 0x3c]
jmp 0x42121a
call fcn.0044b6b0
push eax
push str.Unable_to_decode_URL:__s
call fcn.0044b0b0
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
mov dword [0x59bc14], eax
test ebx, ebx
je 0x421229
mov ecx, ebx
call fcn.0041f770
mov esi, dword [esp + 0x3c]
test esi, esi
je 0x42123d
push dword [esi]
call fcn.004d1211
add esp, 4
mov dword [esi], 0
mov eax, dword [esp + 0x40]
test eax, eax
je 0x420fb0
jmp 0x420fa9
mov ecx, dword [esp + 0x2a3c]
xorps xmm0, xmm0
pop edi
pop esi
movlpd qword [esp + 0x48], xmm0
mov eax, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
pop ebx
xor ecx, esp
call fcn.004a8b60
mov esp, ebp
pop ebp
ret