HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Not an easy task.. converting to Binary

09-07-2005, 03:36 AM#1
HexenLordX
okay this is NOT an easy task. I want to make a trigger that will convert a string to binary. I have NO idea where to start.
09-07-2005, 06:14 PM#2
Tim.
You could make an Character[] array. Then set each character into the array and set that character to its bianary code. That way you could just make a simple trigger that replaces each character from the original text with its duplicate in the array. A lot of variable setting etc though.
09-08-2005, 11:51 PM#3
PCPharaoh
What do you mean convert a string to binary? A string is letters, and binary is numbers. Do you want the numerical value of each letter in binary, then totaled for a given string?

Just out of curiousity, what are you using this for?
09-09-2005, 08:09 PM#4
Vexorian
Strings aren't letters, strings are secuences of numbers from 0 to 255, they are just shown on the Screen as letters but that doesn't have anything to do with the reality.

I've this hexenlord. http://vexorian.wc3campaigns.com/maps/Codemaker.w3x
09-10-2005, 04:05 AM#5
Koga73
i got ur solution. I used alot of functions i made for a save/load. Converts 0-255 (decimal) to hex (00-ff), then can convert hex (00-ff) to bianary (00000000-11111111). I also got a function to flip all the binary digits, a function to shift the binary, and a function to xor (but this function is reserved for my new map im makin). So, ill post the save/load system unprotected, its quite impressive, it uses routing triggers to route out the encryption process. Heres a link!

http://www.wc3sear.ch/index.php?p=Maps&ID=6317
09-11-2005, 11:34 PM#6
Koga73
It seems that some1 removed my map... well, if u want it, im me on aim, sn = Koga73. :\
09-12-2005, 01:54 AM#7
HexenLordX
Koga, your code didn't seem to be very friendly with me.

Vex, nice system, but a few problems (The same ones with the WEU save/load system).

1. Just save the same char over and over to find out which digits are random, so if you plan on cracking the system you can just eliminate those ones.

2. Doesn't seem to be random enough. Anyone can crack that code without looking at the map script.

Heres an example of my current save/load:
http://img398.imageshack.us/img398/9255/wc3scrnshot080405055836076ks.jpg

As you can see, almost the entire code changes each time you save, and they aren't all random digits either. It doesn't get any longer or shorter no matter what the circumstances. It simply saves items, level, unit type, and account name. Abilities and ability levels are configured through another trigger based on a unit leveling up, so that is seperate from the save/load. The only problem, you can just read the map script and see EXACTLY how the system works, so everyone that plays the map ends up cheating.

This is why I wanted to know if there was a way to convert the code to binary or hex in order to prevent people from cheating by looking at the code or reading the script.

I'm still a little confused, because nothing seems to be very effective. Both of you have code systems that are almost unbreakable by reading the script, but its too easy to crack the code by simply looking at the generated code itself.
09-12-2005, 06:11 AM#8
Anitarf
All vexorian's code does is transform an integer array to a string, doing some encoding while it does so. If you think the string is too easy to crack, obfuscate the integers before passing them to the script yourself. They don't always have to be in the same order, just choose a random number, have an algorythm that mixes them up according to that number, have another algorythm that adds a different number to each of them based on that random number, and nobody will be able to make heads nor tails of the output code no matter how many times they generate it.
09-12-2005, 12:43 PM#9
Vexorian
IF you want random stuff add it yourself.

It is not true that you can try and try because it has CRC which invalidates a big quantity of the codes.

And I posted it just so you see the way the string is converted into binary
09-13-2005, 01:07 AM#10
Koga73
well... thas exactally wht mine does. Its impossible to decrypt/crack (even by mvoign around digits). It is made to be complex and hard to read so taht when extracted, its hard to follow.

let me sorta explain whats happening

a raw code is assembled, then... it converts the etnire code into numeric values (decimal), then into hex, then into binary, flips the 1 and 0, then shifts the binary left one digit, (i have a xor function i added and used in a map, i can show u that if ud like it also. it xors using the persons bnet name, so u have to have that EXACT name for it to work), after, it converts back to hex, then reverses the entire code around. It also compares an end portion of the code with the exp saved in the code, making the digits untoggable. It uses a combination of 100 different encryption ways (10 x 10, and then tripple encrypts it based on 2 different arrays in 1, or a diminsional array). It also contains fail safe constents within the code, so if changed, will auto invalidate the code. It all starts with the save/load trigs, and the router triggers route out all the conversios to the fucntion triggers. If u really are looking to convert things into binary and hex, my system already has the functions and all in it, just study it closly.

I hope this helps.
09-14-2005, 04:43 AM#11
HexenLordX
Koga, your code would be very very useful if I could get it to work right.

Questions, how many digits would someone have to change on the actual code you use to load in order to load another unit? The WEU system is easy to crack even though they tried to encrypt it. One digit holds the values for every character on the map. Simply changing that single digit to another number/letter allows you to load a different unit-type. Does your code prevent this in any way?
09-14-2005, 08:01 PM#12
Koga73
Well, my code doesnt save units, only player name, and exp. It can be modified pretty easily tho. In order to lets say, make a maxed level hero, they would have to change the length to read (encrypted, this is how many digits of the exp to read), then they would have to change the 6 exp digits to the max (the system also checks the max, so 999999 wouldnt work, it saves up to level 125, so ud have to make the exact exp number that a level 125 would use.) Then, if u successuly toggled around that stuff, you would have to change the unencrypted section at the end of the code to the same exp. So, if u just move numbers around to try to get a better code, it wont work unless the person knows exactally what there changing it to, and then they would have to make the end value (the check) the same value.

Its very hard to crack, i assure u. You could use the system as a base, and then make your own save and load triggers from scratch, and still use the conversions. If ur looking to just save exp, and a heavily encryped code, then jus copy over the variables and triggers, and itll work.
09-15-2005, 03:43 AM#13
HexenLordX
Maybe thats why I couldn't get it to work completely.

I'm looking to save: Unit, Level, Account Name, Items.

Since I'm not exactly an expert with base conversions, I doubt I'd be able to modify your system to work with those 4 things.
09-15-2005, 09:46 AM#14
Anitarf
Try with Lord Vexorian's system and make additional encryption yourself. You would have to convert all data you want to save to integers, then, before passing them to the codemaker engine, do some math tricks on them to mess them up. The idea of the messing up is that if a player saves a few very similar games, with only one value different, like one item, for example, he would get a completely different code each time.

Then, all you need to do when a player types in a code is de-mess it with a reverse procedure before restoring the unit and the items (if the de-messed code is valid, of course)
09-15-2005, 06:09 PM#15
ChaoZzZ
ok even though this is above my skills. maybe this helps?
http://nickciske.com/tools/binary.php