mirror of
https://github.com/grp/Wii.py.git
synced 2025-06-18 23:05:48 -04:00
Added hexdump, and also made the ValidateHash check work (if you pass it proper values, of course)
This commit is contained in:
parent
87851bdf33
commit
303e0c379e
@ -7,6 +7,9 @@ from Struct import Struct
|
||||
def align(x, boundary):
|
||||
return x + (x % boundary)
|
||||
|
||||
def hexdump(s,sep=" "):
|
||||
return sep.join(map(lambda x: "%02x"%ord(x),s))
|
||||
|
||||
class Crypto:
|
||||
"""This is a Cryptographic/hash class used to abstract away things (to make changes easier)"""
|
||||
def __init__(self):
|
||||
@ -21,7 +24,7 @@ class Crypto:
|
||||
def ValidateHash(self, data, hash):
|
||||
"""Validates a hash. (BROKEN)"""
|
||||
return 1 #hack
|
||||
# if(hashlib.sha1(data).digest() == hash):
|
||||
# if(hashlib.sha1(data).hexdigest() == hexdump(hash, "")):
|
||||
# return 1
|
||||
# else:
|
||||
# return 0
|
||||
|
Loading…
Reference in New Issue
Block a user