Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper structure support #26

Closed
vit9696 opened this issue Oct 26, 2015 · 5 comments · Fixed by #95
Closed

Improper structure support #26

vit9696 opened this issue Oct 26, 2015 · 5 comments · Fixed by #95

Comments

@vit9696
Copy link

vit9696 commented Oct 26, 2015

pfp seems to work very bad with structure typedefing.

Something like that would work with both template parsers (010 Editor and pfp):

typedef struct MY_STRUCT_S {
    char magic[4];
    unsigned int filesize;
} MY_STRUCT;
LittleEndian();
MY_STRUCT s;

The rest will fail with all kinds of errors in pfp:

struct MY_STRUCT {
    char magic[4];
    unsigned int filesize;
};
LittleEndian();
MY_STRUCT s;
typedef struct MY_STRUCT {
    char magic[4];
    unsigned int filesize;
};
LittleEndian();
MY_STRUCT s;
struct MY_STRUCT {
    char magic[4];
    unsigned int filesize;
};
LittleEndian();
struct MY_STRUCT s;
struct MY_STRUCT {
    char magic[4];
    unsigned int filesize;
};
typedef struct MY_STRUCT ME;
LittleEndian();
ME s;

And I suppose it is not the end. Pretty much the same happens to enums, for example.

@d0c-s4vage d0c-s4vage added bug and removed bug labels Sep 10, 2016
@d0c-s4vage d0c-s4vage modified the milestone: 0.2 Sep 10, 2016
@d0c-s4vage
Copy link
Owner

You're great at finding errors for py010parser :^)

Closing here and recreating it over there. Wish there was an easier way to do that.

@d0c-s4vage
Copy link
Owner

Sigh. This issue does belong in pfp and not py010parser.

Currently all test cases pass except for the last one

@d0c-s4vage
Copy link
Owner

This is really biting pfp right now. I think a lot of the struct support needs to be rethought/reworked

@d0c-s4vage
Copy link
Owner

@vit9696 thanks so much for reporting these issues! it's taken a while, but things are slowly shaping up :^)

@vit9696
Copy link
Author

vit9696 commented Jan 6, 2020

@d0c-s4vage no problem, actually we opensourced the script that we used to report our issues from. Binary files are here. It is quite complex, so it can be a nice test for pfp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants