• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Spilled

#1
.NET Platform / Re: PNG Sent over TcpClient()
December 27, 2008, 05:49 AM
Quote from: MyndFyre[vL] on December 27, 2008, 05:42 AM
Have you considered using the HttpWebRequest class instead of TcpClient?

Yes, but i would like to use TcpClient instead and i have everything done except this part of the project. Do you have any idea as to why this is not working?
#2
.NET Platform / Re: PNG Sent over TcpClient()
December 26, 2008, 08:50 AM
Quote from: l2k-Shadow on December 26, 2008, 01:44 AM
just.. take the header out and dump the rest into a file ending with a .png extention? xD

Ive tried this with StreamWriter class, Let me give BinaryWriter a try and if i run into any problems ill upload some code. Thanks for the help guys appreciate it.

Edit:

Ok I gave BinaryWriter a try and the image still isn't being correctly download. heres my code:


                BinaryWriter BW = new BinaryWriter(File.Open("asdf.png", FileMode.Create));
                BW.Write(Response.Substring(Response.IndexOf("\r\n\r\n")+4));
                BW.Flush(); BW.Close();


Response is Header and source, Any ideas?
#3
.NET Platform / PNG Sent over TcpClient()
December 26, 2008, 01:03 AM
Ok so here is the problem I'm having. I'm using TcpClient to connect to a proxy and request a webpage. When i recieve the webpage my program finds an Image and decides to download it. So using the GET method i request the Image and it is sent to me. Here is the packet log:


