I have written an exploit using pwn tools and it works fine for ret2text. but when i debug the binary using gdb in linux, I change the return address of vulnfunc to target address which contains system but i am unable to execute the system function and it gives an error memory at ********* can’t be accessed. When i focused more, i came to know that as soon as my target function is access my registers change from 32 bit to 64 bit. Can anyone explain this?before executing vulnfunc
after execution of vulnfunc