Yes I quickly googled hex command line argument and found it, here's the code for any who may be interested. It handles any hex values I give it, 0xFF, FF or ff, and reads 10 as decimal 16.
#include <stdlib.h>Code: [Select]
int main ( int argc, char *argv ) // program.exe file.name hexAddress newByte
FILE *f = fopen( argv, "r+b" );
long int hexAddress = ( long int ) strtol( argv, NULL, 16 );
fseek( f, hexAddress, SEEK_SET );
unsigned char newByte = ( unsigned char ) strtol( argv, NULL, 16 );
fwrite( &newByte, sizeof( newByte ), 1, f );
fclose( f );
Ve never heard of atoi before but Googling it, it seems to convert to decimal.
I write my own function to covert the string to hex, though I imagine there's probably already a C++ function for it.