lkml.org 
[lkml]   [2005]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectproblem with e_entry and _start
Hello everyone,
I am trying to overwrite the e_entry on an executable's elf header and
change the flow of control with the following piece of code :


Elf32_Ehdr *self = (Elf32_Ehdr *)0x8048000;
printf("%x",(self)->e_entry);
(self)->e_entry = (Elf32_Addr)0x00000000;


This piece of code is present in a pre loaaded shared library.


But the problem is that even after changing the address of the
e_entry, the actual main function of the executable a.out is getting
executed. BUt if the address of this e_entry is getting changed then
how the control is finally reaching _lib_start_main and finally to
main().
I tried overwriting it with 0x0000000 still it worked.


The command given for execution is :


#LD_PRELOAD="./lib1.so" ./a.out


Where does the loader takes the address of _start before passing
control to it ?
please help !


--
Regards,
Sandeep
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-28 06:44    [W:0.036 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site