bigeasy / packet

Incremental binary parsers and serializers for Node.js.
http://bigeasy.github.io/packet
MIT License
186 stars 25 forks source link

C++ structure to definition #621

Closed Silverlay closed 1 year ago

Silverlay commented 1 year ago

Heya, Bigeasy,

Can you please help me figure out what definition it should be for struct like:

typedef struct LOGON_CHALLENGE
{
    uint8   cmd;
    uint16  size;
    uint8   os[4];
    uint32  ip;
    uint8   I[1];
} sAuthLogonChallenge_C;

i got it as:

const definition = {
    object: {
        cmd: 8,
        size: 16,
        os: [ 4, [ 8 ] ],
        ip: 32,
        I: [ 1, [ 8 ] ]
    }            
}   

But it seems wrong. What am i missing?

Thanks in advance!

Silverlay commented 1 year ago

oh, got it as os: [ [ 4 ], [ 8 ] ]. Thanks anyway :)