PDA

View Full Version : What are bytes ???


ShitFire
19th September 2004, 15:54
Hi guys, i have a question.. what is the differnce between 4bytes or 2bytes or floats (i think there called like that ) or anything else ?

and how do u know , when to need them ? like in cs2d you need a 4byte with the ammo and healt ...and so on. But why ?

thanks for helping me :)

sorti
19th September 2004, 17:11
A byte is 1 single number/character. For example, check this string:
"abcdefgh"
'a' = 1 byte
'ab' = 2 bytes
'abcd' = 4 bytes
'abcdefgh' = 8 bytes

However, if you made a file and made it store just 'a', you could not open it up in a hex editor just to find A there. There are things called Hex values. Everything you write in a program is stored in these. If i remember right, A = 0x41 in hex. So, if you made a text file and just put a in it, you should be able to open it up in a Hex editor and find 41 written there.

Now, to your ammo. Been as a byte is in hex, it means the minimum value is 0x00, and the maximum is 0xFF ( the 0x just tells us it is a hex number ). If you convert this to our usual number system, decimal ( also known as denary ), the minimum ( 0x00 ) = 0, and the maximum ( 0xFF ) = 255. This means, that in byte, a value of upto 255 can be stored.

So, say your ammo is 100. This would be able to fit into 1 byte, as the value is less than 255, so you only need to search for 1 byte value. However, say your armor was 1000...you would need 2 bytes.

1 byte = FF = 256 ( from 0 to 255 )
2 bytes = FF FF = (256x256)-1 = 65535

When multiplying, you have to -1, as this counts for 0. So in 2 bytes, there are 65536 numbers, but this ranges from 0-65535.

However, just to confuse you some more, some values arent stored in their original state. Say you had 100 health, some games may store this as 1234567 health. So if exact value searches don't work, its always good to try increase/decreased.

ShitFire
19th September 2004, 17:31
ok i didnt understand anything :/

but why 4byte when i can only have 16 shots in my magazine ???

Gregsy
20th September 2004, 04:03
look in the t-search help file..

cru_strike
30th June 2005, 17:27
wats t-search

faldo
4th July 2005, 01:08
Search before you post! Warned.