943,777 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3818
  • C++ RSS
Jan 24th, 2007
0

Base address

Expand Post »
Hi all,

we al know the preffered load address of any proj is 0x00400000 and DLL is 0x10000000. now if the OS is unable to use this address it relocates the project.
now i have a need to use the Rva+Base address of all the methods available in a class within a project. One method is reading the map file but say if u don't have the address available so relocation takes place hence the safest way is to dynamicaly obtain it

hence i want to know is there any way of obtaining the base address or the load address of a process. if at all you feel this is not a viable solution then can i obtain the current address from the mangled names like ?show@disp@@QAEXXZ for a public method show belonging to class disp as per VC++ conventions.

undname just gives the resolved name but its of no use in callin a function. so can you people just help me out

for a better idea u can refer
1)Mangled Name

2)Private Access
Similar Threads
Reputation Points: 64
Solved Threads: 7
Junior Poster
shouvik.d is offline Offline
198 posts
since Jan 2007
Jan 24th, 2007
0

Re: Base address

You want the address of a function?
C++ Syntax (Toggle Plain Text)
  1. int foo()
  2. {
  3. // blabla
  4. return something;
  5. }
  6.  
  7. // pointer to the function
  8. int (*fn)();
  9.  
  10. // set pointer
  11. fn = foo;

You can also get pointers to class methods. I have not used them so I'm not sure how they work.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Jan 24th, 2007
0

Re: Base address

I think you didn't get my question correctly. I need the Load address of a process. So that i can calculate the Rva+Base address
please refer to the links i'd provided in my posts
Reputation Points: 64
Solved Threads: 7
Junior Poster
shouvik.d is offline Offline
198 posts
since Jan 2007
Jan 24th, 2007
0

Re: Base address

The people as codeproject.com seems to have answered your question quite adequately. I see no point in rehashing something that was already posted over there.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Jan 24th, 2007
-2

Re: Base address

you needn't have taken pains to post this too.
Reputation Points: 64
Solved Threads: 7
Junior Poster
shouvik.d is offline Offline
198 posts
since Jan 2007
Jan 25th, 2007
0

Re: Base address

The people as codeproject.com seems to have answered your question quite adequately. I see no point in rehashing something that was already posted over there.
Firstly though this is a follow up of the previous thread but it's nowhere near to rehashing...

secondly my private access is done whereby I did not perform any malicious activities

Still after this I really thank all of those who poured in suggestions and criticisms because both are complementary.

Thanks to all for there precious time spending on this thread. Will meet you guys in some other thread
Reputation Points: 64
Solved Threads: 7
Junior Poster
shouvik.d is offline Offline
198 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Help My Program!
Next Thread in C++ Forum Timeline: Plz help : Multifile C programs (details included)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC