• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 26 27 28 29 30 ... 117 Next »

What exactly is passed to XXH64 when creating hashes?
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
What exactly is passed to XXH64 when creating hashes?
10-08-2016, 05:41 AM
#1
Invader Offline
Forum Lurker
****
Posts: 409
Threads: 14
Joined: Sep 2011
So, I wrote a script for Wiimm's tools to extract all the textures from Paper Mario: The Thousand Year Door, when JosJuice brought up this:

(10-06-2016, 02:10 AM)JosJuice Wrote: If the image data you get from this is identical to the image data you would get from Dolphin, it's possible to write a program that calculates image hashes in the same way as Dolphin.

So, what I want to know is what xxh64 sees when Dolphin passes the data to it. Also Is it using a seed when hashing? The only thing I could find was this: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/ImageWrite.cpp#L27
From what I understand this states that the data should be 8-bit RGBA. I'm not fluent in C++ so I have no idea if the code reflects that comment. Tbh... not even sure what I'm saying makes sense. Tongue

I tested the go version and the python version of XXHash. The thing is I'm obviously doing something wrong because they're giving me different hashes for the same files!

I attached the python script and the xxhsum.exe (might require go to run, I have no idea). Huh

Here's the .py script I wrote.
Code:
import os
import xxhash

path='' #placeholder for later
in_filename='test.rgba.data' #this should be changed to the input file
with open(in_filename, 'rb') as f:
   xxhash.xxh64(f.read()).hexdigest()

Sorry, if these questions sound really stupid. Never done any real coding in my life until now. Tongue

Any help would be appreciated. Smile


Attached Files
.7z   HALP.7z (Size: 472.9 KB / Downloads: 122)
[Image: 3qpbaX8.png]
Find
Reply
10-08-2016, 08:46 AM
#2
degasus Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,828
Threads: 10
Joined: May 2012
Almost: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/HiresTextures.cpp#L277 and https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/TextureCacheBase.cpp#L747

So it hashes the texture in the native GC format, which is tiled and often encoded in uncommon formats.
Find
Reply
10-09-2016, 02:35 AM
#3
Invader Offline
Forum Lurker
****
Posts: 409
Threads: 14
Joined: Sep 2011
(10-08-2016, 08:46 AM)degasus Wrote: Almost: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/HiresTextures.cpp#L277 and https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/TextureCacheBase.cpp#L747

So it hashes the texture in the native GC format, which is tiled and often encoded in uncommon formats.
Hashes match! Thanks a ton!

[Image: 0FL1njJ.png]
[Image: 3qpbaX8.png]
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode