The following are some examples, how they were worked out is in brackets.

So to write the number 1 as hex you would format it as:

01 00 00 00 (1 x 1)

To write the number 255 as hex you would format it as:

FF 00 00 00 (255 x 1)

To write the number 256 as hex you would format it as:

00 01 00 00 (1 x 256)

To write the number 257 as hex you would format it as:

01 01 00 00 (1 x1, 1 x 256)

To write the number 65280 as hex you would format it as:

00 FF 00 00 (0x1, 255x256)

To write the number 65536 as hex you would format it as:

00 00 01 00 (0x1, 0x256, 1x65536)

To write the number 16711680 as hex you would format it as:

00 00 FF 00 (0x1, 0x256, 255x65536)

To write the number 16777216 as hex you would format it as:

00 00 00 01 (0x1, 0x256, 0x65536, 1x16777216)

To write the number 16843009 as hex you would format it as:

01 01 01 01 (1x1, 1x256, 1x65536, 1x16777216)

Here is the basic system for converting a number to hex. example is
number 17000000:

17000000 divided by 16777216 = 1.013 ignore the decimals, that gives
us 1 so the fourth field is 01

1 x 16777216 = 16777216, 17000000-16777216 = 222784 ok that gives us
what is left. Next:

222784 divided by 65536 = 3.399 ignore decimals that gives us 3 so the
third field is 03

3 x 65536 = 196608, 222784 - 196608= 26176 ok that gives us what is
left to go, next:

26176 divided by 256 = 102.25 ignore decimals that gives us 102 so the
second field is 102

102 x 256 = 26112, 26176 - 26112 = 64 ok that gives us the final number,
64

64 divided by 1 equals itself so the first field is 64.

What we have now is: 64 102 03 01, these need to be converted to hexadecimal
digits, use a scientific calculator that can convert numbers to hex or
run the windows calculator (calc.exe) in scientific mode and convert them
by selecting "dec" typing in one number and hitting "hex" writing down
the number, selecting dec again and entering the next number, eventually
you will have the hex code:

40 66 03 01

(remember to put a leading zero on single digit numbers eg 3 = 03)

As for negative numbers, my own experiments have shown that in some cases, when the number entered is above 2147483647 the resultant number is negative. All higher numbers will be negative numbers, I have not explored negative numbers to much so I am not sure how you format them.

Now needing to go through that system every time I wanted to hack into
a game was tiresome and I made a lot of errors so I made a simple program
to work this part out. The source code is on page 14 and 15 (near the back
of this manual).