Function at 0x413e80
Capabilities:
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x467c46
mov eax, dword fs:[0]
push eax
sub esp, 0x470
mov eax, dword [0x4812a4]
xor eax, esp
mov dword [esp + 0x468], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4812a4]
xor eax, esp
push eax
lea eax, [esp + 0x484]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x494]
mov edi, ecx
push 0xf
xor ebx, ebx
push str.Accept:___r_n_r_n
lea ecx, [esp + 0x44]
mov dword [esp + 0x20], edi
mov dword [esp + 0x5c], 0xf
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
call fcn.00407a50
mov dword [esp + 0x48c], ebx
push ebx
push ebx
push ebx
push ebx
push str.BattlefieldBadCompany2Updater
mov dword [edi + 0x38], ebx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov esi, eax
cmp esi, ebx
mov dword [esp + 0x38], esi
jne 0x413f48
mov dword [edi + 0x38], 2
mov dword [esp + 0x48c], 0xffffffff
cmp dword [esp + 0x54], 0x10
jb 0x413f33
mov eax, dword [esp + 0x40]
push eax
call fcn.00449824
add esp, 4
mov dword [esp + 0x54], 0xf
mov dword [esp + 0x50], ebx
mov byte [esp + 0x40], bl
jmp 0x414229
push 0xffffffffffffffff
push ebx
push edi
lea ecx, [esp + 0x64]
mov dword [esp + 0x7c], 0xf
mov dword [esp + 0x78], ebx
mov byte [esp + 0x68], bl
call fcn.00404920
mov byte [esp + 0x48c], 1
cmp byte [ebp + 4], bl
je 0x413f7f
lea edi, [esp + 0x58]
call fcn.00414260
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x40]
mov eax, 0x10
cmp dword [esp + 0x54], eax
jae 0x413f92
lea ecx, [esp + 0x40]
cmp dword [esp + 0x70], eax
mov eax, dword [esp + 0x5c]
jae 0x413fa0
lea eax, [esp + 0x5c]
mov edx, dword [esp + 0x50]
push ebx
push SysReAllocString
push edx
push ecx
push eax
push esi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
cmp esi, ebx
mov dword [esp + 0x28], esi
jne 0x414024
mov dword [edi + 0x38], 2
mov byte [esp + 0x48c], bl
mov esi, 0x10
cmp dword [esp + 0x70], esi
jb 0x413fe4
mov eax, dword [esp + 0x5c]
push eax
call fcn.00449824
add esp, 4
mov edi, 0xf
mov dword [esp + 0x70], edi
mov dword [esp + 0x6c], ebx
mov byte [esp + 0x5c], bl
mov dword [esp + 0x48c], 0xffffffff
cmp dword [esp + 0x54], esi
jb 0x414013
mov ecx, dword [esp + 0x40]
push ecx
call fcn.00449824
add esp, 4
mov dword [esp + 0x54], edi
mov dword [esp + 0x50], ebx
mov byte [esp + 0x40], bl
jmp 0x414229
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x7c]
push ecx
push 0x13
push esi
mov dword [esp + 0x40], 0x20
mov dword [esp + 0x48], ebx
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
mov edx, 4
je 0x4140a8
mov edi, 0x470c30
lea esi, [esp + 0x74]
mov ecx, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x41406e
mov ecx, dword [esp + 0x18]
mov dword [ecx + 0x38], edx
jmp 0x414205
mov edi, 0x470c34
lea esi, [esp + 0x74]
mov ecx, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x41408f
mov ecx, dword [esp + 0x18]
mov dword [ecx + 0x38], 2
jmp 0x414205
mov edi, 0x470c38
lea esi, [esp + 0x74]
mov ecx, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x41407f
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x28]
push ebx
mov dword [esp + 0x34], edx
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x24]
push eax
push 0x20000005
push esi
mov dword [esp + 0x30], ebx
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x4140d3
mov dword [esp + 0x1c], 0x100000
add edi, 0x1c
xor esi, esi
cmp dword [edi + 0x18], 0x10
mov dword [esp + 0x20], ebx
jb 0x4140e7
mov eax, dword [edi + 4]
jmp 0x4140ea
lea eax, [edi + 4]
push 0x470c3c
push eax
call fcn.0044af26
add esp, 8
cmp eax, ebx
mov dword [esp + 0x24], eax
je 0x41407f
cmp dword [ebp + 0x1c], ebx
je 0x41411a
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ecx]
mov edx, dword [edx + 4]
push eax
push ebx
push edi
call edx
cmp byte [ebp + 5], bl
jne 0x414182
nop
mov edx, dword [esp + 0x28]
lea eax, [esp + 0x20]
push eax
push 0x3e8
lea ecx, [esp + 0x9c]
push ecx
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x41418f
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x414198
add esi, eax
cmp dword [ebp + 0x1c], ebx
je 0x414165
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebp + 0x1c]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
push edx
push esi
push edi
call eax
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
push ecx
push eax
lea edx, [esp + 0x9c]
push 1
push edx
call fcn.0044bad3
add esp, 0x10
cmp byte [ebp + 5], bl
je 0x414120
mov eax, dword [esp + 0x18]
mov dword [eax + 0x38], 3
jmp 0x4141a3
mov ecx, dword [esp + 0x18]
mov dword [ecx + 0x38], ebx
jmp 0x4141a3
mov edx, dword [esp + 0x18]
mov dword [edx + 0x38], 1
mov eax, dword [esp + 0x24]
push eax
call fcn.0044bcd3
mov ecx, dword [esp + 0x28]
add esp, 4
push ecx
call fcn.0044a009
mov edx, dword [esp + 0x1c]
add esp, 4
cmp dword [edx + 0x38], 1
je 0x4141de
cmp dword [edi + 0x18], 0x10
jb 0x4141d2
mov eax, dword [edi + 4]
jmp 0x4141d5
lea eax, [edi + 4]
push eax
call fcn.0044bd2f
add esp, 4
mov eax, dword [esp + 0x28]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x38]
push ecx
call esi
cmp dword [ebp + 0x1c], ebx
je 0x414205
mov ebp, dword [ebp + 0x1c]
mov edx, dword [ebp]
mov eax, dword [edx + 8]
push edi
mov ecx, ebp
call eax
mov byte [esp + 0x48c], bl
lea ecx, [esp + 0x58]
call fcn.00409220
mov dword [esp + 0x48c], 0xffffffff
lea ecx, [esp + 0x3c]
call fcn.00409220
mov ecx, dword [esp + 0x484]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x468]
xor ecx, esp
call fcn.00449829
add esp, 0x47c
ret 4