Skip to content

Instantly share code, notes, and snippets.

@FaresAtef1
Last active August 15, 2023 12:36
Show Gist options
  • Save FaresAtef1/df390feab5366ac0a0e97b991ffd85ff to your computer and use it in GitHub Desktop.
Save FaresAtef1/df390feab5366ac0a0e97b991ffd85ff to your computer and use it in GitHub Desktop.
ut64 ut8_to_ut64(ut8 *data,ut64 data_size) {
ut64 result=0;
for(ut64 i=0;i<data_size;i++){
result|=((ut64) data[i]) << (8*i);
}
if(data_size<sizeof(ut64)){
for(ut64 i=0;i<sizeof(ut64);i++){
result|=((ut64) 0) << (8*i);
}
}
return result;
}
// Then we can use this function for casting in all the places that cause the warnings.
// If you want me to make a PR to test this, please let me know, mentors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment