• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

virtualprotect() problem

Hey there,
 
I am having a problem using virtualprotect(), i need to know the address of the memory outside the address space of my own program. The problem is thatthe API i am working with is an undocumented API and i have no idea how i can get the area of memory used by a variable inside the routine. Is there some additional functions that could perhaps help me determine the address of variable on this undocumented API. The variable in the api i am working with is NULL by default, i want to edit it so that it is a different value. Help would be much appreciated. Cheers
0
hi_tech_assassin
Asked:
hi_tech_assassin
  • 2
  • 2
1 Solution
 
jkrCommented:
>>i need to know the address of the memory outside the address space of my own program

There is no such memory. You have all the virtual 4GB, and 2GB of them at your hands.
0
 
hi_tech_assassinAuthor Commented:
Well i have determined that i need to use VirtualQueryEx(), but when i get the info from MEMORY_BASIC_INFORMATION structure it just crashes as if its empty

            VirtualQueryEx(hNetLib,
                NetLibFunc,
                lpList,
                sizeof (MEMORY_BASIC_INFORMATION));

the first argument is the address of the loaded library and the second is the address of the function within that dll that i am dealing with.

Any ideas where am going wrong, as when i get sufficient info from this i can use virtualprotect()
0
 
hi_tech_assassinAuthor Commented:
is it even possible to use virtualQueryex() on DLLs or will it only work for processes ?
0
 
jkrCommented:
The question is answered by

"There is no such memory. You have all the virtual 4GB, and 2GB of them at your hands."
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now