Skip to main content
Tweeted twitter.com/StackReverseEng/status/686260313872797698
code highlighting
Source Link
0xec
  • 6.1k
  • 3
  • 25
  • 34

I'm trying to disassemble this code:

int main() { int arr[5] = {1,2,3,4,5}; int i; for(i=0;i<5;i++) { printf("Element:%d\n",arr[i]); } return 0; }

int main()
{
    int arr[5] = {1,2,3,4,5};
    int i;
    for(i=0;i<5;i++)
    {
        printf("Element:%d\n",arr[i]);
    }
    return 0;
}

IDA output: sub esp, 30h sub esp, 30h

Question: What does it mean? I thought it would be 18h(5x4+4)18h(5x4+4)

I'm trying to disassemble this code:

int main() { int arr[5] = {1,2,3,4,5}; int i; for(i=0;i<5;i++) { printf("Element:%d\n",arr[i]); } return 0; }

IDA output: sub esp, 30h

Question: What does it mean? I thought it would be 18h(5x4+4)

I'm trying to disassemble this code:

int main()
{
    int arr[5] = {1,2,3,4,5};
    int i;
    for(i=0;i<5;i++)
    {
        printf("Element:%d\n",arr[i]);
    }
    return 0;
}

IDA output: sub esp, 30h

Question: What does it mean? I thought it would be 18h(5x4+4)

Source Link
Trey
  • 437
  • 3
  • 7
  • 20

Stack and local variables

I'm trying to disassemble this code:

int main() { int arr[5] = {1,2,3,4,5}; int i; for(i=0;i<5;i++) { printf("Element:%d\n",arr[i]); } return 0; }

IDA output: sub esp, 30h

Question: What does it mean? I thought it would be 18h(5x4+4)