• Welcome to Valhalla Legends Archive.
 

InsertNTString, InsertNonNTString

Started by Don Cullen, February 12, 2007, 12:17 PM

Previous topic - Next topic

Barabajagal

Quote from: UserLoser on February 12, 2007, 09:14 PM
Quote from: [RealityRipple] on February 12, 2007, 06:04 PM
when the client sends a string value in SID_REGISTRY, does it have a null terminator?

Yes

You may wanna mention that on the BNetDocs page for it then... although I guess people should assume all strings are null terminated.

Hdx

Its defined in BNetDocs what each data type is.
So whats the point of this?
And as for making the packet what we want.
What it REALLY is is a stream of memory.
In most languages, there are data types to make life a lot easier.
For example which is easier to understand someone saying 104 101 108 108 111, or something saying hello
Programming is ment to make your life easier, so don't make it more complicated then it is.
If you understand how memory works then you will understand how Bnet games communicate. But cause according to what I find in some of tyhe games. All it is doing when its sending the packet is Sending 0xff, sending the packet ID, (stored in a byte vareable that is constant) the length of the packet data is stored in a short, which is a word (2 bytes) in memory [in most computers]
and then its jsut starting at point x in memory and spitting out untill it reaches the end.
Its not treating it as any data type but raw data..
Humm I think I sound like a moron.
Anyways in conclusion, the data types are a convention agreed upon by anyone who actually knows what they are doing to be the most efficient/easiest way of doing things.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Don Cullen

Quote from: [RealityRipple] on February 12, 2007, 09:24 PM
Quote from: UserLoser on February 12, 2007, 09:14 PM
Quote from: [RealityRipple] on February 12, 2007, 06:04 PM
when the client sends a string value in SID_REGISTRY, does it have a null terminator?

Yes

You may wanna mention that on the BNetDocs page for it then... although I guess people should assume all strings are null terminated.

Agreed.
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

UserLoser

Quote from: [RealityRipple] on February 12, 2007, 09:24 PM
Quote from: UserLoser on February 12, 2007, 09:14 PM
Quote from: [RealityRipple] on February 12, 2007, 06:04 PM
when the client sends a string value in SID_REGISTRY, does it have a null terminator?

Yes

You may wanna mention that on the BNetDocs page for it then... although I guess people should assume all strings are null terminated.

Why would I have to?  When using RegQueryValueEx, the string will be NULL terminated.  It's marked as void for a reason.  Void means there is no datatype, it could be anything the server requested.

Barabajagal

O.o I forgot QueryValue had a null terminator... I always use a function i made a while ago that removes it automatically... Sorry.

Joe[x86]

Quote from: BreW on February 12, 2007, 02:20 PM
Because the packets you send all turn out to be strings anyways

Nope. Byte array.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Don Cullen

At the risk of sounding stupid, I was looking at S->C 0x01 BNLS_CDKEY packet in BNETDocs, and noticed that part of the packet was a boolean value. How exactly would I extract a boolean? Do I extract it as a WORD, or...?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

brew

#23
Quote from: Joex86] link=topic=16301.msg164730#msg164730 date=1171405660]
Quote from: BreW on February 12, 2007, 02:20 PM
Because the packets you send all turn out to be strings anyways

Nope. Byte array.

Wrong. You're passing a string value when you send a packet using a Winsock control.. Try it yourself (Winsock.SendData datahere)
And you don't have to end your string with a null terminator for it to be a string.

and @ HDX, I agree. But in bnetdocs, it should be a string, with a null terminator (assumed) unless specifically stated otherwise. anything else that's a "nonntstring" should really, be left alone with their true file type name (ex. DWORD, FILETIME)
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

l2k-Shadow

Quote from: BreW on February 13, 2007, 05:06 PM
Quote from: Joex86] link=topic=16301.msg164730#msg164730 date=1171405660]
Quote from: BreW on February 12, 2007, 02:20 PM
Because the packets you send all turn out to be strings anyways

Nope. Byte array.

Wrong. You're passing a string value when you send a packet using a Winsock control.. Try it yourself (Winsock.SendData datahere)
And you don't have to end your string with a null terminator for it to be a string.

Winsock.SendData accepts a variant expression, not a string value. You can pass it a byte array and achieve the exact same result as passing a string. Strings are byte arrays.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Barabajagal

And byte arrays are strings. Strings are the more common data type, but they're the same thing.

rabbit

Nope.  A string is either a series of bytes with a null terminator, or a WORD with the length of the string and then the actual string data.  A byte array is an array of bytes.  Learn the difference.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Hdx

http://bnetdocs.valhallalegends.com/content.php?Section=d&id=8
QuoteSTRING     Null-terminated array of characters.
On bnetdocs there is no such thing as a non nt strng
Learn to read EVERYTHING!
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Barabajagal

"A series of bytes"... hmm what's another word for series? ARRAY. whaddya know.

brew

This is sad. Data is data. Stop arguing about it. It's all the same thing, it's just the way we choose to represent a certain value is what's different. O.K.?
And Kyro, try extracting a boolean value by extracting it as a 4 byte string, then using CBool(). Although it's obvious that FALSE is a 0, and anything else is a TRUE. Do whatever pleases you.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

|