• Welcome to Valhalla Legends Archive.
 

Dynamic buffer

Started by UserLoser., March 28, 2005, 12:40 AM

Previous topic - Next topic

UserLoser.

...with what I think is that GNU GPL thingy
http://www.userloser.net/files/source/clsDynamicBuffer.cls

How to use -> self explanatory but I feel the need to explain anyways.

Declare an instance (which will be used throughout this example):

Dim DynBuf As New clsDynamicBuffer


Set the buffer:

Call DynBuf.ResetBuffer(NewBufferData)


Build a buffer:

DynBuf.NextByte = &HFF
DynBuf.NextByte = &HE
DynBuf.NextWord = &H8
DynBuf.NextString = "hmm"


Add data (no null terminator follows):

Call DynBuf.AddBytes(OutData)


Pick apart the buffer:

SomeVar = DynBuf.NextByte()
SomeOtherVar = DynBuf.NextString()
SomeVariable = DynBuf.NextDword()


Grab some data by length:

Signature = DynBuf.GetBytes(128)


Get the whole buffer:

BufferData = DynBuf.Buffer()


Clear the buffer:

Call DynBuf.ResetBuffer(vbNullString)


Destroy the buffer:

Set DynBuf = Nothing


Enjoy.

Newby

Noodlez told me he did something like this when he coded a VB bot. He could extract DWORDs and such out of a buffer by doing recvBuff.GetNextDWord()

It sounded neat.

Anyways, good to see you release something that will benefit others. :)
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

dxoigmn

In the get property NextString() why increase the buffer position (m_Pos) when you don't actually find a vbNullChar?

Adron

Haha, neat, you're turning people's bots into GPL software!

UserLoser.

Quote from: dxoigmn on March 28, 2005, 02:42 AM
In the get property NextString() why increase the buffer position (m_Pos) when you don't actually find a vbNullChar?

Hmm, oops.  Thanks.  I kept finding small things that I overlooked which I didn't find when I was testing it right before I posted this thread.

dxoigmn

Quote from: UserLoser on March 28, 2005, 11:38 AM
Quote from: dxoigmn on March 28, 2005, 02:42 AM
In the get property NextString() why increase the buffer position (m_Pos) when you don't actually find a vbNullChar?

Hmm, oops.  Thanks.  I kept finding small things that I overlooked which I didn't find when I was testing it right before I posted this thread.

Hehe, the beauty of open-source :P

Newby

Quote from: Adron on March 28, 2005, 08:18 AM
Haha, neat, you're turning people's bots into GPL software!

I don't think he realized (or maybe he just overlooked) that now tons of bots that utilize this are going to have to be open-source. :P
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

UserLoser.

Quote from: Newby on March 29, 2005, 10:44 AM
Quote from: Adron on March 28, 2005, 08:18 AM
Haha, neat, you're turning people's bots into GPL software!

I don't think he realized (or maybe he just overlooked) that now tons of bots that utilize this are going to have to be open-source. :P

So what happens if I find someone who is using this without creditting/making their product open soruce or whatever?  Can I sue them and become really rich?

Newby

Quote from: UserLoser on March 29, 2005, 01:02 PM
So what happens if I find someone who is using this without creditting/making their product open soruce or whatever?

Violations of the GPL, LGPL, and GFDL

Taken from the page: Licenses
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.