Author Topic: gcc problem [SOLVED]  (Read 4002 times)

kko

  • Newbie
  • *
  • Posts: 10
    • View Profile
on: September 13, 2013, 11:06:29 AM
Hi, everyone...

i have a little problem with my studies about exploitation...

i have to create this executable to know the value of my esp

___________________________________
#include <stdio.h>

unsigned int get_sp(void)

{

   asm("mov1 %esp, %eax") ; // i tried also __asm__("mov1 %esp, %eax")

}

int main ()

{

printf ("Stack pointer  (ESP) : 0x%x\n", get_sp() ) ;

}

_____________________________________________

but when i try to compile this with gcc...

#gcc -o  get_sp ./get_sp.c

 i receive this message error...

./get_sp.c: Assembler messages:
./get_sp.c:6: Error: no such instruction: `mov1 %esp,%eax'

I tried to find a solution in google and in my books , but no idea... and no solution... it seem all ok; no syntax errors...
« Last Edit: September 13, 2013, 03:44:23 PM by raffaele »



b4d_bl0ck

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Reply #1 on: September 13, 2013, 11:18:08 AM
kko,
that's MOVL not MOV1 ;D

Happy studying...

bool secure = check_paranoia() ? true : false;


kko

  • Newbie
  • *
  • Posts: 10
    • View Profile
Reply #2 on: September 13, 2013, 11:26:47 AM
ah ah ah ah ah ah ok...

this is the first thing i thought.... but also i thought :"it's not possible... it's too stupid... i read 1 not L..."

you are right, in the book it's not so evident the difference between low L and 1..


thanks :-)