Guest User

Untitled

a guest
Jul 15th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. u64 StrTitleIdToLong(char * str_title_id, u8 title_type)
  2. {
  3. //Hmm somewhat failed with 64 bit bitwise operations, hence below senseless switch code..
  4. //Though possibly it's irrelevant
  5. u64 title_id;
  6. if (title_type=='1') {
  7. title_id = 0x0001000100000000LL;
  8. } else if (title_type =='2') {
  9. title_id = 0x0001000200000000LL;
  10. } else if (title_type =='4') {
  11. title_id = 0x0001000400000000LL;
  12. } else if (title_type =='8') {
  13. title_id = 0x0001000800000000LL;
  14. } else return 0LL;
  15.  
  16.  
  17. title_id = title_id +
  18. (((u64)str_title_id[0])<<24) +
  19. (((u64)str_title_id[1])<<16) +
  20. (((u64)str_title_id[2])<<8) +
  21. ((u64)str_title_id[3]);
  22.  
  23. return title_id;
  24. }
Add Comment
Please, Sign In to add comment