Function at 0x10004f20
Capabilities:
Check http status code
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x282c
call fcn.1001a150
mov eax, dword [0x10029494]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov ebx, edx
push edi
mov edx, str.ENTERING________________________________________________EHDownLoadFileNeo
mov esi, 0x1002c2c8
mov edi, ecx
mov dword [ebp - 0x280c], ebx
call fcn.10001830
call fcn.1000aa60
push str.DownLoading_File__
lea eax, [ebp - 0x808]
push 0x400
push eax
call fcn.1000bb31
add esp, 0xc
push edi
lea ecx, [ebp - 0x808]
push 0x400
push ecx
call fcn.1000c903
add esp, 0xc
lea edx, [ebp - 0x808]
call fcn.10001830
push str.DownLoading_File_To_Location__
lea edx, [ebp - 0x808]
push 0x400
push edx
call fcn.1000bb31
add esp, 0xc
push ebx
lea eax, [ebp - 0x808]
push 0x400
push eax
call fcn.1000c903
add esp, 0xc
lea edx, [ebp - 0x808]
call fcn.10001830
push 0
push 0
push 0
push 0
push str.OTPDoQuery
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ebx, eax
test ebx, ebx
jne 0x1000500a
mov edx, str.ERROR__________hSession__WinHttpOpen__________FAILED
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push 0x186a0
push 0x186a0
push 0x186a0
push 0x186a0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
test eax, eax
jne 0x1000505c
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, str.ERROR__________bResults__WinHttpSetTimeouts__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push 0x1002bac0
lea ecx, [ebp - 0x2808]
push 0x400
push ecx
call fcn.1000bb31
add esp, 0xc
push 0
push 0x1bb
lea edx, [ebp - 0x2808]
push edx
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov esi, eax
mov dword [ebp - 0x2818], esi
test esi, esi
jne 0x100050c9
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, str.ERROR__________hConnect__WinHttpConnect__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push str._downloads_
lea eax, [ebp - 0x1808]
push 0x400
push eax
call fcn.1000bb31
add esp, 0xc
push edi
lea ecx, [ebp - 0x1808]
push 0x400
push ecx
call fcn.1000c903
add esp, 0xc
lea edx, [ebp - 0x1808]
push edx
lea eax, [ebp - 0x2008]
push 0x400
push eax
call fcn.1000bb31
add esp, 0xc
push 0x800000
push 0
push 0
push 0
lea ecx, [ebp - 0x2008]
push ecx
push 0x100214c4
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
test edi, edi
jne 0x1000516e
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
call edi
push esi
call edi
mov edx, str.ERROR__________hRequest__WinHttpOpenRequest__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push 4
lea edx, [ebp - 0x282c]
push edx
push 0x1f
push edi
mov dword [ebp - 0x282c], 0x3300
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
test eax, eax
jne 0x100051c9
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
mov edx, str.ERROR__________bResults__WinHttpSetOption__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x1000521b
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
mov edx, str.ERROR__________bResults__WinHttpSendRequest__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x10005263
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
mov edx, str.ERROR__________bResults__WinHttpReceiveResponse__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
push 0
lea eax, [ebp - 0x2828]
push eax
lea ecx, [ebp - 0x2824]
push ecx
push 0
push 0x20000013
push edi
mov dword [ebp - 0x2824], 0
mov dword [ebp - 0x2828], 4
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x100052d4
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
mov edx, str.ERROR__________bResults__WinHttpQueryHeaders__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x2824], 0xc8
je 0x1000531b
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
mov edx, str.ERROR__________dwStatusCode___HTTP_STATUS_OK__________FAILED
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x280c]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2814], eax
cmp eax, 0xffffffff
jne 0x100053b5
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
push str.ERROR______________hFile__INVALID_HANDLE_VALUE___FileName__
lea eax, [ebp - 0x1008]
push 0x400
push eax
call fcn.1000bb31
mov ecx, dword [ebp - 0x280c]
add esp, 0xc
push ecx
lea edx, [ebp - 0x1008]
push 0x400
push edx
call fcn.1000c903
add esp, 0xc
lea edx, [ebp - 0x1008]
mov esi, 0x1002c2c8
call fcn.10001830
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
call fcn.10001830
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000bb22
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x2810]
push eax
push edi
mov dword [ebp - 0x2810], 0
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x100053b5
mov eax, dword [ebp - 0x2810]
test eax, eax
je 0x10005490
push eax
mov dword [ebp - 0x280c], 0
call fcn.1000ba7a
mov edx, dword [ebp - 0x2810]
add esp, 4
lea ecx, [ebp - 0x280c]
push ecx
push edx
push eax
push edi
mov dword [ebp - 0x281c], eax
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x1000547c
mov ecx, dword [ebp - 0x280c]
mov edx, dword [ebp - 0x281c]
push 0
lea eax, [ebp - 0x2820]
push eax
mov eax, dword [ebp - 0x2814]
push ecx
push edx
push eax
mov dword [ebp - 0x2820], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10005459
mov edx, str.ERROR____________________WriteFile_failed_for_response_file
mov esi, 0x1002c2c8
call fcn.10001830
mov esi, dword [ebp - 0x2818]
mov ecx, dword [ebp - 0x280c]
cmp ecx, dword [ebp - 0x2820]
je 0x1000547c
mov edx, str.ERROR_____________________dwBytes_dwBytesWritten__failed_for_response_file
mov esi, 0x1002c2c8
call fcn.10001830
mov esi, dword [ebp - 0x2818]
mov edx, dword [ebp - 0x281c]
push edx
call fcn.1000bd44
add esp, 4
jmp 0x100053b5
mov eax, dword [ebp - 0x2814]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push esi
call ebx
push edi
call ebx
mov edx, str.LEAVING________________________________________________EHDownLoadFileNeo
mov esi, 0x1002c2c8
call fcn.10001830
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.1000bb22
mov esp, ebp
pop ebp
ret