Function at 0x401c37
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x8c
mov dword [ebp - 0x38], 0x77359400
mov dword [ebp - 0x34], 0
mov eax, dword [0x416230]
mov edx, dword [0x416234]
push dword [ebp - 0x34]
push dword [ebp - 0x38]
push edx
push eax
call sym.___divdi3
add esp, 0x10
mov dword [ebp - 0x30], eax
mov eax, dword [0x416230]
mov edx, dword [0x416234]
mov esi, eax
mov eax, dword [ebp - 0x30]
mov edx, eax
sar edx, 0x1f
mov ecx, dword [ebp - 0x38]
imul ecx, edx
mov ebx, dword [ebp - 0x34]
imul ebx, eax
add ecx, ebx
mul dword [ebp - 0x38]
add ecx, edx
mov edx, ecx
mov edx, esi
sub edx, eax
mov eax, edx
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x30]
inc eax
mov edx, eax
sar edx, 0x1f
mov ecx, dword [ebp - 0x38]
imul ecx, edx
mov ebx, dword [ebp - 0x34]
imul ebx, eax
add ecx, ebx
mul dword [ebp - 0x38]
add ecx, edx
mov edx, ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x20], 0
cmp dword [ebp - 0x2c], 0
je 0x401cf6
lea eax, [ebp - 0x65]
mov dword [ebp - 0x20], eax
sub esp, 4
push dword [ebp - 0x2c]
push str.Range:_bytes_d_
lea eax, [ebp - 0x65]
push eax
call sym._sprintf
add esp, 0x10
mov eax, dword [0x416210]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x30], 0
je 0x401d23
mov eax, dword [ebp - 0x30]
inc eax
mov edx, dword [0x416210]
sub esp, 4
push eax
push edx
push str._1_s_._2_d_
call sym._format_string
add esp, 0x10
mov dword [ebp - 0x1c], eax
mov eax, dword [0x416200]
sub esp, 4
push 0
push dword [ebp - 0x20]
push dword [ebp - 0x1c]
push eax
push 0x40b216
push 0
lea eax, [ebp - 0x4c]
push eax
call sym._net_request
add esp, 0x20
test eax, eax
je 0x401d73
cmp dword [ebp - 0x30], 0
je 0x401d5f
sub esp, 0xc
push dword [ebp - 0x1c]
call sym._free
add esp, 0x10
mov eax, dword [ebp - 0x4c]
sub esp, 0xc
push eax
call sym._report_net_error
add esp, 0x10
jmp 0x4020f3
cmp dword [ebp - 0x30], 0
je 0x401d87
sub esp, 0xc
push dword [ebp - 0x1c]
call sym._free
add esp, 0x10
sub esp, 0xc
push 0x4161d0
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [0x4161b0]
test eax, eax
je 0x401dd5
sub esp, 0xc
push 0x4161d0
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
sub esp, 0xc
lea eax, [ebp - 0x4c]
push eax
call sym._net_close
add esp, 0x10
mov eax, dword [0x4161b0]
sub esp, 0xc
push eax
call sym._call_in_main_thread
add esp, 0x10
jmp 0x4020f3
lea eax, [ebp - 0x4c]
mov dword [0x4161f0], eax
sub esp, 0xc
push 0x4161d0
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x94], ecx
cmp dword [ebp - 0x2c], 0
je 0x401e08
mov dword [ebp - 0x90], 0xce
jmp 0x401e12
mov dword [ebp - 0x90], 0xc8
mov ebx, dword [ebp - 0x90]
cmp dword [ebp - 0x94], ebx
je 0x401e89
sub esp, 0xc
lea eax, [ebp - 0x4c]
push eax
call sym._net_close
add esp, 0x10
cmp dword [ebp - 0x2c], 0
je 0x401e41
mov dword [ebp - 0x8c], 0xce
jmp 0x401e4b
mov dword [ebp - 0x8c], 0xc8
mov eax, dword [ebp - 0x40]
sub esp, 4
push dword [ebp - 0x8c]
push eax
push str.Server_did_not_accept_the_request.__Server_replied_with_HTTP_status:__1_d___expected__2_d__
call sym._format_string
add esp, 0x10
mov dword [ebp - 0x18], eax
sub esp, 0xc
push dword [ebp - 0x18]
call sym._report_error
add esp, 0x10
sub esp, 0xc
push dword [ebp - 0x18]
call sym._free
add esp, 0x10
jmp 0x4020f3
mov eax, dword [0x416da0]
push 0
push 0
push 0x402
push eax
call sub.USER32.dll_PostMessageA
jmp 0x40206e
lea eax, [ebp - 0x6c]
push eax
push 0x8000
push 0x40e010
lea eax, [ebp - 0x4c]
push eax
call sym._net_read
add esp, 0x10
test eax, eax
je 0x401ed4
mov eax, dword [ebp - 0x4c]
sub esp, 0xc
push eax
call sym._report_net_error
add esp, 0x10
jmp 0x4020f3
mov eax, dword [ebp - 0x6c]
test eax, eax
jne 0x401eff
sub esp, 0xc
lea eax, [ebp - 0x4c]
push eax
call sym._net_close
add esp, 0x10
sub esp, 0xc
push str.Unexpected_end_of_stream_while_reading_from_server.
call sym._report_error
add esp, 0x10
jmp 0x4020f3
mov dword [ebp - 0x14], 0x40e010
mov eax, dword [0x416290]
mov edx, dword [0x416294]
or eax, edx
test eax, eax
je 0x40203d
mov eax, dword [ebp - 0x6c]
test eax, eax
je 0x40205e
mov eax, dword [ebp - 0x6c]
mov edx, eax
sar edx, 0x1f
mov esi, dword [0x416290]
mov edi, dword [0x416294]
mov dword [ebp - 0x88], esi
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x7c], edx
mov edi, dword [ebp - 0x84]
cmp dword [ebp - 0x7c], edi
jl 0x401f7f
mov eax, dword [ebp - 0x84]
cmp dword [ebp - 0x7c], eax
jg 0x401f6d
mov edx, dword [ebp - 0x88]
cmp dword [ebp - 0x80], edx
jbe 0x401f7f
mov ecx, dword [ebp - 0x88]
mov ebx, dword [ebp - 0x84]
mov dword [ebp - 0x80], ecx
mov dword [ebp - 0x7c], ebx
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x70], eax
mov edx, dword [ebp - 0x70]
mov ecx, dword [0x416270]
sub esp, 0xc
push 0
lea eax, [ebp - 0x70]
push eax
push edx
push dword [ebp - 0x14]
push ecx
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
jne 0x401fd2
call sub.KERNEL32.dll_GetLastError
sub esp, 8
push eax
push 0x40b2ac
call sym._report_system_error
add esp, 0x10
sub esp, 0xc
lea eax, [ebp - 0x4c]
push eax
call sym._net_close
add esp, 0x10
jmp 0x4020f3
mov eax, dword [ebp - 0x70]
mov ecx, eax
mov ebx, 0
mov eax, dword [0x416230]
mov edx, dword [0x416234]
add eax, ecx
adc edx, ebx
mov dword [0x416230], eax
mov dword [0x416234], edx
mov eax, dword [ebp - 0x70]
add dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x6c]
mov edx, eax
mov eax, dword [ebp - 0x70]
mov ebx, edx
sub ebx, eax
mov eax, ebx
mov dword [ebp - 0x6c], eax
mov ecx, dword [0x416290]
mov ebx, dword [0x416294]
mov eax, dword [ebp - 0x70]
mov edx, 0
mov esi, ecx
mov edi, ebx
sub esi, eax
sbb edi, edx
mov eax, esi
mov edx, edi
mov dword [0x416290], eax
mov dword [0x416294], edx
jmp 0x401f06
call sym._begin_next_file
test eax, eax
je 0x401f06
sub esp, 0xc
lea eax, [ebp - 0x4c]
push eax
call sym._net_close
add esp, 0x10
jmp 0x4020f3
sub esp, 0xc
push sym._on_progress
call sym._call_in_main_thread
add esp, 0x10
mov eax, dword [0x416230]
mov edx, dword [0x416234]
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x74], edx
mov edx, dword [ebp - 0x74]
cmp edx, dword [ebp - 0x24]
jl 0x401ea2
mov ecx, dword [ebp - 0x74]
cmp ecx, dword [ebp - 0x24]
jg 0x40209f
mov ebx, dword [ebp - 0x78]
cmp ebx, dword [ebp - 0x28]
jb 0x401ea2
sub esp, 0xc
push 0x4161d0
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov dword [0x4161f0], 0
sub esp, 0xc
push 0x4161d0
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
sub esp, 0xc
lea eax, [ebp - 0x4c]
push eax
call sym._net_close
add esp, 0x10
inc dword [ebp - 0x30]
mov dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x34]
add dword [ebp - 0x28], eax
adc dword [ebp - 0x24], edx
jmp 0x401ccc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret