Staredit Network > Forums > SC2 Assistance > Topic: Bank Hashing Function
Bank Hashing Function
Oct 31 2010, 10:46 pm
By: Temp  

Oct 31 2010, 10:46 pm Temp Post #1



I was inspired to write a quick bank hash function for people to use.

Just a quick note on usage. Call the HashValues function, pass in the bank you have open and the name of the KEY you will be using to store the hash value in the bank. Then put the value you get back in the KEY that is reserved for the hash value. To test if the bank is valid simply check to see if the computed hash value of the bank is the same as the hash value stored in the bank.

UPDATES: Made unit hash stronger, it has also been tested so it should work for anyone who wishes to use it to protect their banks from tampering (NOTE: not 100%, you get around this by looking at how the hash is calculated and hashing the new values yourself)

The has can probably be better, if anyone wants to help contribute to this you are more than welcome to.

TODO:
-Make string hashing stronger.
-Figure out how to do any sort of hashing with text (any ideas anyone?)
-Enhance unit hashing to cover all important attributes (partially done)

Attachments:
hashTest.SC2Map
Hits: 0 Size: 188.17kb
BankHash.SC2Lib
Hits: 0 Size: 77.06kb

Post has been edited 3 time(s), last time on Nov 1 2010, 7:35 pm by Temp.



None.

Nov 1 2010, 1:44 pm Temp Post #2



Quick, more detailed instructions, also OP was updated with an updated library:

Data->Library->Import Library (the one you downloaded)
Then you can use the functions included in the library. The only important one is HashValues (anyone know how to make a function private to a library?)

Then when you are about to save your bank call the HashValues function and pass in the bank and a string which represents the key that you will store the hash value in the bank.
Put the value you get back from the function in the bank in any section where the key is the same string you passed into the function.
NOTE: The key must be unique globally in the bank (that is in all sections)


Then to check whether the bank is valid open the bank and run the HashValues function the same way again and then compare the value you get back from the function with the value you already stored in the bank under that unique key.



None.

Nov 1 2010, 7:37 pm Temp Post #3



Unit hashing is now much stronger, there are still probably values im missing (for items and such). Added a test map to the OP. To use simply open the test map, hit Init bank and the Save bank. You can run a check now and it will say same. Exit SC and open the bank (Called TestBank) and edit some values. Reopen the map and hit check, should say different.



None.

Nov 2 2010, 1:10 am payne Post #4

:payne:

Have you tested this on multiplayer mode? Because I already know of experience that Banks can work when testing the map locally, but not when published publically.



None.

Nov 2 2010, 2:37 am Temp Post #5



I haven't, probably should. Don't see it changing the hashing part though.



None.

Feb 11 2011, 7:52 pm Jack Post #6

>be faceless void >mfw I have no face

Lemme get this straight, I can use this with a key to encrypt bank info, correct? If I just want to encrypt bank info, no unit info or anything, will it do that for me?



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:41 pm]
Ultraviolet -- just sent you a message on Discord. I suspect you're probably trying to change unit speeds for units that don't use flingy.dat for movement (like any units that walk instead of hovering/flying). You can change their movement to flingy, but they unfortunately look more like they're gliding than walking when you do that.
[07:31 pm]
Symmetry -- EE2, I've been using setdatfile successfully for units.dat and weapons.dat but the flingy changes don't seem to happen
[05:25 pm]
Ultraviolet -- in EE2 you just open DatEdit, go to the flingy tab, and make whatever changes you want. Though if you want to do dynamic shit, you have to use the trigger editor with the setdatfile action. And of course you have to inject your changes when done. Can give more specific troubleshooting advice if you provide more details
[05:20 pm]
Ultraviolet -- Symmetry
Symmetry shouted: why can't I seem to make eud editor change flingy.dat D:
Are you using EE2 or EE3?
[04:57 pm]
Symmetry -- wdym
[02:24 pm]
Apos -- :wob:
[04:16 am]
NudeRaider -- files in c:\program files\ are protected
[2026-7-11. : 8:11 pm]
Symmetry -- why can't I seem to make eud editor change flingy.dat D:
[2026-7-11. : 4:33 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Symmetry, Ultraviolet