ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Jun 21, 2021 12:43 am

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: XXhash
PostPosted: Fri Mar 19, 2021 11:01 pm 

Joined: Thu Aug 07, 2014 10:28 pm
Posts: 379
I see it mentioned in quickbms but i could not find an example

sample .net code
Code:
using System;
using System.Text;
using System.Security.Cryptography;
using Extensions.Data;
               
public class Program
{
   public static void Main()
   {
      byte[] input = Encoding.ASCII.GetBytes("Portal_QBHN.plist");         // the data to be hashed.
      byte[] result = null;
      using (HashAlgorithm xxhash = XXHash64.Create())
      {
         result = xxhash.ComputeHash(input);               // compute the hash.
      }
      if (result != null)
      {
         Console.WriteLine(BitConverter.ToInt64(result, 0).ToString("x"));
      }
   }
}


input
Quote:
Portal_QBHN.plist

output 0x22d6307b60c66430

How would I convert that to

Code:
\22\d6307b60c66430


Top
   
 Post subject: Re: XXhash
PostPosted: Sat Mar 20, 2021 7:06 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12296
This is the code for quickbms for calculating xxhash64:
Code:
encryption crc 0 "0 0 0 25 0 1"
set VAR string "Portal_QBHN.plist"
string VAR e VAR
print "%QUICKBMS_CRC|x%"

And the equivalent if the input is a file:
Code:
set MEMORY_FILE binary "Portal_QBHN.plist"
encryption crc 0 "0 0 0 25 0 1"
get SIZE asize MEMORY_FILE
log MEMORY_FILE 0 SIZE MEMORY_FILE
print "%QUICKBMS_CRC|x%"

You need to use quickbms_4gb_files.exe for the work because it's a 64bit crc.

If you want to "dump" that number in a variable use: string VAR = QUICKBMS_CRC
With endian big the result will just be the one you were expecting: "Ö0{`Æd0
Another alternative is using the byte2hex conversion (string or log)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited