about security api and injecting packet

06/22/2013 16:34 kondos#1
If i have packet like this
Code:
[C -> S][747E]
1F 00 00 00
how can i send it through silkroad security API ??? (PushEDX)
because if i want to send a normal packet like
Code:
[C -> S][747D]
00
i use
Code:
            Packet packet = new Packet(0x747D);
            packet.WriteUInt8(00);
            Agent.Send(packet);
but if it have letters like (F)
ah i think it's stupid question :D :D but any one help ??? :D
06/22/2013 19:08 lesderid#2
The 'letters like F' are hexadecimal numbers. Usually in day to day situations, we use the decimal system. That means that one character can represent 10 different digits (0-9). However, in programming (mostly low-level, for example when working with raw data in memory or in network traffic) hexadecimal notation is often used, which has 16 digits instead (0-9 and A-F). The reason for this is (as far as I know) because 2 hexadecimal digits make up exactly one byte (16^2 = 256 states), which is often the smallest integer unit used in programming. More about the hexadecimal system can be found here: Hexadecimal - Wikipedia, the free encyclopedia.

Now, to use hexadecimal literals in C# or any other language (derived from C), you can simply prefix it by '0x'. For example, 'FF' becomes '0xFF'.

You usually shouldn't do this though. If the number means something that's human-readable and it must be hardcoded, you should probably convert it to base 10 (decimal) and use that instead.
06/23/2013 02:56 royalblade#3
muh deleted... soz
07/21/2013 05:45 Chernobyl*#4
Well, hexadecimal conversation in computing is easyer than decimal... It's all about binary stuff, since everything goes around digit "2". Transistors also knows only 2 states. Anyway, the point is you can easily convert hex -> bin and back by grouping binary numbers by 4 and so on...

2 ^ 2 = 4 [0x4]
2 ^ 3 = 8 [0x8], size of 1 byte nowadays
2 ^ 4 = 16 [0x10]

Byte (usigned char) is a value in range of 0 - 255 (256 possible values in total, maximum value 8 bits can handle (2 ^ 8)). As far as i remember, the idea of grouping data by 8 bits (what is called byte now) comes from times when IBM developed first supercomputer in 1970's or 1980's, and reasons for that are not so clear (common sense says that numbers which are representable as degree of 2 simply more handy in computing).

So, hexadecimal system is better at many points (first of all - handy, it's easyer for eyes to split numbers & letters than just numbers as it would be with decimal system, and that's pretty much important when you are seeing lots of addresses with similar values let's say at some debugger).

#why da hell did i write that ? _*_
07/21/2013 21:25 Bartic#5
2^4 = 16 = 0x10, if I'm not mistaken.
07/21/2013 22:16 Chernobyl*#6
Quote:
Originally Posted by Bartic View Post
2^4 = 16 = 0x10, if I'm not mistaken.
Ooh, ye, you are right. :)

hexadecimal is in range of 0x0 - 0xF (0 - 15), 16 values in total
So 0x10 = 16 (dec)
07/22/2013 23:00 Vanapapi#7

(Watch other videos too, it's a good channel)
07/23/2013 02:50 Bartic#8
^Watched all of their videos, I'm already subscribed.

*feeling nerdy*