• Welcome to Valhalla Legends Archive.
 

C++ CheckRevision

Started by Spilled, October 17, 2005, 01:31 PM

Previous topic - Next topic

Spilled

Quote from: Kp on October 25, 2005, 08:32 PM
I see no indication that you even responded to my advice, much less heeded it or even attempted to understand it.  Indeed, the very next post you made after I suggested BNLS || BNCSutil shows you persisting in digging for inferior code, when the tools I suggested are easily available, well known here, and therefore easier to support here.

I apologize, but I prefer hash connection and that is all i meant by that.

Warrior

BNCSUtil offers that in an easy to use way better suited for people starting out.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

UserLoser.

Quote from: Spilled[DW] on October 26, 2005, 12:52 PM
Quote from: Kp on October 25, 2005, 08:32 PM
I see no indication that you even responded to my advice, much less heeded it or even attempted to understand it.  Indeed, the very next post you made after I suggested BNLS || BNCSutil shows you persisting in digging for inferior code, when the tools I suggested are easily available, well known here, and therefore easier to support here.

I apologize, but I prefer hash connection and that is all i meant by that.

SYN and ACK are never hashed when creating a connection~ What are you talking about!?

Spilled

Quote from: UserLoser on October 26, 2005, 03:15 PM
Quote from: Spilled[DW] on October 26, 2005, 12:52 PM
Quote from: Kp on October 25, 2005, 08:32 PM
I see no indication that you even responded to my advice, much less heeded it or even attempted to understand it.  Indeed, the very next post you made after I suggested BNLS || BNCSutil shows you persisting in digging for inferior code, when the tools I suggested are easily available, well known here, and therefore easier to support here.

I apologize, but I prefer hash connection and that is all i meant by that.

SYN and ACK are never hashed when creating a connection~ What are you talking about!?

I'm talking about Connection using hashes instead of BNLS, What are you talking about!?

MyndFyre

Quote from: Spilled[DW] on October 26, 2005, 06:19 PM
I'm talking about Connection using hashes instead of BNLS, What are you talking about!?
BNLS hashes data, which you then use to connect to Battle.net, so what are you talking about?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

MyndFyre

Quote from: Spilled[DW] on October 24, 2005, 02:26 PM
Well like i said im still learning so im sorry about that so go ahead and flame me
That's not the point.  These forums aren't here so that we can get people to come here so we can flame them.  Instead of taking suggestions like "You need to learn pointers" as a flame, maybe you should actually learn pointers.


Quote from: Spilled[DW] on October 24, 2005, 02:26 PM
Now that I have gotten that to work passing the DWORD* to function is giving me an error....
OK.  Let's look at the function declaration:

class BnetAuth
{
public:
       BOOL CheckVersion(LPCTSTR lpszFileName1, LPCTSTR lpszFileName2, LPCTSTR lpszFileName3, LPCTSTR lpszValueString, DWORD * lpdwVersion, DWORD * lpdwChecksum, LPSTR lpExeInfoString, LPCTSTR lpszMpqFileName);
}

Before we go any further, I want you to tell me the following so we know you understand what you're doing:
1.) What does LPCTSTR mean?  Specifically, it can mean two things; I want you to tell me what those two things are and when they are them.
2.) Why are lpdwVersion and lpdwChecksum declared as DWORD* instead of DWORD?


        case 0x50:
             {
             cout << "0x50 Recieved!\n";
             LPCTSTR files[] = {"/STAR/starcraft.exe", "/STAR/storm.dll", "/STAR/battle.snp"};
             //cout << "1: " << files[0] << " \n2: " << files[1] << " \n3: " << files[2] << "\n";
             LPCTSTR mpqName;
             LPCTSTR hash;
             CopyMemory(&hash,&strData+37,len-38);
             DWORD *versionID;
             DWORD *checksum;
             LPSTR exeInfo;
             CopyMemory(hashing.serverToken,strData+8,4);

3.) You're using a Windows API function and a Linux file system notation.  Which is it that you want?
4.) Why are you using CopyMemory (which is actually RtlMoveMemory)?  It looks like you're copying strings....  what about strncpy?

Quote from: Spilled[DW] on October 24, 2005, 02:26 PM
Would appreciate some help vL!
With what?  You didn't actually ask a question.

Quote from: Spilled[DW] on October 24, 2005, 02:26 PM
and heres the CheckVersion functions if you need it...
No, we don't need it.  As Kp said, Yobgul's code is not supported here when there are several other viable, practical methods for doing local hashing and revision checks such as BNCSUtil.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Warrior

Bah I was never good with those Windows typedefs ;).

If anything (and if you can) BNCSUtil is open source, implement it directly into your code if it's a problem with DLLs.


Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

UserLoser.

Quote from: Spilled[DW] on October 26, 2005, 06:19 PM
Quote from: UserLoser on October 26, 2005, 03:15 PM
Quote from: Spilled[DW] on October 26, 2005, 12:52 PM
Quote from: Kp on October 25, 2005, 08:32 PM
I see no indication that you even responded to my advice, much less heeded it or even attempted to understand it.  Indeed, the very next post you made after I suggested BNLS || BNCSutil shows you persisting in digging for inferior code, when the tools I suggested are easily available, well known here, and therefore easier to support here.

I apologize, but I prefer hash connection and that is all i meant by that.

SYN and ACK are never hashed when creating a connection~ What are you talking about!?

I'm talking about Connection using hashes instead of BNLS, What are you talking about!?

BNLS uses hashes, and it sends those hashes back to you.  What are you talking about?

Spilled

#23
Quote from: UserLoser on October 26, 2005, 10:24 PM
Quote from: Spilled[DW] on October 26, 2005, 06:19 PM
Quote from: UserLoser on October 26, 2005, 03:15 PM
Quote from: Spilled[DW] on October 26, 2005, 12:52 PM
Quote from: Kp on October 25, 2005, 08:32 PM
I see no indication that you even responded to my advice, much less heeded it or even attempted to understand it.  Indeed, the very next post you made after I suggested BNLS || BNCSutil shows you persisting in digging for inferior code, when the tools I suggested are easily available, well known here, and therefore easier to support here.

I apologize, but I prefer hash connection and that is all i meant by that.

SYN and ACK are never hashed when creating a connection~ What are you talking about!?

I'm talking about Connection using hashes instead of BNLS, What are you talking about!?

BNLS uses hashes, and it sends those hashes back to you. What are you talking about?

Ok, let me rephrase this. local hashing so I do not have to depend on BNLS to be updated and be without bot when it's not been updated. I apologize once again.


MyndFyre:

1) LPCTSTR is a pointer to a const char string.
    and for the two things it can mean, i have no idea but I would have to guess... Unicode and DBCS? from looking in MSDN.

2) To pass the memory address to the function so that the variables in the parameters will act as that variable I pass to it... filling it in with the needed data. Key: "pointer"

3) I don't know, why don't you clear that up for me.  :)

4) Hrmm ... maybe I didn't think of that, maybe im still getting familiar with C++.

Finally:

I apologize once again for the Inconvience, but I have learned from my mistakes so... take it how you want it.

MyndFyre

Quote from: Spilled[DW] on October 27, 2005, 01:04 AM
1) LPCTSTR is a pointer to a const char string.
    and for the two things it can mean, i have no idea but I would have to guess... Unicode and DBCS? from looking in MSDN.
That is close.  LPCTSTR is very basically a char*.  I'm not convinced you know what Unicode is, otherwise you would have labeled its counterpart ANSI, not DBCS.

There are two character types in Visual C++: char and wchar_t.  char is a signed 8-bit value; wchar_t is a signed 16-bit value used specifically for Unicode characters.  Boiled down, LPCTSTR is defined like so:

#ifdef UNICODE
  typedef const wchar_t *LPCTSTR; // strings are made of 16-bit character literals
#else
  typedef const char *LPCTSTR; // strings are made of 8-bit character literals.
#endif


Quote from: Spilled[DW] on October 27, 2005, 01:04 AM
2) To pass the memory address to the function so that the variables in the parameters will act as that variable I pass to it... filling it in with the needed data. Key: "pointer"
That's right.  But let me show you how you declared your variables:

             DWORD *versionID;
             DWORD *checksum;

You have pointers.  Pointer variables store memory addresses.  So far, so good -- that's fairly straightforward.  However, before you call CheckVersion, you never actually take the memory location of a versionID or checksum variable (I really hope you're getting uninitialized pointer errors or warnings when you compile).  Using an uninitialized pointer is like having an envelope with information in it, and an address label on the front of it, but the address label being blank.  It could be useful, but as it is, it's not useful.

Because you're using uninitialized pointers, you could theoretically overwrite program code or attempt to write to a protected page, causing a program crash.  If you're lucky, your compiler will have at least set the pointer's value to NULL before use and you'll crash with only a null pointer error.

Quote from: Spilled[DW] on October 27, 2005, 01:04 AM
3) I don't know, why don't you clear that up for me.  :)
I can't answer that; you're the one writing the program.

Quote from: Spilled[DW] on October 27, 2005, 01:04 AM
4) Hrmm ... maybe I didn't think of that, maybe im still getting familiar with C++.
Stop using that excuse.  It's an excuse to keep writing subpar and incorrect code.  Want to learn the right way or keep saying "I'm lazy," "I don't care to change it," "I didn't know any better."  Make it your job to know better.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

#25
Quote3) I don't know, why don't you clear that up for me.  :)
he's saying that you're using *nix style paths in the files[] array

on Windows, file paths are named with \. eg: "C:\Program Files\somefile.exe"

on *nix, they are named like sooooo. "usr/whatever/somefile.bin"(or whatever file extension Executable files have on *nix)
you might wanna fix that to prevent plunty of errors