1 Attachment(s)
Resident Evil 5 Checksum Calculation help
Okay so i know where the checksum starts and ends the offsets are D008 - D00B. I need to know what type it is and if someone can calculate it or tell me how to code a calculation so i can update my new verison of the Resident Evil 5 editor that i am currently working on. The checksum for this current save is 92561417.
Here is the save: Attachment 5409
Again if someone finds out what type of checksum it is and how to code a button that will calculate the checksum then please post a code :)
Thanks to whoever helps me :) <3 lol
Re: Resident Evil 5 Checksum Calculation help
Can someone take a look? Cause im almost done with the v2 of my editor and i don't want to rely on another editor for the checksum /:
Re: Resident Evil 5 Checksum Calculation help
It's some simple addition and subtraction. A count of all UInt32 from 0xC to EOF (since file size is static, all data is covered by the loop) subtracting 0x100000000 from the result until result value is under 0x100000000
Code:
'// Pass extracted data (not STFS)
Function ComputeHash(ByVal File As String) As UInt32
Dim Reader As New PackageIO.Reader(File, Endian.Big, &HC)
Dim Hash As UInt64 = 0
For i As Int32 = 0 To (19376 / 4) - 1
Hash += Reader.ReadUInt32()
Next
Reader.Close(True, True)
Do While Hash > &H100000000UL
Hash -= &H100000000UL
Loop
Return Convert.ToUInt32(Hash)
End Function
Function ReadHash(ByVal File As String) As UInt32
Dim Reader As New PackageIO.Reader(File, Endian.Big, 8)
Dim Hash As UInt32 = Reader.ReadUInt32
Reader.Close(True, True)
Return Hash
End Function
Sub WriteHash(ByVal File As String)
Dim Hash As UInt32 = ComputeHash(File)
Dim Writer As New PackageIO.Writer(File, Endian.Big, 8)
Writer.WriteUInt32(Hash)
Writer.Close(True, True)
End Sub
Re: Resident Evil 5 Checksum Calculation help
Thanks but this question might sound stupid but where would i put the code in? Like do i use this code for a button or what? and thanks Feudal <3
EDIT: Do you have team viewer? Cause when i copy and paste them in i get these errors
"Too many arguments to 'Public Sub Close()" where the (True, True) are in the code
Re: Resident Evil 5 Checksum Calculation help
I couldn't say how you should go about using them since I don't know how you're handling the data, I'd assume you would have to make some adjustments to either the code I posted or your own or both. As for the error, it's because you're using an older version of PackageIO. Download the latest one and reference it instead of the version you have now or take out one (or two depending on the version you have) of the True arguments
Re: Resident Evil 5 Checksum Calculation help
okay that fixed it but i have one more error now this is what it looks like and i put the code under a button and idk if thats where i was sappost to put it cause the button should calculate a text box or do i need a text box?
picture of the error
This is what my editor looks like right now
http://content.screencast.com/users/...02-11_0006.png
Re: Resident Evil 5 Checksum Calculation help
uh... you can't put a function inside a sub...
place it outside sub and call it instead you need to put the value it is returned in to a variable or write it directly to the file