0000  48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D    HTTP/1.1 200 OK.
0010  0A 44 61 74 65 3A 20 54 68 75 2C 20 32 35 20 44    .Date: Thu, 25 D
0020  65 63 20 32 30 30 38 20 30 35 3A 32 34 3A 35 37    ec 2008 05:24:57
0030  20 47 4D 54 0D 0A 53 65 72 76 65 72 3A 20 41 70     GMT..Server: Ap
0040  61 63 68 65 2F 31 2E 33 2E 32 37 20 28 55 6E 69    ache/1.3.27 (Uni
0050  78 29 20 6D 6F 64 5F 70 65 72 6C 2F 31 2E 32 37    x) mod_perl/1.27
0060  20 50 48 50 2F 34 2E 34 2E 36 0D 0A 50 72 61 67     PHP/4.4.6..Prag
0070  6D 61 3A 20 6E 6F 2D 63 61 63 68 65 43 61 63 68    ma: no-cacheCach
0080  65 2D 63 6F 6E 74 72 6F 6C 3A 20 6E 6F 2D 63 61    e-control: no-ca
0090  63 68 65 0D 0A 53 65 74 2D 43 6F 6F 6B 69 65 3A    che..Set-Cookie:
00A0  20 4D 46 49 6D 61 67 65 3D 53 59 47 6B 68 4A 44     MFImage=SYGkhJD
00B0  51 58 63 3B 20 65 78 70 69 72 65 73 3D 46 72 69    QXc; expires=Fri
00C0  2C 20 32 35 2D 44 65 63 2D 32 30 30 39 20 30 35    , 25-Dec-2009 05
00D0  3A 32 34 3A 35 37 20 47 4D 54 3B 20 70 61 74 68    :24:57 GMT; path
00E0  3D 2F 3B 0D 0A 50 72 61 67 6D 61 3A 20 6E 6F 2D    =/;..Pragma: no-
00F0  63 61 63 68 65 0D 0A 43 61 63 68 65 2D 63 6F 6E    cache..Cache-con
0100  74 72 6F 6C 3A 20 6E 6F 2D 63 61 63 68 65 0D 0A    trol: no-cache..
0110  4C 61 73 74 2D 4D 6F 64 69 66 69 65 64 3A 20 46    Last-Modified: F
0120  72 69 2C 20 31 32 20 41 75 67 20 32 30 30 35 20    ri, 12 Aug 2005
0130  32 33 3A 34 39 3A 31 33 20 47 4D 54 0D 0A 43 6F    23:49:13 GMT..Co
0140  6E 6E 65 63 74 69 6F 6E 3A 20 63 6C 6F 73 65 0D    nnection: close.
0150  0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 69    .Content-Type: i
0160  6D 61 67 65 2F 70 6E 67 0D 0A 45 78 70 69 72 65    mage/png..Expire
0170  73 3A 20 54 68 75 2C 20 32 35 20 44 65 63 20 32    s: Thu, 25 Dec 2
0180  30 30 38 20 30 35 3A 32 34 3A 35 37 20 47 4D 54    008 05:24:57 GMT
0190  0D 0A 0D 0A 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D    .....PNG........
01A0  49 48 44 52 00 00 00 5A 00 00 00 14 04 03 00 00    IHDR...Z........
01B0  00 FF D4 37 2D 00 00 00 30 50 4C 54 45 04 02 04    ...7-...0PLTE...
01C0  24 22 24 74 76 74 44 46 44 8C 8A 8C BC BA BC 54    $"$tvtDFD......T
01D0  56 54 9C 9A 9C 64 66 64 34 32 34 14 12 14 FC FE    VT...dfd424.....
01E0  FC EC EE EC CC CE CC AC AA AC DC DE DC 7E 9E 46    .............~.F
01F0  91 00 00 01 74 49 44 41 54 78 9C B5 92 BD 4B 03    ....tIDATx....K.
0200  41 10 C5 5F A2 89 7A 41 02 B6 69 FC E8 BC 32 92    A.._..zA..i...2.
0210  E6 10 D2 DB 88 90 C6 43 B4 4F 61 1A 41 48 13 B0    .......C.Oa.AH..
0220  B4 11 B4 4B 8A 03 B1 0A 42 CC 87 31 CE 9D 09 82    ...K....B..1....
0230  85 49 63 AD 7F C2 81 D8 A7 F1 ED 1D D1 70 9B C6    .Ic..........p..
0240  C2 57 CC EC 6F 66 77 66 76 59 E0 6F 5A 59 A7 56    .W..ofwfvY.oZY.V
0250  B9 D8 2A AC 29 4E 9E 9C 06 F1 AB C2 E6 0C B4 84    ..*.)N..........
0260  6A 00 0B 74 15 C0 B0 45 F6 19 5E 14 71 2F 34 0C    j..t...E..^.q/4.
0270  77 0F 80 A2 1C C8 50 1D 7A 91 27 86 33 72 28 5F    w.....P.z.'.3r(_
0280  1A E2 3A 9B DD 56 45 FD 7B 98 0F 0C BB 4E 55 58    ..:..VE.{....NUX
0290  A5 DC 84 AF A3 52 B1 4D 63 37 60 35 01 B3 CD 7A    .....R.Mc7`5...z
02A0  79 60 FC 88 62 57 43 CA 18 A9 1E 66 0B 66 8F AE    y`..bWC....f.f..
02B0  89 B8 EC 02 EC 9B E9 68 48 CD CB 11 ED 2D E7 2E    .......hH....-..
02C0  05 C5 E2 BC C6 1C B7 A4 44 43 75 03 4F D9 D8 48    ........DCu.O..H
02D0  3C 07 A8 F6 9D 34 9F 68 92 8E A0 9A 21 18 BF C6    <....4.h....!...
02E0  DA EF 40 42 F6 EC A9 74 04 A9 F1 20 B0 2D EC F0    [email protected]... .-..
02F0  1E C6 87 78 53 E9 08 82 AB 92 1A 44 DE 50 77 B9    ...xS......D.Pw.
0300  88 7F 9E 31 B5 A4 D2 7D 1D 79 C9 4A 70 E6 A7 57    ...1...}.y.Jp..W
0310  5C 1D 67 41 AB 33 03 13 E2 04 B5 87 B0 78 FA A6    \.gA.3.......x..
0320  C0 00 DF C8 EE A9 D7 8B 22 90 72 83 12 B6 97 1B    ........".r.....
0330  93 D3 B2 51 56 2D CF BD DC E8 4E 43 A0 1E 36 AC    ...QV-....NC..6.
0340  F1 BB F0 4D 92 74 AF C4 65 FA BC 86 98 8C 17 F3    ...M.t..e.......
0350  A5 AB 46 3A 96 8E FA 6C 86 2F CF D0 F1 57 D9 D0    ..F:...l./...W..
0360  5D 3A E1 7F 98 8D FF A6 6F 32 59 DC 82 11 A2 B0    ]:......o2Y.....
0370  A5 00 00 00 00 49 45 4E 44 AE 42 60 82             .....IEND.B`.


Content-Type: image/png Tells my program that it is a PNG image file. Now my question is, How do i handle this data and create the png file? is the whole source what needs to be output and what do i use to output the data? BinaryWriter or StreamWriter? If its not the whole source what is the delimiter? Thanks in advance.
#4
Thank you
#5
.NET Platform / [VB.Net] Cross-Threading question.
December 01, 2008, 07:46 PM
Okay I will have a class that will have 2 threads sent to it. My question is what will be the best way for those threads to access a function that accesses 2 of my controls(listbox and a trackbar) that is in my form1 class without crossthreading?

Ex:(form1.vb)

public function INeedToAccessThis() as string
'do stuff with listbox
'do stuff with trackbar
return infoneeded
end function

ex: Class1

public sub ThreadProc()
'need to call form1.INeedToAccessThis
end sub
#6
Also, I haven't seen warden. Wonder when it will be enabled again.
#7
C/C++ Programming / WinInet HttpSendRequest Fails
September 10, 2008, 11:50 PM
Hello All I am trying to pass Basic Authentication using WinInet and I am having some issues. As of right now, My call to HttpSendRequest() Fails. Following th is failure I call GetLastError() which is returning 6 and I cannot find any Information on this error value return so I'm posting for some help. Right now im using my router basic authentication to test my program (Yes I have tested it against Basic Auth Sites - Same problem). Here is my code:


DWORD WINAPI MyThreadFunction( LPVOID lpParam )
{
HINTERNET openHandle, connectHandle, resourceHandle;
DWORD status;
DWORD statusSize = sizeof(status);
memset(&status, 0, sizeof(DWORD));
openHandle = InternetOpen("HTTP",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
if(openHandle = NULL){
MessageBox(NULL, "InternetOpen Failed!", NULL, MB_OK);
ExitThread(0);
}

connectHandle = InternetConnect(openHandle,"192.168.1.1",
INTERNET_INVALID_PORT_NUMBER, "User", "Pass",INTERNET_SERVICE_HTTP,0,0);
if(connectHandle = NULL){
MessageBox(NULL, "InternetConnect Failed!", NULL, MB_OK);
ExitThread(0);
}

resourceHandle = HttpOpenRequest(connectHandle,"GET","/","HTTP/1.1",NULL,NULL,
INTERNET_FLAG_KEEP_CONNECTION,0);

if(resourceHandle = NULL)
{
MessageBox(NULL, "HttpOpenRequest Failed!", NULL, MB_OK);
}else{
if(!HttpSendRequest(resourceHandle,NULL,0,NULL,0))
{
DWORD theError = GetLastError();
char tmp[200];
sprintf(tmp, "%d", theError);
MessageBox(NULL, tmp, "HttpSendRequest Failed", MB_OK);
ExitThread(0);
}
HttpQueryInfo(resourceHandle, HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_STATUS_CODE,
&status, &statusSize, NULL);
/*InternetCloseHandle(resourceHandle);
InternetCloseHandle(openHandle);
InternetCloseHandle(connectHandle);*/

switch (status)
{
case 4:
MessageBox(NULL, "4", NULL, MB_OK);
break;
case 400:
MessageBox(NULL, "400 - Bad Request", NULL, MB_OK);
break;
case 401: //401 - Server Authentication Required.
MessageBox(NULL, "Auth Required", NULL, MB_OK);
break;
case 200-207:
MessageBox(NULL, "200 Ok", NULL, MB_OK);
break;
case 404:
MessageBox(NULL, "404 - Not Found", NULL, MB_OK);
break;
case 403:
MessageBox(NULL, "403 - Forbidden", NULL, MB_OK);
break;
case 405:
MessageBox(NULL, "405 - HTTP Method Not Allowed.", NULL, MB_OK);
break;
case 407:
MessageBox(NULL, "407 - Proxy Authentication Required.", NULL, MB_OK);
break;
case 301-302: case 304: case 307:
MessageBox(NULL, "3xx", NULL, MB_OK);
break;
case 500:
MessageBox(NULL, "500 - Server Internal Error", NULL, MB_OK);
break;
default:
{
char f = (char)status;
MessageBox(NULL, "Default", (const char*)f, MB_OK);
}
break;
}
}
ExitThread(0);
return 0;
}


Does anyone see any problems? The MessageBox that contains the GetLastError return value prints "6". Thanks in advance.
#8
Ok so heres the question I have. I have an exe that is having a command line passed to it. What i need to do is find out exactly what it is being passed to it so I can "mimic" it and utilize this in one of my programs, How would i go about doing this?
#9
Battle.net Bot Development / Re: 0x51 Invalid Version
September 29, 2007, 11:47 PM
There are many threads on this topic. Search?
#10
Ok, what I'm looking for here is some opinions on how I would find a Ip with the html source of a site. Somewhat like a Proxy Leecher works. What do you think the most efficent way would be? I'm sure I could do it using the InStr() method but I'm not sure if there is a better way to achieve this goal.
#11
Quote from: Kyro on July 08, 2007, 11:29 PM
Pardon my stupidity, but the thread doesn't say what exactly needs to be sent as a response to the 0x5E. So elaboration would most definitely be appreciated.

If you would take the time to READ, the response to 0x5E is unknown as of right now.
#12
Battle.net Bot Development / Re: hmm
May 29, 2007, 10:34 PM
Very nice work Rob. Congratz.
#13
Welcome Dino.
#14
Quote from: Goran on April 14, 2007, 08:34 PM
Dim ClientToken As Long
Dim Password As String
Dim NewHash As Long
ClientToken = GetTickCount()
Password = LCase(BotVar.NewPassword)
X NewHash, Password
With pBuffer
.InsertDWORD ClientToken
.InsertDWORD BotVar.ServerTokenMCP
.InsertDWORD BotVar.PasswordHash
.InsertDWORD NewHash
.InsertNTString BotVar.UserNameLAP
.SendPacketLAP &H31
End With

Getting type mismatch at BotVar.PasswordHash
When i put my mouse over it I see the hash info, strange characters blah blah.. sooo.. I guess I don't really know what type mismatch means.  If someone would kindly explain as I am a novice :)

(DWORD)       Client Token
(DWORD)       Server Token
(DWORD[5])    Old password hash
(DWORD[5])    New password hash
(STRING)     Account name

Hrmm well lets see. DWORD[5], first off do you know what this means? Second off your passing a string to and sub that's expecting a long. Same with the new password hash. Alot of people handle this as a Non Null Terminated string because its eazier then 5 DWORDS, So put InsertNonNTString Oldhash and InsertNonNTSting newhash

And see what it gets you ;)

"BotVar.ServerTokenMCP" lmao?
#15
Quote from: brew on March 30, 2007, 05:27 PM
Edit***
or skywing can release the checkrevision formulas all together and save us very much trouble, and save bandwith too. there is absolutely no valid reason to hold it back from the general public.

Speak for yourself. First off, he did the work and research for getting the formula, NOT YOU So therefore you have no say so. Second off, he host a public server at no charge so you can actually have a working bot.

Let me say on behalf of the community, Thank you skywing. Brew, your a moron.