I'v been seeing the CopyMemory() a lot resently in source code, and I don't understand exactly what it's point is. can anyone tell me what exactly the point of CopyMemory is?
Battle.net's binary interface uses little-endian numbers, and so does Intel's CPU. By copying the representation of the integer into a buffer, you effectively get it in little-endian with no work.
Little-endian numbers? what are those?
1, in four bytes, looks like this:
Little-endian:
01 00 00 00
Big-endian
00 00 00 01
256 (0x100) in 4 bytes
Little-endian
00 01 00 00
Big-endian
00 00 01 00
123456 (0x1e240) in 4 bytes:
Little-endian:
40 e2 01 00
Bit-endian:
00 01 e2 40
There's good reasons for using little-endian, even though it's counter-intuitive, but they are irrelevant here.
Copy memory is just what it says, it copies memory from one place to another.