Last active
August 15, 2023 12:36
-
-
Save FaresAtef1/df390feab5366ac0a0e97b991ffd85ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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