Re: [XenAccess-devel] Exposing symbol map functions
Status: Beta
Brought to you by:
bdpayne
From: Bryan D. P. <br...@th...> - 2007-11-29 20:48:59
|
Thanks. The patch is now in the repository. -bryan On Nov 29, 2007 2:41 PM, <hi...@cc...> wrote: > Here's a small patch that adds xa_symbol_to_address > to the public API. It simply redirects to the appropriate > symbol translation functions in the linux and windows > layers. > > There are times when I want to know the address of a > symbol without mapping it. > > -Jim > > Index: xa_util.c > =================================================================== > --- xa_util.c (revision 99) > +++ xa_util.c (working copy) > @@ -163,6 +163,17 @@ > } > } > > +int xa_symbol_to_address ( > + xa_instance_t* instance, char* sym, uint32_t* vaddr) > +{ > + if(XA_OS_LINUX == instance->os_type) > + return linux_system_map_symbol_to_address(instance, > sym, vaddr); > + else if(XA_OS_WINDOWS == instance->os_type) > + return windows_symbol_to_address(instance, sym, vaddr); > + else > + return XA_FAILURE; > +} > + > int xa_get_bit (unsigned long reg, int bit) > { > unsigned long mask = 1 << bit; > Index: xenaccess.h > =================================================================== > --- xenaccess.h (revision 99) > +++ xenaccess.h (working copy) > @@ -334,6 +334,16 @@ > int xa_read_long_long_mach ( > xa_instance_t *instance, uint32_t maddr, uint64_t *value); > > +/** > + * Returns the address of a symbol. > + * > + * @param[in] instance XenAccess instance > + * @param[in] sym Kernel symbol (must be exported) > + * @param[out] vaddr The virtual address of the symbol > + */ > +int xa_symbol_to_address ( > + xa_instance_t *instance, char* sym, uint32_t *vaddr); > + > /*----------------------------- > * Linux-specific functionality > */ > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > XenAccess-devel mailing list > Xen...@li... > https://lists.sourceforge.net/lists/listinfo/xenaccess-devel > -- Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |