Function at 0x420930
Capabilities:
Prepare http request
Receive http response
Resolve function by parsing pe exports
Set http header
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x20ec
call fcn.004e3330
mov eax, dword [0x5640a8]
xor eax, esp
mov dword [esp + 0x20e8], eax
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
xor ecx, ecx
mov dword [esp + 0x28], ebx
mov eax, dword [edi + 0x18]
test eax, eax
je 0x420993
push dword [edi + 0x1c]
mov word [esp + 0x3c], cx
lea ecx, [esp + 0x3c]
push eax
mov dword [esp + 0x54], 7
mov dword [esp + 0x50], ebx
call fcn.00402570
cmp dword [esp + 0x4c], 8
lea ecx, [esp + 0x38]
mov ebx, 1
cmovae ecx, dword [esp + 0x38]
movzx eax, word [edi + 0x20]
push 0
push eax
mov eax, dword [edi]
push ecx
push dword [eax + 0x4c]
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov esi, eax
test bl, 1
je 0x4209df
mov ecx, dword [esp + 0x4c]
and ebx, 0xfffffffe
cmp ecx, 8
jb 0x4209c8
inc ecx
push ecx
push dword [esp + 0x3c]
lea ecx, [esp + 0x40]
call fcn.00402f10
xor eax, eax
mov dword [esp + 0x4c], 7
mov dword [esp + 0x48], 0
mov word [esp + 0x38], ax
test esi, esi
jne 0x420a0e
mov eax, dword [edi]
push dword [eax + 0x44]
call dword [sym.imp.KERNEL32.DLL_SetEvent]
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ecx, dword [edi + 4]
mov dword [ecx], eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x20e8]
xor ecx, esp
call fcn.004e1bb1
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x34]
xor ecx, ecx
test eax, eax
je 0x420a46
push dword [edi + 0x38]
mov dword [esp + 0x64], ecx
mov word [esp + 0x54], cx
lea ecx, [esp + 0x54]
push eax
mov dword [esp + 0x6c], 7
call fcn.00402570
or ebx, 2
lea ecx, [esp + 0x50]
cmp dword [esp + 0x64], 8
cmovae ecx, dword [esp + 0x50]
xor eax, eax
mov edx, 0x800000
cmp dword [edi + 0x14], 2
cmove eax, edx
push eax
push 0
push 0
push 0
push ecx
push 0x53df2c
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [esp + 0x20], eax
test bl, 2
je 0x420aa0
mov ecx, dword [esp + 0x64]
cmp ecx, 8
jb 0x420a89
inc ecx
push ecx
push dword [esp + 0x54]
lea ecx, [esp + 0x58]
call fcn.00402f10
xor eax, eax
mov dword [esp + 0x64], 7
mov dword [esp + 0x60], 0
mov word [esp + 0x50], ax
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x4209e3
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
lea eax, [esp + 0x18]
push 4
push eax
push 0x3f
push ebx
mov dword [esp + 0x28], 2
call esi
push 4
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0x3300
push eax
push 0x1f
push ebx
call esi
mov esi, dword [edi + 4]
push 0x80
push 0
mov eax, dword [esi + 0x18]
sub eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x1c]
sbb ecx, dword [esi + 0x24]
sub eax, dword [esi + 0x10]
sbb ecx, dword [esi + 0x14]
add eax, 1
mov dword [esp + 0x30], eax
lea eax, [esp + 0x70]
adc ecx, 0
push eax
mov dword [esp + 0x40], ecx
call fcn.004fb2d0
mov ecx, dword [esi + 0x20]
add esp, 0xc
add ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x24]
adc eax, dword [esi + 0x14]
push dword [esi + 0x1c]
push dword [esi + 0x18]
push eax
push ecx
lea eax, [esp + 0x78]
push str.Range:_bytes_llu__llu
push eax
call fcn.00415550
add esp, 0x18
lea eax, [esp + 0x68]
push 0x20000000
push 0xffffffffffffffff
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
je 0x4209e3
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x4209e3
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x4209e3
mov ecx, dword [edi + 4]
mov edx, 2
mov eax, dword [ecx + 0x20]
or eax, dword [ecx + 0x24]
je 0x420b93
mov edx, 3
cmp dword [ecx + 0x40], 8
lea eax, [ecx + 0x2c]
jb 0x420b9e
mov eax, dword [eax]
push 0
push 0x80
push edx
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov ecx, dword [edi + 4]
mov dword [ecx + 0x28], eax
mov eax, dword [edi + 4]
mov ecx, dword [eax + 0x28]
cmp ecx, 0xffffffff
je 0x4209e3
mov edx, dword [eax + 0x20]
mov esi, dword [eax + 0x24]
mov eax, edx
or eax, esi
je 0x420be4
push 0
push 0
push esi
push edx
push ecx
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
mov ecx, dword [edi]
push 0x2004
push 0
mov eax, dword [ecx + 0x44]
mov dword [esp + 0x34], eax
mov eax, dword [ecx + 0x48]
mov dword [esp + 0x38], eax
lea eax, [esp + 0xf0]
push eax
call fcn.004fb2d0
add esp, 0xc
mov byte [esp + 0xf], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x1c], 0
mov esi, dword [sym.imp.KERNEL32.DLL_WaitForMultipleObjects]
lea eax, [esp + 0x2c]
push 0
push 0
push eax
push 2
call esi
cmp eax, 0x102
jne 0x420db4
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x420c60
cmp dword [esp + 0x14], eax
jbe 0x420d76
push 0
push 0
lea eax, [esp + 0x34]
push eax
push 2
call esi
cmp eax, 0x102
jne 0x420db4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x420dab
cmp eax, 0x2004
jbe 0x420ca1
push eax
call fcn.004e22d3
mov ebx, eax
mov byte [esp + 0x13], 1
mov eax, dword [esp + 0x18]
add esp, 4
jmp 0x420ca8
lea ebx, [esp + 0xe8]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0
push ecx
push eax
mov eax, dword [esp + 0x28]
push ebx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x420d8e
cmp dword [esp + 0x10], 0
jbe 0x420d83
push 0
push 0
lea eax, [esp + 0x34]
push eax
push 2
call esi
cmp eax, 0x102
jne 0x420db4
mov ecx, dword [esp + 0x10]
xor esi, esi
test ecx, ecx
je 0x420d33
nop word [eax + eax]
push 0
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0
push eax
mov eax, dword [edi + 4]
push ecx
push ebx
push dword [eax + 0x28]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
mov ecx, dword [esp + 0x10]
test eax, eax
je 0x420d2f
add esi, dword [esp + 0x24]
cmp esi, ecx
jb 0x420d00
jmp 0x420d33
cmp esi, ecx
jb 0x420d8e
mov eax, dword [edi + 4]
add dword [eax + 0x20], ecx
adc dword [eax + 0x24], 0
mov eax, dword [esp + 0x1c]
add eax, dword [esp + 0x10]
cmp byte [esp + 0xf], 0
mov dword [esp + 0x1c], eax
je 0x420d5d
push ebx
call fcn.004e22c5
mov eax, dword [esp + 0x20]
add esp, 4
xor ecx, ecx
cmp ecx, dword [esp + 0x34]
ja 0x420db4
jb 0x420d6d
cmp eax, dword [esp + 0x28]
jae 0x420db4
mov ebx, dword [esp + 0x20]
jmp 0x420c20
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ecx, dword [edi + 4]
mov dword [ecx], eax
jmp 0x420db4
mov eax, dword [edi + 4]
mov dword [eax], 0xffffffff
jmp 0x420d99
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ecx, dword [edi + 4]
mov dword [ecx], eax
cmp byte [esp + 0xf], 0
je 0x420db4
push ebx
call fcn.004e22c5
add esp, 4
jmp 0x420db4
mov eax, dword [edi + 4]
mov dword [eax], 0xffffffff
mov eax, dword [edi + 4]
push dword [eax + 0x28]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, dword [edi + 4]
mov ecx, dword [esp + 0x20f4]
pop edi
pop esi
pop ebx
xor ecx, esp
mov dword [eax + 0x28], 0xffffffff
call fcn.004e1bb1
mov esp, ebp
pop ebp
ret