Skip to content

Conversation

@echel0nn
Copy link
Contributor

No description provided.

int pos = 0;
// example fields
ehdr->e_ident[EI_CLASS] = (uint8_t *)(in_buf + pos);
pos = pos + 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi you could do

ehdr->e_ident[EI_CLASS] = (uint8_t *)(in_buf + pos++);

instead of

 ehdr->e_ident[EI_CLASS] = (uint8_t *)(in_buf + pos);
 pos = pos + 1;

pos = pos + 4;
// physical addr
phdr->p_paddr = (uint64_t *)(in_buf + pos);
pos = pos + 8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and fyi these can be shortened with

pos += 8;

@vanhauser-thc
Copy link
Member

can you please add a description for this in custom_mutators/examples/README.md ?

@echel0nn
Copy link
Contributor Author

thanks for the review! also added a description in custom_mutators/examples/README.md

@vanhauser-thc
Copy link
Member

thank you!

@vanhauser-thc vanhauser-thc merged commit fd21917 into AFLplusplus:dev Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants