mirror of
https://github.com/grp/Wii.py.git
synced 2025-06-19 07:15:49 -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):
|
def align(x, boundary):
|
||||||
return x + (x % boundary)
|
return x + (x % boundary)
|
||||||
|
|
||||||
|
def hexdump(s,sep=" "):
|
||||||
|
return sep.join(map(lambda x: "%02x"%ord(x),s))
|
||||||
|
|
||||||
class Crypto:
|
class Crypto:
|
||||||
"""This is a Cryptographic/hash class used to abstract away things (to make changes easier)"""
|
"""This is a Cryptographic/hash class used to abstract away things (to make changes easier)"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -21,7 +24,7 @@ class Crypto:
|
|||||||
def ValidateHash(self, data, hash):
|
def ValidateHash(self, data, hash):
|
||||||
"""Validates a hash. (BROKEN)"""
|
"""Validates a hash. (BROKEN)"""
|
||||||
return 1 #hack
|
return 1 #hack
|
||||||
# if(hashlib.sha1(data).digest() == hash):
|
# if(hashlib.sha1(data).hexdigest() == hexdump(hash, "")):
|
||||||
# return 1
|
# return 1
|
||||||
# else:
|
# else:
|
||||||
# return 0
|
# return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user