2

I have a buffer in disassembly that its elements are shifted to left (apparently with controlling the zero index), the original code is:

flag = 0;
for ( i = 0; i < 10; i++ )
{
  if ( flag )
    buff[i - 1] = buff[i];
  if ( buff[i] == 4700 )
    flag = 1;
}

But IDA decompiles it as:

flag = 0;
for ( i = 0; i < cntr; i++ )
{
  if ( flag )
    *(&the_adr_just_before_buff + i) = buff[i];
  if ( buff[i] == 4700)
    flag = 1;
}

How can I solve this issue on IDA?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.