Question : Common DWORD values

Hello,

A very simple question, maybe stupid too

in Windows API for example we see

SOMETHING1 = DWORD($814FAC);
SOMETHING2 = DWORD($36587F);
SOMETHING3 = DWORD($79852B);

ok, but what is the origin of these values? random?
the programmer just typed something like $77AAFC? $8C8F77?

i need to do the same, but first i really wanna know about it hehe

sorry for my stupid question, but stupid questions may gives us knowledge ;)

regards

Answer : Common DWORD values

No, they usually mean something.  At the lowest levels of code, people have often used variables composed of bit-maps where each bit means something.  Then you can construct a value that is a combination of bits (flags) and test for multiple items at once.  An example would be the bit flags used in disk access calls.  One bit flag means read, another write, another means from the beginning, another means from the end, another lock the file while we're using it.  Using the made-up example below, you can then write a conditional statement like:

if append then (move the pointer to the end of the file)
1:
2:
3:
4:
5:
6:
7:
8:
9:
// made-up bit definitions
read = 1 ;bit 1
write = 2 ;bit 2
beginning = 4 ;bit 3
end = 8 ;bit 4
lock = 16; bit 5

// so write at the end (append) would be:
append = 10 ;bits 2 and bit 4 = 2+8
Random Solutions  
 
programming4us programming4us