Jump to content

Assembling Bytes into packets.


Recommended Posts

Hi all,

This is a simple question - I want to assemble a message to send in a TCP connection (specifically, guntella)

This is what the packet will contain.

GUNTELLA HEADER STRUCTURE:

Byte Pos Name

0 - 15 Message ID

16 Function ID

17 TTL Remaining

18 Hops taken

19 - 22 Data Length

Firstly, how do I individually 'make' data in this fashion? Secondly, how do I 'string' them together?

if your wondering? Ill use the guntella network as a backup to find peers for my p2p network.

Thx in advance,

-Twitchy.

Edited by twitchyliquid64

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

That's fairly simple task using dllstruct:

$GUNTELLA_HEADER = DllStructCreate("byte MessageID[16];" & _
        "byte FunctionID;" & _
        "byte TTLRemaining;" & _
        "byte Hopstaken;" & _
        "dword DataLength;")
;... set fields here ...

; Binary:
$bBinary = DllStructGetData(DllStructCreate("byte[" & DllStructGetSize($GUNTELLA_HEADER) & "]", DllStructGetPtr($GUNTELLA_HEADER)), 1)

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

That's fairly simple task using dllstruct:

$GUNTELLA_HEADER = DllStructCreate("byte MessageID[16];" & _
        "byte FunctionID;" & _
        "byte TTLRemaining;" & _
        "byte Hopstaken;" & _
        "dword DataLength;")
;... set fields here ...

; Binary:
$bBinary = DllStructGetData(DllStructCreate("byte[" & DllStructGetSize($GUNTELLA_HEADER) & "]", DllStructGetPtr($GUNTELLA_HEADER)), 1)

So then would I just do...

$GUNTELLA_HEADER = DllStructCreate("byte MessageID[16];" & _
        "byte FunctionID;" & _
        "byte TTLRemaining;" & _
        "byte Hopstaken;" & _
        "dword DataLength;")
$FunctionID = ;Um, however you make 16 bytes of randomness
$TTLRemaining = 8
$Hopstaken = 0
$DataLength = 0
; Binary:
$bBinary = DllStructGetData(DllStructCreate("byte[" & DllStructGetSize($GUNTELLA_HEADER) & "]", DllStructGetPtr($GUNTELLA_HEADER)), 1)

??? How do you 'set' in Dllstruct???

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

Im still confused: how would I make say 0x50 in the data on the first place? is there any way i can do this without any complex dll structs??? (thx by the way, you walk on golden sand :x)

?????

$GUNTELLA_HEADER = DllStructCreate("byte MessageID[16];" & _
         "byte FunctionID;" & _
         "byte TTLRemaining;" & _
         "byte Hopstaken;" & _
         "dword DataLength;") 

DllStructSetData ( $GUNTELLA_HEADER, "FunctionID", 0x50)

$bBinary = DllStructGetData(DllStructCreate("byte[" & DllStructGetSize($GUNTELLA_HEADER) & "]", DllStructGetPtr($GUNTELLA_HEADER)), 1)

????

Edited by hyperzap

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

This will help you understand what I plan to do and how the messages must be structured; im not very good at explaining.

http://capnbry.net/gnutella/protocol.php

The end result (once Ive figured out how to generate the packets) will hopefully be a UDF to fully interact with the Guntella network.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...