Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Hex Workshop structure

Name: Anonymous 2011-01-24 14:06

Anybody familiar with Hex Workshop and its structure libraries?

I've been coding a parser for a game file format and it works rather well. But I'd like to add support for a rare exception and thus have to add a conditional on a certain value.

typedef struct tagPIXELMAP
{
    DWORD pixDtype;
    DWORD pixUnknown;
    BYTE pixIflag;
    SIZE pixSize;
    zstring null_terminated_str;
    STATE pixRflag;
   
//    if (pixRflag == 3)
//    {
//        blob cpixOne[15];
//        zstring null_terminated_str;
//        blob cpixTwo[1048];
//        STATE pixRflag2;
//    };
   
    DWORD pixRatioA;
    DWORD pixRatioB;
    DWORD pixRend;
    blob pixData[pixRatioA-8];
    UQUAD pixEnd;

    // Verify that the pixelmap looks sane
    __verify(
        (pixDtype == 0x3) &&                // Expected type: 03h
        (pixIflag == 0x3) &&                // Should always be 3
        (pixSize.pixWidthA == pixSize.pixWidthB) &&    // Both width should be the same
        (pixSize.pixWidthH == (pixSize.pixWidthA / 2)) &&
        (pixSize.pixHeightH == (pixSize.pixHeight / 2)) &&
        (pixRflag == 0x21) &&                // Always 21h
        (pixRend == 0x1) &&                // Always 1
        (pixEnd == 0x0)                    // Always null
        ) ;
} PIXELMAP ;

The commented chunk is the conditional I mean. If pixRflag (which precedes the if statement directly) is equal to 0x21 everything's ok, if it's equal to 0x3 then its the exception etc. The problem is that the zstring that precedes pixRflag stops working correctly if I uncomment the damn chunk. While it's supposed to stop the string as soon as it finds a null byte, here it will stop after two bytes. Is this a fucking bug in Hex Workshop code parser or am I missing something...

Name: Anonymous 2011-01-24 14:11

noko
What's with the influx of new people? I don't think it's ever been this bad.

Name: Anonymous 2011-01-24 14:15

>>2
It's the same guy.

Name: Anonymous 2011-01-24 14:16

>>3
Seems like to much effort to be just one guy. Then again if it is he's an EXPERT TROLL.

Name: Anonymous 2011-01-24 14:18

>>4
He could just google the ``do the homework for me'' code and post it here.

Name: Anonymous 2011-01-24 14:29

>>2
Oh my! I put noko in the email field, you just shat your pants! And yeah I'm just coming here 'cause I need the help of this board...

BTW my request is serious. Actually you guys are trolling your own board?!

Name: Anonymous 2011-01-24 14:31

>>6
It's all trolls. Trolling trolls.

Name: Anonymous 2011-01-24 14:32

>>6
the_game
I bet you think that's hilarious, punk.

Name: Anonymous 2011-01-24 14:36

>>8
Rather fascinating actually?!
There are people spending their time checking the email field.

Name: Anonymous 2011-01-24 14:41

What's a zstring?

Name: Anonymous 2011-01-24 14:45

>>10
Strings
 
The Hex Workshop structure view can accommodate three popular types of strings:
A variable length null (or zero) terminated string (zstring).
A fixed length string.
A variable length string where the length preceeds the string content.
Example of the tree string types are shown below:
 
struct stringexample
{
    zstring null_terminated_str;
    char fixed_length_str[128];
    struct length_first_str
    {
        WORD length;
        char string[length];
    };
};

Name: Anonymous 2011-02-04 16:45

Don't change these.
Name: Email:
Entire Thread Thread List