Function at 0x409580
Capabilities:
Check http status code
Connect to http server
Create http request
Download and write a file
Get http content length
Parse url
Read data from internet
Receive and write data from server to client
Receive data
Resolve function by parsing pe exports
Send data
Send http request
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4441ee
mov eax, dword fs:[0]
push eax
mov eax, 0x3da8
call fcn.00432e60
mov eax, dword [0x4531c4]
xor eax, esp
mov dword [esp + 0x3da4], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4531c4]
xor eax, esp
push eax
lea eax, [esp + 0x3dbc]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x3dcc]
xor esi, esi
push 0x3c
lea eax, [esp + 0x58]
mov edi, ecx
push esi
push eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], esi
call fcn.0042d690
mov eax, 0x800
mov dword [esp + 0x74], eax
mov dword [esp + 0x90], eax
lea eax, [esp + 0x1c4]
lea ecx, [esp + 0x5c4]
mov dword [esp + 0x7c], eax
mov eax, 0x200
mov dword [esp + 0x70], ecx
mov ebx, 8
add esp, 0xc
lea edx, [esp + 0xdb8]
lea ecx, [esp + 0x3b8]
mov dword [esp + 0x74], eax
mov dword [esp + 0x7c], eax
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x54], 0x3c
mov dword [esp + 0x80], edx
mov dword [esp + 0x78], ecx
cmp dword [ebp + 0x18], ebx
jb 0x409648
mov ecx, dword [ebp + 4]
jmp 0x40964b
lea ecx, [ebp + 4]
lea edx, [esp + 0x54]
push edx
push 0
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
test eax, eax
je 0x409c2b
push 0
push 0
push 0
push 0
push 0x448f98
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [esp + 0x30], eax
test eax, eax
jne 0x409685
lea esi, [eax - 2]
jmp 0x409c29
cmp dword [edi + 0xc], esi
je 0x409692
or esi, 0xffffffff
jmp 0x409c1e
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x6c]
push 0
push 0
push 3
push eax
push ecx
mov ecx, dword [esp + 0x44]
push edx
lea eax, [esp + 0x5d0]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [esp + 0x28], eax
test eax, eax
jne 0x4096ca
lea esi, [eax - 2]
jmp 0x409c0f
cmp dword [edi + 0xc], esi
je 0x4096d7
or esi, 0xffffffff
jmp 0x409c0f
mov edx, dword [esp + 0x80]
mov eax, dword [esp + 0x28]
push 0
push 0
push 0
push 0
push 0
push edx
cmp dword [ebp + 0x38], esi
je 0x409745
push str.POST
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [esp + 0x14], eax
mov eax, str.Content_Type:_application_x_www_form_urlencoded__charsetUTF_8__r_n
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x409710
mov ecx, dword [esp + 0x14]
sub eax, edx
push 0xa0000000
sar eax, 1
push eax
push str.Content_Type:_application_x_www_form_urlencoded__charsetUTF_8__r_n
push ecx
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
test eax, eax
jne 0x409976
lea esi, [eax - 3]
jmp 0x409c00
push 0x44904c
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
cmp byte [0x4594e4], 0
mov dword [esp + 0x14], eax
je 0x409976
lea esi, [esp + 0x180]
call fcn.0041dd20
push eax
push str.Referer:
lea edi, [esp + 0x1a4]
mov dword [esp + 0x3dcc], 0
call fcn.004057d0
add esp, 8
mov byte [esp + 0x3dc4], 2
cmp dword [esp + 0x198], ebx
jb 0x4097af
mov ecx, dword [esp + 0x184]
push ecx
call fcn.00429ba0
add esp, 4
lea eax, [esp + 0x19c]
xor edx, edx
push eax
mov ebx, 0x449068
lea esi, [esp + 0x38]
mov dword [esp + 0x19c], 7
mov dword [esp + 0x198], 0
mov word [esp + 0x188], dx
call fcn.00405890
add esp, 4
push 0xffffffffffffffff
push 0
lea ecx, [esp + 0x1a4]
mov byte [esp + 0x3dcc], 3
call fcn.00401a20
mov ebx, 8
mov byte [esp + 0x3dc4], 2
cmp dword [esp + 0x4c], ebx
jb 0x409820
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00429ba0
add esp, 4
mov edx, dword [esp + 0x1a0]
cmp dword [esp + 0x1b4], ebx
jae 0x409837
lea edx, [esp + 0x1a0]
mov eax, edx
lea esi, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x409840
sub eax, esi
push 0xa0000000
sar eax, 1
push eax
push edx
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
test eax, eax
jne 0x409882
lea esi, [esp + 0x19c]
mov dword [esp + 0x18], 0xfffffffd
call fcn.00401990
mov esi, dword [esp + 0x18]
jmp 0x409c00
lea esi, [esp + 0x90]
call fcn.0041dbb0
lea ecx, [esp + 0x34]
mov byte [esp + 0x3dc4], 4
call fcn.0040e5f0
mov edi, eax
lea esi, [esp + 0x164]
mov byte [esp + 0x3dc4], 5
call fcn.0041dd20
cmp dword [edi + 0x18], ebx
jb 0x4098bf
mov edi, dword [edi + 4]
jmp 0x4098c2
add edi, 4
cmp dword [eax + 0x18], ebx
jb 0x4098cc
mov eax, dword [eax + 4]
jmp 0x4098cf
add eax, 4
push edi
xor edi, edi
push edi
push eax
call dword [sym.imp.WININET.dll_InternetSetCookieW]
cmp dword [esp + 0x17c], ebx
jb 0x4098f3
mov eax, dword [esp + 0x168]
push eax
call fcn.00429ba0
add esp, 4
xor ecx, ecx
mov esi, 7
mov dword [esp + 0x17c], esi
mov dword [esp + 0x178], edi
mov word [esp + 0x168], cx
cmp dword [esp + 0x4c], ebx
jb 0x409923
mov edx, dword [esp + 0x38]
push edx
call fcn.00429ba0
add esp, 4
mov dword [esp + 0x4c], esi
xor eax, eax
lea esi, [esp + 0x90]
mov dword [esp + 0x48], edi
mov word [esp + 0x38], ax
call fcn.0040e4b0
mov dword [esp + 0x3dc4], 0xffffffff
mov byte [0x4594e4], 0
cmp dword [esp + 0x1b4], ebx
jb 0x409969
mov ecx, dword [esp + 0x1a0]
push ecx
call fcn.00429ba0
add esp, 4
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
mov ebx, 8
cmp dword [esp + 0x14], 0
jne 0x409987
mov esi, 0xfffffffd
jmp 0x409c0f
cmp dword [edi + 0xc], 0
je 0x409995
or esi, 0xffffffff
jmp 0x409c00
mov edx, dword [ebp + 0x3c]
mov eax, dword [ebp + 0x38]
mov ecx, dword [esp + 0x14]
push edx
push eax
push 0
push 0
push ecx
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x4099b8
lea esi, [eax - 3]
jmp 0x409c00
cmp dword [edi + 0xc], 0
je 0x4099c6
or esi, 0xffffffff
jmp 0x409c00
mov ecx, dword [esp + 0x14]
push 0
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x58]
push eax
push 0x20000013
push ecx
mov dword [esp + 0x38], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x409bfb
cmp dword [esp + 0x50], 0x190
jae 0x409bfb
cmp dword [ebp + 0x30], 0
je 0x409c00
cmp dword [ebp + 0x50], 0
je 0x409ab1
mov eax, ebp
call fcn.004023d0
push eax
lea edx, [esp + 0x184]
push edx
call fcn.00409f90
lea esi, [ebp + 0x1c]
mov ebx, 6
mov edi, esi
lea eax, [esp + 0x34]
mov dword [esp + 0x3dc4], ebx
call fcn.004220b0
push 0xffffffffffffffff
push 0
mov ecx, esi
mov byte [esp + 0x3dcc], 7
call fcn.00401a20
mov byte [esp + 0x3dc4], bl
cmp dword [esp + 0x4c], 8
jb 0x409a71
mov eax, dword [esp + 0x38]
push eax
call fcn.00429ba0
add esp, 4
push 0
lea ecx, [esp + 0x184]
push ecx
or eax, 0xffffffff
call fcn.00405a00
mov dword [esp + 0x3dc4], 0xffffffff
cmp dword [esp + 0x198], 8
jb 0x409bcd
mov edx, dword [esp + 0x184]
push edx
call fcn.00429ba0
add esp, 4
jmp 0x409bcd
cmp dword [ebp + 0x54], 0
je 0x409bcd
lea ecx, [esp + 0x164]
call fcn.004221f0
push 1
mov eax, 0x449070
lea ecx, [esp + 0x168]
mov dword [esp + 0x3dc8], ebx
call fcn.00405ac0
mov eax, ebp
call fcn.004023d0
push eax
lea eax, [esp + 0x38]
push eax
call fcn.00409f90
push 0
push eax
or eax, 0xffffffff
lea esi, [esp + 0x16c]
mov byte [esp + 0x3dcc], 9
call fcn.00405a00
mov byte [esp + 0x3dc4], 8
cmp dword [esp + 0x4c], ebx
jb 0x409b28
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00429ba0
add esp, 4
lea esi, [ebp + 0x1c]
mov edi, esi
lea eax, [esp + 0x34]
call fcn.004220b0
push 0xffffffffffffffff
push 0
mov ecx, esi
mov byte [esp + 0x3dcc], 0xa
call fcn.00401a20
mov byte [esp + 0x3dc4], 8
cmp dword [esp + 0x4c], ebx
jb 0x409b64
mov edx, dword [esp + 0x38]
push edx
call fcn.00429ba0
add esp, 4
xor eax, eax
push eax
lea ecx, [esp + 0x168]
mov word [esp + 0x3c], ax
mov edi, 7
push ecx
or eax, 0xffffffff
mov dword [esp + 0x54], edi
mov dword [esp + 0x50], 0
call fcn.00405a00
mov dword [esp + 0x3dc4], 0xffffffff
cmp dword [esp + 0x17c], ebx
jb 0x409bb1
mov edx, dword [esp + 0x168]
push edx
call fcn.00429ba0
add esp, 4
xor eax, eax
mov dword [esp + 0x17c], edi
mov dword [esp + 0x178], 0
mov word [esp + 0x168], ax
mov eax, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x34]
push edx
push 0x20000005
push eax
mov dword [esp + 0x38], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x409c55
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, 0xfffffffc
mov eax, dword [esp + 0x14]
test eax, eax
je 0x409c0f
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x28]
test eax, eax
je 0x409c1e
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x30]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, esi
mov ecx, dword [esp + 0x3dbc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3da4]
xor ecx, esp
call fcn.00429bab
add esp, 0x3db4
ret 4
mov ecx, dword [esp + 0x1c]
cmp dword [ecx + 0xc], 0
je 0x409c64
or esi, 0xffffffff
jmp 0x409c00
cmp dword [ebp + 0x34], 8
jb 0x409c6f
mov eax, dword [ebp + 0x20]
jmp 0x409c72
lea eax, [ebp + 0x20]
push 0
push 0
push 2
push 0
push 2
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x409c99
mov esi, 0xfffffffb
jmp 0x409c00
mov eax, dword [esp + 0x2c]
mov edi, eax
mov dword [esp + 0x20], 0
test eax, eax
jbe 0x409d49
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x1c]
cmp dword [edx + 0xc], 0
jne 0x409d63
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x20]
push eax
push 0x2800
lea ecx, [esp + 0x15c0]
push ecx
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x409d68
mov ecx, dword [esp + 0x2c]
sub edi, dword [esp + 0x20]
mov eax, ecx
sub eax, edi
imul eax, eax, 0x64
xor edx, edx
div ecx
test eax, eax
jge 0x409d03
xor eax, eax
jmp 0x409d0d
cmp eax, 0x64
jle 0x409d0d
mov eax, 0x64
mov ecx, dword [ebp + 0x44]
test ecx, ecx
je 0x409d26
mov edx, dword [ebp + 0x48]
push eax
mov eax, dword [ebp + 0x4c]
push 0
push 2
push eax
push edx
call ecx
add esp, 0x14
mov ecx, dword [esp + 0x20]
push 0
lea eax, [esp + 0x24]
push eax
push ecx
lea edx, [esp + 0x15c4]
push edx
push ebx
call esi
test eax, eax
je 0x409d6f
test edi, edi
ja 0x409cb5
mov esi, dword [esp + 0x18]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
ja 0x409c00
xor esi, esi
jmp 0x409c00
or esi, 0xffffffff
jmp 0x409d4d
mov esi, 0xfffffffa
jmp 0x409d4d
mov esi, 0xfffffff9
jmp 0x409d4d