coded so far
int pushintomemory(unsigned char *buffer,int offset) { int i = 0; for(;;) { if(buffer[offset + i] == 0x90) { i++; } else { break; } else { j = i+2; } if(i == 5) { i = rand()%3 + 3; break; } } return i; }
again
int pushintomemory(unsigned char *buffer,int offset)
{
int i = 0;
for(;;)
if(buffer[offset + i] == 0x90)
{i++;}
else
{break;}
else {j = i+2;}
if(i == 5)
{ i = rand()%3 + 3; break; }
}
return i;
"You can lead a horse to to the river but you cannot force it to drink".
True - But while you're at the water you could at least put the poor beast out of it's misery.
What was wrong with:
int pushintomemory(unsigned char *buffer,int offset) { int i = 0; for (;;) { if (buffer[offset + i] == 0x90) { i++; } else { break; } else {<===== two else for one if??? How do you get this through the compiler??? j = i+2; } if (i == 5) { i = rand()%3 + 3; break; } } return i; }
Besides trying to have two "else" with one "if", your code doesn't look like it would make sense.
Why have an infinite loop that either contain break or do not update variable i? Is it expected to skip an unknown number of buffer values 0x90? Why even have a rand() in your code, without any source code comments very clearly explaining what you think the code is expected to solve?
"True - But while you're at the water you could at least put the poor beast out of it's misery." Lots of misery here.