Function at 0x499f20
Capabilities:
Get file size
Reference http user-agent string

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x754
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, ecx
push edi
lea ecx, [ebp + 8]
push ecx
xor edi, edi
mov ecx, esi
mov dword [ebp - 8], edi
mov byte [ebp - 1], 0
mov dword [ebp + 8], eax
call fcn.00497f20
test al, al
sete al
mov byte [esi + 0x10], al
test al, al
je 0x499f58
mov byte [esi + 0x11], 0
mov edx, dword [ebp + 0xc]
lea eax, [ebp - 0x10]
push eax
mov ecx, esi
mov dword [ebp - 0x10], edx
call fcn.00497f20
push 0x10000
call fcn.004412a0
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xc], eax
mov eax, 1
mov dword [ebp - 0x2c], eax
mov dword [ebp + 0xc], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov eax, dword [esi + 0xc]
add esp, 4
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x38], 0x50
cmp eax, edi
je 0x499fcf
mov ecx, dword [esi + 0x1c]
cmp ecx, edi
je 0x499fb9
cmp ecx, 0xffffffff
je 0x499fb9
push ecx
mov ecx, dword [eax + 0xc]
call ecx
test eax, eax
jne 0x499fb9
call ebx
mov eax, dword [esi + 0x18]
cmp eax, edi
je 0x499fcf
mov edx, dword [esi + 0xc]
push eax
mov eax, dword [edx + 0xc]
call eax
test eax, eax
jne 0x499fcf
call ebx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
mov dword [esi + 0x1c], edi
mov dword [esi + 0x18], edi
mov dword [esi + 0x24], edi
mov dword [esi + 0x20], edi
mov dword [ecx], 0xffffffff
cmp eax, edi
je 0x49a75a
cmp word [eax], di
je 0x49a75a
mov ebx, dword [ebp - 0x10]
cmp ebx, edi
je 0x49a75a
cmp word [ebx], di
je 0x49a75a
cmp dword [ebp - 0xc], edi
jne 0x49a027
push 0x10000
push str.Failed_to_allocate_memory___u_bytes_
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
mov eax, dword [ebp + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
test eax, eax
je 0x49a039
cmp eax, 0xffffffff
jne 0x49a063
push 0
push 0
push 3
push 0
push 1
push 0x40000000
push ebx
call edi
mov dword [ebp + 0x10], eax
test eax, eax
je 0x49a744
cmp eax, 0xffffffff
je 0x49a744
mov byte [ebp - 1], 1
cmp byte [esi + 0x10], 0
je 0x49a5ec
mov eax, dword [esi + 0x34]
cmp byte [eax + 0xa], 0
je 0x49a096
mov eax, dword [eax + 0xc]
test eax, eax
je 0x49a08f
cmp word [eax], 0
je 0x49a08f
mov dword [ebp + 0xc], 3
mov dword [ebp - 0x18], eax
jmp 0x49a096
mov dword [ebp + 0xc], 0
mov edi, dword [ebp + 8]
mov edx, 7
mov ecx, str.http:__
mov eax, edi
mov bx, word [eax]
cmp bx, word [ecx]
jne 0x49a124
add eax, 2
add ecx, 2
sub edx, 1
jne 0x49a0a5
mov ebx, dword [ebp + 8]
add ebx, 0xe
push 0x2f
push ebx
call fcn.004b03ac
mov edi, eax
add esp, 8
test edi, edi
je 0x49a5d5
cmp edi, ebx
je 0x49a5d5
sub eax, dword [ebp + 8]
lea ecx, [eax - 0xe]
and ecx, 0xfffffffe
cmp ecx, 0x208
jge 0x49a5d5
add eax, 0xfffffff4
sar eax, 1
push eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpynW]
lea edx, [ebp - 0x344]
push edx
call ebx
cmp word [edi + 2], 0
jne 0x49a148
mov eax, dword [ebp + 8]
push 0
push eax
push str.Invalid_server_path_specified__n_s
mov ecx, esi
call fcn.00498100
jmp 0x49a783
mov dx, bx
cmp dx, word [ecx]
sbb eax, eax
and eax, 0xfffffffe
add eax, 1
je 0x49a0b8
push 0
push edi
push str.Only_http_addresses_are_supported__n_s
mov ecx, esi
call fcn.00498100
jmp 0x49a783
push 0x208
push edi
lea ecx, [ebp - 0x754]
push ecx
call ebx
cmp dword [esi + 0x6c], 0
jne 0x49a783
cmp dword [esi + 0x14], 0
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
jne 0x49a265
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp + 0xc]
mov edx, dword [esi + 0xc]
mov ecx, dword [edx + 0x14]
push 0
push 0
push edi
push eax
push str.Mozilla_5.0__compatible__ConEmu_Update_
call ecx
mov dword [esi + 0x14], eax
test eax, eax
jne 0x49a1a9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Network_initialization_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
cmp dword [esi + 0x6c], 0
jne 0x49a783
test edi, edi
je 0x49a249
mov edx, dword [esi + 0x34]
mov eax, dword [edx + 0x10]
test eax, eax
je 0x49a202
cmp word [eax], 0
je 0x49a202
mov edi, dword [esi + 0xc]
push eax
add edi, 0x1c
call ebx
mov edx, dword [esi + 0x14]
push eax
mov eax, dword [esi + 0x34]
mov ecx, dword [eax + 0x10]
mov eax, dword [edi]
push ecx
push 0x2b
push edx
call eax
test eax, eax
jne 0x49a202
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ProxyUserName_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
mov ecx, dword [esi + 0x34]
mov eax, dword [ecx + 0x14]
test eax, eax
je 0x49a249
cmp word [eax], 0
je 0x49a249
mov edi, dword [esi + 0xc]
push eax
add edi, 0x1c
call ebx
mov edx, dword [esi + 0x34]
mov ecx, dword [esi + 0x14]
push eax
mov eax, dword [edx + 0x14]
mov edx, dword [edi]
push eax
push 0x2c
push ecx
call edx
test eax, eax
jne 0x49a249
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ProxyPassword_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
mov eax, dword [esi + 0xc]
mov edx, dword [esi + 0x14]
mov eax, dword [eax + 0x1c]
push 8
lea ecx, [ebp - 0x34]
push ecx
push 0x3b
push edx
call eax
test eax, eax
je 0x49a4ba
cmp dword [esi + 0x5c], 0
lea edi, [esi + 0x5c]
jne 0x49a28e
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 0x14]
lea edx, [ebp - 0x24]
push edx
push edi
push 6
mov dword [ebp - 0x24], 4
mov ecx, dword [ecx + 0x20]
push eax
call ecx
test eax, eax
jne 0x49a28e
mov dword [edi], eax
mov eax, dword [edi]
mov ecx, dword [esi + 0x58]
mov dword [ebp - 0x1c], eax
cmp eax, ecx
ja 0x49a29d
mov dword [ebp - 0x1c], ecx
mov edx, dword [esi + 0xc]
mov ecx, dword [esi + 0x14]
mov edx, dword [edx + 0x1c]
push 4
lea eax, [ebp - 0x1c]
push eax
push 6
push ecx
call edx
test eax, eax
jne 0x49a2eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [ebp - 0x1c]
push edi
push eax
lea ecx, [ebp - 0x13c]
push str.INTERNET_OPTION_RECEIVE_TIMEOUT_mh_Internet__u__failed__code_u
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push edi
lea edx, [ebp - 0x13c]
push edx
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
cmp dword [esi + 0x60], 0
lea ebx, [esi + 0x60]
jne 0x49a314
mov eax, dword [esi + 0xc]
mov edx, dword [esi + 0x14]
lea ecx, [ebp - 0x24]
push ecx
push ebx
push 8
mov dword [ebp - 0x24], 4
mov eax, dword [eax + 0x20]
push edx
call eax
test eax, eax
jne 0x49a314
mov dword [edi], eax
mov ebx, dword [ebx]
mov eax, dword [esi + 0x58]
mov dword [ebp - 0x20], ebx
cmp ebx, eax
ja 0x49a323
mov dword [ebp - 0x20], eax
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + 0x1c]
push 4
lea edx, [ebp - 0x20]
push edx
push 8
push eax
call ecx
test eax, eax
jne 0x49a371
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x20]
mov edi, eax
push edi
push edx
lea eax, [ebp - 0x13c]
push str.INTERNET_OPTION_DATA_RECEIVE_TIMEOUT_mh_Internet__u__failed__code_u
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push edi
lea ecx, [ebp - 0x13c]
push ecx
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
lea edx, [ebp - 0x344]
push 0x3a
push edx
call fcn.004b135e
add esp, 8
mov dword [ebp - 0x28], eax
test eax, eax
je 0x49a3b2
xor ecx, ecx
mov word [eax], cx
mov eax, dword [ebp - 0x28]
push 0xa
lea edx, [ebp - 0x28]
push edx
add eax, 2
push eax
call fcn.004b0706
movzx eax, ax
add esp, 0xc
test ax, ax
jne 0x49a3b5
mov eax, 0x50
jmp 0x49a3b5
mov eax, dword [ebp - 0x38]
mov ecx, dword [esi + 0xc]
mov ecx, dword [ecx + 0x10]
push 1
push 0
push 3
push 0
push 0
push eax
mov eax, dword [esi + 0x14]
lea edx, [ebp - 0x344]
push edx
push eax
call ecx
mov dword [esi + 0x18], eax
test eax, eax
jne 0x49a402
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x30], 0
jne 0x49a3f0
cmp dword [ebp + 0x18], 0
je 0x49a783
push eax
push str.Connection_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
cmp dword [ebp - 0x18], 0
je 0x49a4a2
mov edx, dword [esi + 0x34]
mov eax, dword [edx + 0x10]
test eax, eax
je 0x49a457
cmp word [eax], 0
je 0x49a457
mov edi, dword [esi + 0xc]
push eax
add edi, 0x1c
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [esi + 0x18]
push eax
mov eax, dword [esi + 0x34]
mov ecx, dword [eax + 0x10]
mov eax, dword [edi]
push ecx
push 0x2b
push edx
call eax
test eax, eax
jne 0x49a457
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ProxyUserName_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
mov ecx, dword [esi + 0x34]
mov eax, dword [ecx + 0x14]
test eax, eax
je 0x49a4a2
cmp word [eax], 0
je 0x49a4a2
mov edi, dword [esi + 0xc]
push eax
add edi, 0x1c
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [esi + 0x34]
mov ecx, dword [esi + 0x18]
push eax
mov eax, dword [edx + 0x14]
mov edx, dword [edi]
push eax
push 0x2c
push ecx
call edx
test eax, eax
jne 0x49a4a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ProxyPassword_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
mov eax, dword [esi + 0xc]
mov edx, dword [esi + 0x18]
mov eax, dword [eax + 0x1c]
push 8
lea ecx, [ebp - 0x34]
push ecx
push 0x3b
push edx
call eax
test eax, eax
jne 0x49a4d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HttpVersion_failed__code_u
mov ecx, esi
call fcn.004980a0
jmp 0x49a783
cmp dword [esi + 0x6c], 0
jne 0x49a783
inc dword [esi + 0x2c]
mov eax, dword [esi + 0x2c]
mov ecx, dword [esi + 0xc]
mov ecx, dword [ecx]
push eax
mov eax, dword [esi + 0x18]
push 0x84400100
push 0
push 0
push str.HTTP_1.1
lea edx, [ebp - 0x754]
push edx
push 0x4e2f8c
push eax
call ecx
mov dword [esi + 0x1c], eax
test eax, eax
je 0x49a59e
cmp eax, 0xffffffff
je 0x49a59e
mov edx, dword [esi + 0xc]
push 0
push 0
push 0
push 0
push eax
mov eax, dword [edx + 8]
call eax
test eax, eax
jne 0x49a55d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x30], 0
jne 0x49a547
cmp dword [ebp + 0x18], 0
je 0x49a783
mov ecx, dword [ebp + 8]
push eax
push ecx
push str.HttpSendRequest_failed_nURL_s_ncode_u
mov ecx, esi
call fcn.00498100
jmp 0x49a783
mov edx, dword [esi + 0xc]
lea ecx, [ebp + 0x18]
push ecx
lea ecx, [ebp + 0xc]
push ecx
lea eax, [esi + 0x20]
push eax
mov dword [eax], 0
mov eax, dword [esi + 0x1c]
push 0x20000005
mov dword [ebp + 0xc], 4
mov dword [ebp + 0x18], 0
mov ecx, dword [edx + 4]
push eax
call ecx
test eax, eax
jne 0x49a62a
mov dword [esi + 0x20], eax
jmp 0x49a62a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x30], 0
jne 0x49a5b4
cmp dword [ebp + 0x18], 0
je 0x49a783
mov ecx, str.HttpOpenRequest_failed_nURL_s_ncode_u__Internet_is_offline_
cmp eax, 2
je 0x49a5c3
mov ecx, str.HttpOpenRequest_failed_nURL_s_ncode_u
mov edx, dword [ebp + 8]
push eax
push edx
push ecx
mov ecx, esi
call fcn.00498100
jmp 0x49a783
mov eax, dword [ebp + 8]
push 0
push eax
push str.Invalid_server_specified__n_s
mov ecx, esi
call fcn.00498100
jmp 0x49a783
mov ebx, dword [ebp + 8]
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
push ebx
call edi
mov dword [esi + 0x1c], eax
test eax, eax
je 0x49a72e
cmp eax, 0xffffffff
je 0x49a72e
lea ecx, [ebp - 0x3c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x49a62a
mov edx, dword [ebp - 0x3c]
mov dword [esi + 0x20], edx
cmp dword [esi + 0x6c], 0
jne 0x49a783
mov edi, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x10]
lea ebx, [ebx]
mov ecx, dword [esi + 0x1c]
movzx edx, byte [esi + 0x10]
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp + 8]
push 0x10000
push edi
push ecx
push edx
push eax
mov ecx, esi
call fcn.00499100
test eax, eax
je 0x49a783
mov edx, dword [ebp - 0x14]
test edx, edx
je 0x49a6e4
mov eax, dword [ebp + 0x14]
push edi
call fcn.00497ac0
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0x10]
add esp, 4
push ecx
push edi
push edx
push ebx
mov ecx, esi
call fcn.00499190
test eax, eax
je 0x49a783
cmp dword [ebp - 0x2c], 0
je 0x49a6bb
mov dword [ebp - 0x2c], 0
mov ecx, edi
mov al, byte [ecx]
cmp al, 0x20
je 0x49a6b3
cmp al, 0xd
je 0x49a6b3
cmp al, 0xa
je 0x49a6b3
cmp al, 9
jne 0x49a6b6
inc ecx
jmp 0x49a6a1
cmp byte [ecx], 0x3c
je 0x49a713
mov eax, dword [ebp - 0x14]
add dword [esi + 0x24], eax
cmp dword [0x50b384], 0
je 0x49a6d5
mov ecx, dword [0x50b39c]
call fcn.0040c600
cmp dword [esi + 0x6c], 0
je 0x49a640
jmp 0x49a783
cmp dword [esi + 0x24], 0
jne 0x49a701
mov ecx, dword [ebp + 8]
push 0
push ecx
push str.Invalid_source_file___s___file_is_empty
mov ecx, esi
call fcn.00498100
jmp 0x49a783
mov eax, dword [ebp + 0x14]
mov edx, dword [eax]
not edx
mov dword [eax], edx
mov dword [ebp - 8], 1
jmp 0x49a783
cmp dword [esi + 0x30], 0
je 0x49a783
mov eax, dword [ebp + 8]
push 0
push ebx
push eax
push str.Remote_file_not_found_nURL:__s_nLocal:__s
mov ecx, esi
call fcn.00498180
jmp 0x49a783
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.Failed_to_open_source_file__s___code_u
mov ecx, esi
call fcn.00498100
jmp 0x49a783
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.Failed_to_create_target_file__s___code_u
mov ecx, esi
call fcn.00498100
jmp 0x49a783
push 0x7e
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x49a783
push 0
push str.DownloadFile._Invalid_arguments
push edi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push edi
mov ecx, esi
call fcn.00498000
cmp byte [esi + 0x10], 0
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x49a7a4
mov edi, dword [ebp - 8]
test edi, edi
sete cl
movzx edx, cl
push edx
mov ecx, esi
call fcn.00497f80
jmp 0x49a7bd
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x49a7b3
cmp eax, 0xffffffff
je 0x49a7b3
push eax
call ebx
mov edi, dword [ebp - 8]
mov dword [esi + 0x1c], 0
cmp byte [ebp - 1], 0
je 0x49a7d2
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x49a7d2
cmp eax, 0xffffffff
je 0x49a7d2
push eax
call ebx
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x49a7e2
push eax
call fcn.00441300
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14