954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Base address

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

shouvik.d
Junior Poster
198 posts since Jan 2007
Reputation Points: 64
Solved Threads: 7
 

You want the address of a function?

int foo()
{
   // blabla
   return something;
}

// pointer to the function
int (*fn)();

// set pointer
fn = foo;


You can also get pointers to class methods. I have not used them so I'm not sure how they work.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

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

shouvik.d
Junior Poster
198 posts since Jan 2007
Reputation Points: 64
Solved Threads: 7
 

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.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

you needn't have taken pains to post this too.

shouvik.d
Junior Poster
198 posts since Jan 2007
Reputation Points: 64
Solved Threads: 7
 
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:)

shouvik.d
Junior Poster
198 posts since Jan 2007
Reputation Points: 64
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You