|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Sept 21, 2021 12:32:38 GMT
Binary Integer Numbers For computer, there are two kind of nubers: Signed and Unsigned
Unsigned are slightly more common. They don't know negative numbers. The first number is 0. Signed numbers reserve the highest bit as NEGATIVE-flag.
Sizes
Like decimal numbers binary numbers can have different lengths (amount of single bits). The common Sizes are:
size | value range | Notes: |
---|
4 BIT | 0 to 15 | displayed as 0-f This is the HEXadecimal representation. Two of them describe one BYTE. | BYTE 8 BIT | 0 to 255 - 128 to 127 (signed) | A BYTE consisting of 8 BIT, is the common size to store and display data today. A BYTE can represent one of 256 different values. With 100 of them (32-127) we can display all US-charachters (small+big), the numbers [0-9] and all interpunctation (ASCII). The rest is used for extentions (languages etc.) | 16 BIT | 0 to 65 535 (unsigned) -32 768 to 32 767 (signed) | 64K different values | 32 BIT | 0 to 4 xxx xxx xxx (unsigned) | 4G different values | |
Scrollable Overview: Binary numbers (Big Endian)
| -129 | -128 | ... | -1 | 0 | 1 | ... | 127 | 128 | ... | 255 | 256 |
---|
S8 | -¹ | 80 | ... | FF | 00 | 01 | ... | 7F | 80 | ... | FF | ERR |
---|
U8 | -¹ | -¹ | ... | -¹ | 00 | 01 | ... | 7F | - | ... | - | - |
---|
S16 | FF 7F | FF 80 | ... | FF FF | 00 00 | 00 01 | ... | 00 7F | 00 80 | ... | 00 FF | 01 00 |
---|
S32 | FF FF FF 7F | FF FF FF 80 | ... | FF FF FF FF | 00 00 00 00 | 00 00 00 01 | ... | 00 00 00 7F | 00 00 00 80 | ... | 00 00 00 FF | 00 00 01 00 |
---|
FLOAT | C3 01 00 00 | C3 00 00 00 | ... | BF 80 00 00 | 00 00 00 00 | 3F 80 00 00 | ... | 42 FE 00 00 | 43 00 00 00 | ... | 43 7F 00 00 | 43 80 00 00 |
---|
¹ = value out of range. this number can not be displayed.
Low Endian
When the binary numbers are written to disk the system can change their order: In this case a four-Byte (32 BIT) Binary number: 1a 2b 3c 4d will be found as 4d 3c 2b 1a in a file. Info: Small or Low Endian is used for downward-compatibility: With this trick a 32-BIT-system can read 8-BIT or 16-BIT-data directly without any need of conversion.
Common hex numbers and their decimal value:
₀ₓ 0A = 10 ₀ₓ 0B = 11 ₀ₓ 0C = 12 ₀ₓ 0D = 13 ₀ₓ 0E = 14 ₀ₓ 0F = 15 | ₀ₓ 10 = 16 ₀ₓ 14 = 20 ₀ₓ 1E = 30 ₀ₓ 20 = 32 ₀ₓ 28 = 40 | ₀ₓ 32 = 50 ₀ₓ 64 = 100 ₀ₓ 96 = 150 ₀ₓ C8 = 200 ₀ₓ FA = 250 | ₀ₓ FF = 255 ₀ₓ FF = -1 ! |
PS:
One interesting thing I found out while writing this post: In float, 0 and -0 are two different values : 0 = ₀ₓ 00 00 00 00 - 0 = ₀ₓ 80 00 00 00
BITS | | .0 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .9 | .a | .b | .c | .d | .e | .f |
---|
₀ₓ 0. | | ␀ | ␁ | ␂ | ␃ | ␄ | ␅ | ␆ | ␇ | ␈ | ␉ | ␊ | ␋ | ␌ | ␍ | ␎ | ␏ | ₀ₓ 1. | | ␐ | ␑ | ␒ | ␓ | ␔ | ␕ | ␖ | ␗ | ␘ | ␙ | ␚ | ␛ | ␜ | ␝ | ␞ | ␟ | ₀ₓ 2. | | ␠ | ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / | ₀ₓ 3. | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? | ₀ₓ 4. | | @ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | ₀ₓ 5. | | P | Q | R | S | T | U | V | W | X | Y | Z | [ | \ | ] | ^ | _ | ₀ₓ 6. | | ` | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | ₀ₓ 7. | | p | q | r | s | t | u | v | w | x | y | z | { | | | } | ~ | ␡ |
| ₀ₓ 8. | | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ₀ₓ 9. | | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ⸋ | ₀ₓ a. | | ␣ | ¡ | ¢ | £ | ¤ | ¥ | ¦ | § | ¨ | © | ª | « | ¬ | | ® | ¯ | ₀ₓ b. | | ° | ± | ² | ³ | ´ | µ | ¶ | · | ¸ | ¹ | º | » | ¼ | ½ | ¾ | ¿ | ₀ₓ c. | | À | Á | Â | Ã | Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í | Î | Ï | ₀ₓ d. | | Ð | Ñ | Ò | Ó | Ô | Õ | Ö | × | Ø | Ù | Ú | Û | Ü | Ý | Þ | ß | ₀ₓ e. | | à | á | â | ã | ä | å | æ | ç | è | é | ê | ë | ì | í | î | ï | ₀ₓ f. | | ð | ñ | ò | ó | ô | õ | ö | ÷ | ø | ù | ú | û | ü | ý | þ | ÿ |
0123456789abcdef
␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏ ␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ ␠!"#$%&'()*+,-./ 0123456789:;<=>? @abcdefghijklmno PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~␡ ⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋ ⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋⸋ ␣¡¢£¤¥¦§¨©ª«¬®¯ °±²³´µ¶·¸¹º»¼½¾¿ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß àáâãäåæçèéêëìíîï ðñòóôõö÷øùúûüýþÿ
09.Jan.22 🖊️
|
|
|
Post by sean1917 on Oct 14, 2021 18:17:35 GMT
As always very informative. So 40 is (2*16) plus 8... very cool. Thanks for presenting it in a way that makes sense to me.
|
|
|
Post by Manfred von Richthofen on Oct 19, 2021 0:29:23 GMT
𝘛𝘳𝘰𝘵𝘴𝘬𝘺, i decided to test the hex thing. 48 65 78 20 74 65 73 74 translates to: Hex test
|
|
|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Oct 19, 2021 1:03:28 GMT
𝘛𝘳𝘰𝘵𝘴𝘬𝘺, i decided to test the hex thing. 48 65 78 20 74 65 73 74 translates to: Hex test Yes, this is a ASCII-string - 8 Bytes long: 48 = H = letter big (40) - 8. letter big 65 = e = letter small (60) - 5. letter small 78 = x = letter small (60) - 24. letter small (0x18 = 16+8) 20 = = printable letter (20) - 0 = space, first 'printable charachter 74 = t = 20. (0x14 = 20) - letter small (60) ... But you need to know that this is a text, it could be even the 64bit-number 8391162080156738888. To make it complicate: F0 9D 99 B7 F0 9D 9A 8E F0 9D 9A A1 20 F0 9D 9A 9D F0 9D 9A 8E F0 9D 9A A1 F0 9D 9A 9D translates to: 𝙷𝚎𝚡 𝚝𝚎𝚡𝚝 This is UTF-8 - the same happens with chinese or any language specific letters (ET-games).
|
|
|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Jan 9, 2022 14:28:22 GMT
𝘛𝘳𝘰𝘵𝘴𝘬𝘺, i decided to test the hex thing. 48 65 78 20 74 65 73 74 translates to: Hex test Hi Admiral 🌰 I added the ASCII-code table so it's easy to see how "Hex test" is translated.
|
|
|
Post by Gerd von Rundstedt on Jan 12, 2022 16:30:43 GMT
01010111 01101000 01100101 01101110 00100000 01111001 01101111 01110101 00100000 01100011 01100001 01101110 00100000 01110011 01110000 01101111 01110101 01110100 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100101 01100001 01110011 01101001 01101100 01111001 00100000 01100010 01110101 01110100 00100000 01100011 01100001 01101110 00100111 01110100 00100000 01100110 01101001 01100111 01110101 01110010 01100101 00100000 01101000 01101111 01110111 00100000 01110100 01101111 00100000 01110100 01110101 01110010 01101110 00100000 01101111 01101110 00100000 01100001 00100000 01100011 01101111 01101101 01110000 01110101 01110100 01100101 01110010 00100000 01101001 01101110 00100000 00110011 00110000 00100000 01101101 01101001 01101110 01110101 01110100 01100101 01110011
|
|
|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Jan 12, 2022 20:57:27 GMT
01010111 01101000 01100101 01101110 00100000 01111001 01101111 01110101 00100000 01100011 01100001 01101110 00100000 01110011 01110000 01101111 01110101 01110100 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100101 01100001 01110011 01101001 01101100 01111001 00100000 01100010 01110101 01110100 00100000 01100011 01100001 01101110 00100111 01110100 00100000 01100110 01101001 01100111 01110101 01110010 01100101 00100000 01101000 01101111 01110111 00100000 01110100 01101111 00100000 01110100 01110101 01110010 01101110 00100000 01101111 01101110 00100000 01100001 00100000 01100011 01101111 01101101 01110000 01110101 01110100 01100101 01110010 00100000 01101001 01101110 00100000 00110011 00110000 00100000 01101101 01101001 01101110 01110101 01110100 01100101 01110011 I don't remember right know, having problems to start a computer, but I already failed to open the engines room of an unknown car and I had to call the producer in england, just to ask: How-to lock the main door with the key! (I just finished to install this door at my clients house.) Everything is a question of know how - I offer some of my knowledges here in the EtFC board with my postings ... and I learned a lot!! by precisely preparing the references.
|
|
|
Post by Arthur Currie on Jan 13, 2022 14:47:03 GMT
Nice guide, btw Trotsky. Im Sorry but i won't be modding EW4 anymore. Its WC3 time. Because i have discovered a mobile editor for it
|
|
|
Post by Darth Nihilus on Jan 13, 2022 20:41:39 GMT
Great guide!
Also, rule of thumb: Never skip the 00 byte, computers start counting at 0 so if the length of a map is listed as 02, for example, it's "actually" 3, so when making calculations that has to be kept into account
|
|
|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Jan 15, 2022 0:44:59 GMT
Nice guide, btw Trotsky. Im Sorry but i won't be modding EW4 anymore. Its WC3 time. Because i have discovered a mobile editor for it This is sad not to have you modding EW4 at the moment, but great that you found an editor for WC3. Btl editig I assume. Having the right tools is so great.
|
|
|
Post by Arthur Currie on Jan 15, 2022 13:47:29 GMT
It isn't BTL Based
|
|
|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Jan 15, 2022 14:14:53 GMT
I am not familar with WC, the only thing I know is, WC3 and EW4 share the same version of bin animation files, and a simmilar rendering engine. I thought WC3 uses also .btl-files but with a different structure, type 3? So just for curiosity Arthur Currie, what is your WC3 editor editing?
|
|
|
Post by Arthur Currie on Jan 15, 2022 14:43:48 GMT
𝘛𝘳𝘰𝘵𝘴𝘬𝘺,everything related to WC3,Generals,units,Ownership and Cities adding
|
|
|
Post by sean1917 on Jan 31, 2022 14:33:52 GMT
𝘛𝘳𝘰𝘵𝘴𝘬𝘺, waitaminute!? In the Spoiler all the symbols at thbe bottom are what i see when i look into an encrypted file. Does this mean i can print it out and work it like a cryptogram puzzle?
|
|
|
Post by 𝘛𝘳𝘰𝘵𝘴𝘬𝘺 on Jan 31, 2022 17:59:38 GMT
𝘛𝘳𝘰𝘵𝘴𝘬𝘺, waitaminute!? In the Spoiler all the symbols at thbe bottom are what i see when i look into an encrypted file. Does this mean i can print it out and work it like a cryptogram puzzle? No, this will not work. Encryption works more complicate, it's changing the translation values for each replacement. An encrypted text AAAAAAAA will not contain 8 times the same charachter. But you find these 1:1 translations within the differen 'encodings'. A file is a continious chain of BYTES - You need to know what to do with these BYTES. Usually the extention of the filename gives help to know what kind of data these bytes are. Only a hex-editor shows exactly each of these bytes - if you open the file with a text-editor, you say: >This is a UTF-8 text - display this text! < and the editor displays these bytes as if they were text. If you open a picture with your text-editor it will also look "encrypted". One thing I want to add because it's ET-modding specific: When you see in your text-editor chinese charachters, you will not find these charachters in your Hex-editor. One chinese UTF-8 charachter uses usually 3 BYTES - with UTF-8 in the search dialog of the Hex-Viewer we find even them - en-text in UTF-8 or ASCII are equal.
|
|