Function at 0x504824
Capabilities:
Check for time delay via gettickcount
Check http status code
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x318
push 0
push 0
dec ecx
jne 0x50482d
push ecx
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.0040700c
mov eax, dword [ebp - 8]
call fcn.0040700c
mov eax, dword [ebp - 0xc]
call fcn.0040700c
mov eax, dword [ebp + 0xc]
call fcn.0040700c
xor eax, eax
push ebp
push 0x5052c6
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x1d], 0
mov eax, dword [ebp + 0x1c]
call fcn.0040688c
mov eax, dword [ebp + 0x18]
mov dword [eax], 0
mov dword [eax + 4], 0
lea eax, [ebp - 0x1868]
mov edx, dword [ebp - 4]
call fcn.00407ab8
mov eax, dword [ebp - 0x1868]
lea edx, [ebp - 0x1864]
call fcn.00413c68
mov edx, dword [ebp - 0x1864]
lea eax, [ebp - 4]
mov ecx, 0
call fcn.00407ae0
lea eax, [ebp - 0x10]
call fcn.0040688c
xor eax, eax
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x1874]
push eax
mov ecx, 7
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.0040709c
mov edx, dword [ebp - 0x1874]
lea eax, [ebp - 0x1870]
call fcn.00407ab8
mov eax, dword [ebp - 0x1870]
lea edx, [ebp - 0x186c]
call fcn.00413540
mov eax, dword [ebp - 0x186c]
mov edx, 0x5052ec
call fcn.00407f74
jne 0x50495c
mov eax, dword [ebp - 4]
test eax, eax
je 0x504939
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x504939
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov ebx, eax
test ebx, ebx
je 0x504944
sub ebx, 4
mov ebx, dword [ebx]
lea eax, [ebp - 4]
push eax
mov ecx, ebx
mov edx, 8
mov eax, dword [ebp - 4]
call fcn.0040709c
jmp 0x504a0a
lea eax, [ebp - 0x1880]
push eax
mov ecx, 8
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.0040709c
mov edx, dword [ebp - 0x1880]
lea eax, [ebp - 0x187c]
call fcn.00407ab8
mov eax, dword [ebp - 0x187c]
lea edx, [ebp - 0x1878]
call fcn.00413540
mov eax, dword [ebp - 0x1878]
mov edx, 0x505308
call fcn.00407f74
jne 0x504a0a
mov eax, dword [ebp - 4]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], 0
je 0x5049d1
mov eax, dword [ebp - 0x58]
sub eax, 0xa
cmp word [eax], 1
je 0x5049d1
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x5c], eax
cmp dword [ebp - 0x5c], 0
je 0x5049e8
mov eax, dword [ebp - 0x5c]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 4]
push eax
mov ecx, dword [ebp - 0x5c]
mov edx, 9
mov eax, dword [ebp - 4]
call fcn.0040709c
mov dword [ebp + 0x10], 0x1bb
mov dword [ebp - 0x3c], 0x800000
cmp byte [ebp + 8], 0
je 0x504a25
mov eax, dword [ebp - 0x3c]
or eax, 0x4000000
or eax, 0x4000000
or eax, 0x80000000
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x1884]
mov edx, dword [ebp - 4]
call fcn.00407ab8
mov edx, dword [ebp - 0x1884]
mov eax, 0x505328
call fcn.00408344
mov ebx, eax
lea eax, [ebp - 0x1888]
mov edx, dword [ebp - 4]
call fcn.00407ab8
mov edx, dword [ebp - 0x1888]
mov eax, 0x505338
call fcn.00408344
mov dword [ebp - 0x38], eax
cmp ebx, 1
jge 0x504a96
mov eax, dword [ebp - 4]
test eax, eax
je 0x504a8a
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x504a8a
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
test eax, eax
je 0x504a93
sub eax, 4
mov eax, dword [eax]
lea ebx, [eax + 1]
cmp dword [ebp - 0x38], 1
jge 0x504ac8
mov eax, dword [ebp - 4]
test eax, eax
je 0x504abb
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x504abb
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
test eax, eax
je 0x504ac4
sub eax, 4
mov eax, dword [eax]
inc eax
mov dword [ebp - 0x38], eax
cmp ebx, dword [ebp - 0x38]
jge 0x504b75
lea eax, [ebp - 0x10]
push eax
mov ecx, ebx
dec ecx
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.0040709c
lea eax, [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x38]
sub ecx, ebx
dec ecx
lea edx, [ebx + 1]
mov eax, dword [ebp - 4]
call fcn.0040709c
xor eax, eax
push ebp
push 0x504b2e
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x188c]
mov edx, dword [ebp - 0x14]
call fcn.00407ab8
mov eax, dword [ebp - 0x188c]
call fcn.00414654
mov dword [ebp + 0x10], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x504b38
mov eax, dword [ebp - 4]
test eax, eax
je 0x504b57
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x504b57
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov ebx, eax
test ebx, ebx
je 0x504b62
sub ebx, 4
mov ebx, dword [ebx]
lea eax, [ebp - 4]
push eax
mov ecx, ebx
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 4]
call fcn.0040709c
jmp 0x504bc5
lea eax, [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x38]
dec ecx
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.0040709c
mov eax, dword [ebp - 4]
test eax, eax
je 0x504ba9
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x504ba9
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov ebx, eax
test ebx, ebx
je 0x504bb4
sub ebx, 4
mov ebx, dword [ebx]
lea eax, [ebp - 4]
push eax
mov ecx, ebx
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 4]
call fcn.0040709c
mov eax, dword [ebp + 0x1c]
call fcn.0040688c
push 0
push 0
push 0
push 0
push 0x50533c
call sub.wininet.dll_InternetOpenA
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x504bfd
mov eax, dword [ebp + 0x18]
mov dword [eax], 0xfffffffa
mov dword [eax + 4], 0xffffffff
jmp 0x505237
mov dword [ebp - 0x54], 0xffffffff
push 4
lea eax, [ebp - 0x54]
push eax
push 0x41
mov eax, dword [ebp - 0x24]
push eax
call sub.wininet.dll_InternetSetOptionA
cmp eax, 1
sbb ebx, ebx
inc ebx
xor edx, edx
push ebp
push 0x505230
push dword fs:[edx]
mov dword fs:[edx], esp
cmp byte [ebp + 0x20], 0
je 0x504c63
push 1
push 0
push 3
mov eax, dword [ebp - 0xc]
call fcn.0040701c
push eax
mov eax, dword [ebp - 8]
call fcn.0040701c
push eax
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp - 0x10]
call fcn.0040701c
push eax
mov eax, dword [ebp - 0x24]
push eax
call sub.wininet.dll_InternetConnectA
mov dword [ebp - 0x28], eax
jmp 0x504c8d
push 1
push 0
push 3
push 0x505370
push 0x505370
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp - 0x10]
call fcn.0040701c
push eax
mov eax, dword [ebp - 0x24]
push eax
call sub.wininet.dll_InternetConnectA
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x504cad
mov eax, dword [ebp + 0x18]
mov dword [eax], 0xfffffffb
mov dword [eax + 4], 0xffffffff
call fcn.00406198
jmp 0x505237
xor edx, edx
push ebp
push 0x505212
push dword fs:[edx]
mov dword fs:[edx], esp
lea eax, [ebp - 0x18]
mov edx, 0x505380
call fcn.0040693c
mov eax, dword [ebp - 0x18]
call fcn.0040701c
mov dword [ebp - 0x34], eax
xor eax, eax
mov dword [ebp - 0x30], eax
push 0
mov eax, dword [ebp - 0x3c]
or eax, 0x3000
push eax
lea eax, [ebp - 0x34]
push eax
push 0
push 0
mov eax, dword [ebp - 4]
call fcn.0040701c
push eax
push 0x505384
mov eax, dword [ebp - 0x28]
push eax
call sub.wininet.dll_HttpOpenRequestA
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x504d87
mov eax, dword [ebp + 0x18]
mov dword [eax], 0xfffffffc
mov dword [eax + 4], 0xffffffff
push 0x505394
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x1894]
call fcn.004145d4
push dword [ebp - 0x1894]
push 0x5053bc
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x1898]
call fcn.00419204
push dword [ebp - 0x1898]
lea eax, [ebp - 0x1890]
mov edx, 4
call fcn.00407e54
mov edx, dword [ebp - 0x1890]
mov eax, dword [ebp + 0x1c]
mov ecx, 0
call fcn.00407ae0
call fcn.00406198
call fcn.00406198
jmp 0x505237
xor edx, edx
push ebp
push 0x5051f4
push dword fs:[edx]
mov dword fs:[edx], esp
test bl, bl
je 0x504e3b
push 0xa0000000
push 0x1d
push 0x5053c0
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_HttpAddRequestHeadersA
test eax, eax
jne 0x504e3b
mov eax, dword [ebp + 0x18]
mov dword [eax], 0xfffffffd
mov dword [eax + 4], 0xffffffff
push 0x505394
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x18a0]
call fcn.004145d4
push dword [ebp - 0x18a0]
push 0x5053bc
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x18a4]
call fcn.00419204
push dword [ebp - 0x18a4]
lea eax, [ebp - 0x189c]
mov edx, 4
call fcn.00407e54
mov edx, dword [ebp - 0x189c]
mov eax, dword [ebp + 0x1c]
mov ecx, 0
call fcn.00407ae0
call fcn.00406198
call fcn.00406198
call fcn.00406198
jmp 0x505237
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x504e5a
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x504e5a
lea eax, [ebp + 0xc]
xor ecx, ecx
mov edx, dword [ebp + 0xc]
call fcn.00406aa8
mov ebx, eax
test ebx, ebx
je 0x504e65
sub ebx, 4
mov ebx, dword [ebx]
push 0
push 0
push ebx
mov eax, dword [ebp + 0xc]
call fcn.0040701c
push eax
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_HttpSendRequestA
test eax, eax
jne 0x504f05
mov eax, dword [ebp + 0x18]
mov dword [eax], 0xfffffffe
mov dword [eax + 4], 0xffffffff
push 0x505394
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x18ac]
call fcn.004145d4
push dword [ebp - 0x18ac]
push 0x5053bc
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x18b0]
call fcn.00419204
push dword [ebp - 0x18b0]
lea eax, [ebp - 0x18a8]
mov edx, 4
call fcn.00407e54
mov edx, dword [ebp - 0x18a8]
mov eax, dword [ebp + 0x1c]
mov ecx, 0
call fcn.00407ae0
call fcn.00406198
call fcn.00406198
call fcn.00406198
jmp 0x505237
call sub.kernel32.dll_GetTickCount_1
mov esi, eax
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], 0x401
mov eax, dword [ebp + 0x18]
mov dword [eax], 0xffffffff
mov dword [eax + 4], 0xffffffff
lea eax, [ebp - 0x50]
push eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x1860]
push eax
push 0x13
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_HttpQueryInfoW
test eax, eax
je 0x504f8c
lea eax, [ebp - 0x18b4]
push eax
lea eax, [ebp - 0x18b8]
lea edx, [ebp - 0x1860]
mov ecx, 0x401
call fcn.00407a9c
mov eax, dword [ebp - 0x18b8]
mov ecx, dword [ebp - 0x4c]
xor edx, edx
call fcn.00407fdc
mov eax, dword [ebp - 0x18b4]
or edx, 0xffffffff
call fcn.00414690
cdq
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
mov dword [ecx + 4], edx
xor eax, eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], 0x401
mov eax, dword [ebp + 0x14]
call fcn.0040688c
lea eax, [ebp - 0x50]
push eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x1860]
push eax
push 0x16
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_HttpQueryInfoW
test eax, eax
je 0x504fea
mov eax, dword [ebp + 0x14]
push eax
lea eax, [ebp - 0x18bc]
lea edx, [ebp - 0x1860]
mov ecx, 0x401
push 0
call fcn.00406c14
mov eax, dword [ebp - 0x18bc]
mov ecx, dword [ebp - 0x4c]
xor edx, edx
call fcn.0040709c
mov eax, dword [ebp + 0x18]
cmp dword [eax + 4], 0
jne 0x504ffd
cmp dword [eax], 0xc8
jb 0x505014
jmp 0x504fff
jl 0x505014
mov eax, dword [ebp + 0x18]
cmp dword [eax + 4], 0
jne 0x505012
cmp dword [eax], 0x12b
jbe 0x505028
jmp 0x505014
jle 0x505028
call fcn.00406198
call fcn.00406198
call fcn.00406198
jmp 0x505237
xor eax, eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], 0x401
mov dword [ebp - 0x48], 0xffffffff
mov dword [ebp - 0x44], 0xffffffff
lea eax, [ebp - 0x50]
push eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x1860]
push eax
push 5
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_HttpQueryInfoW
test eax, eax
je 0x5050a2
lea eax, [ebp - 0x18c0]
push eax
lea eax, [ebp - 0x18c4]
lea edx, [ebp - 0x1860]
mov ecx, 0x401
call fcn.00407a9c
mov eax, dword [ebp - 0x18c4]
mov ecx, dword [ebp - 0x4c]
xor edx, edx
call fcn.00407fdc
mov eax, dword [ebp - 0x18c0]
or edx, 0xffffffff
call fcn.00414690
cdq
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], edx
xor eax, eax
mov dword [ebp - 0x40], eax
mov byte [ebp - 0x105d], 0
lea eax, [ebp - 0x40]
push eax
push 0x1000
lea eax, [ebp - 0x105d]
push eax
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_InternetReadFile
test eax, eax
je 0x50516e
cmp dword [ebp - 0x40], 0
jbe 0x505167
mov eax, dword [ebp - 0x40]
mov byte [ebp + eax - 0x105d], 0
lea eax, [ebp - 0x18c8]
lea edx, [ebp - 0x105d]
mov ecx, 0x1001
push 0
call fcn.00406bf4
mov edx, dword [ebp - 0x18c8]
mov eax, dword [ebp + 0x1c]
call fcn.00406ca4
mov eax, dword [ebp + 0x1c]
cmp dword [ebp - 0x44], 0
jne 0x50511b
cmp dword [ebp - 0x48], 0
jb 0x50515c
jmp 0x50511d
jl 0x50515c
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax]
test eax, eax
je 0x505140
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x505140
mov edx, dword [ebp + 0x1c]
mov edx, dword [edx]
mov eax, dword [ebp + 0x1c]
xor ecx, ecx
call fcn.00406aa8
mov ecx, eax
test ecx, ecx
je 0x50514b
sub ecx, 4
mov ecx, dword [ecx]
mov eax, ecx
cdq
cmp edx, dword [ebp - 0x44]
jne 0x50515a
cmp eax, dword [ebp - 0x48]
jb 0x50515c
jmp 0x505185
jge 0x505185
xor ebx, ebx
call sub.kernel32.dll_GetTickCount_1
mov esi, eax
jmp 0x50516e
cmp dword [ebp - 0x40], 0
jne 0x50516e
inc ebx
cmp ebx, 5
jg 0x505185
call sub.kernel32.dll_GetTickCount_1
sub eax, esi
cmp eax, 0x7530
jbe 0x5050a2
cmp dword [ebp - 0x44], 0
jne 0x505193
cmp dword [ebp - 0x48], 0
jae 0x505199
jmp 0x505195
jge 0x505199
mov al, 1
jmp 0x5051da
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax]
test eax, eax
je 0x5051bc
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x5051bc
mov edx, dword [ebp + 0x1c]
mov edx, dword [edx]
mov eax, dword [ebp + 0x1c]
xor ecx, ecx
call fcn.00406aa8
mov ecx, eax
test ecx, ecx
je 0x5051c7
sub ecx, 4
mov ecx, dword [ecx]
mov eax, ecx
cdq
cmp edx, dword [ebp - 0x44]
jne 0x5051d7
cmp eax, dword [ebp - 0x48]
setae al
jmp 0x5051da
setge al
mov byte [ebp - 0x1d], al
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5051fb
mov eax, dword [ebp - 0x2c]
push eax
call sub.wininet.dll_InternetCloseHandle
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5052d0
lea eax, [ebp - 0x18c8]
call fcn.0040688c
lea eax, [ebp - 0x18c4]
mov edx, 2
call fcn.00407884
lea eax, [ebp - 0x18bc]
call fcn.0040688c
lea eax, [ebp - 0x18b8]
mov edx, 0xe
call fcn.00407884
lea eax, [ebp - 0x1880]
call fcn.0040688c
lea eax, [ebp - 0x187c]
mov edx, 2
call fcn.00407884
lea eax, [ebp - 0x1874]
call fcn.0040688c
lea eax, [ebp - 0x1870]
mov edx, 4
call fcn.00407884
lea eax, [ebp - 0x1c]
mov edx, 7
call fcn.004068b0
lea eax, [ebp + 0xc]
call fcn.0040688c
ret