#include #include int globalInt = 160; void usage(char *cmd) { error(1, 0, "Usage: %s
\n", cmd); } int main(int argc, char *argv[]) { if ( argc != 2 ) usage(argv[0]); // convert the command line arg from a string (in hex) to a long unsignedint long unsigned int addr; int retcode = sscanf(argv[1], "%lx", &addr); if ( retcode != 1 ) usage(argv[0]); printf("Your hex address is %lx\n", addr); char *p = (char*)addr; **argv = *p; // If we can read the memory at p, we do. Otherwise, boom. printf("I can read address %p!\n", p); // try to write to that address *p = 0; printf("I can write the address!\n"); return 0; }