• Welcome to Valhalla Legends Archive.
 

Been awhile... what's changed?

Started by Mage, November 11, 2003, 12:04 PM

Previous topic - Next topic

Kp

Quote from: iago on November 11, 2003, 06:06 PMThere's a preprocessor directive to disable that, but I forget what it is.
Under gcc, it's the compiler-specific extension __attribute__ ((__packed__)) iirc.  Either there isn't a standard way of requesting data packing or nobody follows it, so don't assume it's a preprocessor definition everywhere. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

dxoigmn

Quote from: iago on November 11, 2003, 06:06 PM
that reminds me, sometimes structs line stuff up on 32 bit boundries to speed it up. There's a preprocessor directive to disable that, but I forget what it is.
#pragma pack(1) for MSVC++ 6 I believe.

warz

Well, I know you're not looking for code, but if you're looking for code regarding battle.net, feel free to check out http://tks.slacktech.com - it has plenty of examples in different languages, so you can get the feel of a possible good way, or method of doing things.

iago

Quote from: warz on November 11, 2003, 10:33 PM
Well, I know you're not looking for code, but if you're looking for code regarding battle.net, feel free to check out http://tks.slacktech.com - it has plenty of examples in different languages, so you can get the feel of a possible good way, or method of doing things.
eww, winbot source?  Shouldn't make that public, people should work if they want something like that! :P
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Mage

I see all the constants are defined in CPP/VB/etc. but no structures?  Does anyone have all the C++ structures defined that they can post?  Will save a lot of time.  It's much easier to convert C++ to C# as opposed to browsing around each message on BnetDocs and creating the structures one by one. :)

Thanks again for the help...

Mage

Adron

Quote from: Mage on November 12, 2003, 09:27 AM
I see all the constants are defined in CPP/VB/etc. but no structures?  Does anyone have all the C++ structures defined that they can post?  Will save a lot of time.  It's much easier to convert C++ to C# as opposed to browsing around each message on BnetDocs and creating the structures one by one. :)

I think most people create the structures dynamically by calls like "insertbyte", "insertword", "insertdword", "insertzeroterminatedstring" etc. Because many of the packets have variable length fields, you can't use C++ structures for everything, and the packets that you could use them for are easy enough to generate anyway.

Mage

Quote from: Adron on November 12, 2003, 10:54 AM

I think most people create the structures dynamically by calls like "insertbyte", "insertword", "insertdword", "insertzeroterminatedstring" etc. Because many of the packets have variable length fields, you can't use C++ structures for everything, and the packets that you could use them for are easy enough to generate anyway.

Ah, I see.  Alright, that'll do.  I'll follow suit then.  

Thanks,

Mage

Banana fanna fo fanna

Or, could write structures which have serialize/deserialize methods.

Maddox

Quote from: kamakazie on November 11, 2003, 10:18 PM
Quote from: iago on November 11, 2003, 06:06 PM
that reminds me, sometimes structs line stuff up on 32 bit boundries to speed it up. There's a preprocessor directive to disable that, but I forget what it is.
#pragma pack(1) for MSVC++ 6 I believe.

I believe it would be something like

#pragma pack(push, r1, 1)
//struct
#pragma pack(pop, r1)

or

#include <pshpack1.h>
//struct
#include <poppack.h>
asdf.