hmmm doesn't seem to work I'm afraid. I'll provide some pseudo - probably best!
v = s; /*S being the variable scanned in from user, for example 42006f*/
/*The next bit I don't know how to do,...
Type: Posts; User: mrapoc
hmmm doesn't seem to work I'm afraid. I'll provide some pseudo - probably best!
v = s; /*S being the variable scanned in from user, for example 42006f*/
/*The next bit I don't know how to do,...
Looks right in your example - ill give that a shot tomorrow, goodnight! and thanks
Hi all - its late and I really cannot figure this out! :(
if unsigned char *s = 42006f, how can I split/select the hex value into its pairs i.e 42/00/6f so that I can manipulate the pair data...
Well I suppose as long as when its converted to hex it makes sense...
In that case...I only need one check and thats to ensure that the value is within the range
The user could input 255, which...
Ok ill look at that:
I'm basically gonna say
Please insert start address (in hex):
Please insert end address (in hex):
If it isn't hex or valid (within the variable hex) then display error
Hello
I would like to know how to validate user input in terms of:
Length of input
Input format (I would like to restrict to hex)
and any other useful links regarding the matter
thanks
cheers :)
I want to be able to write the values from a start address to the given end address to a file.
So the value starting at for example, *(hex+10) can be the first value written, to *(hex+20) when in...
Hey
I would like to know how to check whether a user specified start address and end address (for data locations) is valid or not
Is there a way to check the given address is actually part of...
Thanks for the feedback all :)
I'll take what you've given me and apply :D cheers
Ok, would probably be the easiest option. Thanks
/***********************************************************************/
/*Inclusions*/...
Its literally test data which I then later have to convert to a type of file. They can be anything (as long as its hex) as little or as small as required to carry out an example that it works
They...
Test data can be as big or as small.
I suppose my question would be, what value would I be looking to detect as a end loop requirement when I have not actually allocated a value to *(hex+x)
...
Hello
I'm looping through hex values
for (x = 0; x <=10; x++) //Ignore the x <=10 value {
printf("\nThe Value of hex %x is: %i\n",*(hex+x), *(hex+x));
printf("\nThe value of X is:...
Thanks very much guys/gals :)
nearly there :)
I have one issue at the moment. When i ask for memory location within the test data function it works fine. But I want it passed back to the main function so it can be displayed...
I'll give that a go. One of those occasions when you know what you want to achieve, but cannot get your head around how to do it :)
I'm using visual studio c++ to do my ansi c compiling etc.
...
Sorry I should be clearer.
int testData(void){
unsigned char *hex;
int t = 0;
char *str;
It was buffer overflow.
I have modified it a bit. Still not correct, but I hope you can see what I'm trying to do
for (int i = 0; i <= p; i=i+2) {
int y = i;
int s = i+1;
Am I going about it the correct way?
It tells me the stack around str is corrupt or something. I'm not on it at the moment
I then plan to store the variable as a hex value. Cross that bridge later.
printf("\nTest data is: %c %c\n", testData1[y], testData1[s]);
strcpy (str, &testData1[y]);
strcat (str,...
So I cannot get
printf("Start of memory block: %p\n", point); // the pointer's name is point not hex
printf("End of memory block: %p\n", point + 65553 - 1)
to work within my main without...
I do know it, sometimes need reminding, but in that case I was just writing noteform :P
Thanks though
Ok so
char *point
point = (unisgned char *)malloc(65553)
if (point == NULL)
{
printf("Cannot allocate memory \n\r");
exit(1);
}
Hello all
Beginner here, running through some exercises I've found. I would like to allocate 64k of memory, printf to the user the starting and ending location of this memory, then store some hex...