473,394 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How can I overwrite a pointer to a DLL?

Simple question, complex answer :) The following applies to unmanaged C++, nothing in .NET or managed code. However, please consider that I am completely inexperienced in unmanaged C++, and i would be grateful if you explained your answer :)

1. How can I know when a random library is loaded in the system (XP/Vista)? Can be system32 library, can be my library, but ANY library. I can not rely on any standards or hardcode anything, this HAS TO work across all the cases.

2. When the above happens for some certain library, how can I make it so that instead of loading the original library, system loads my library. I already know all about wrappers and how the signature of methods must be the same and all that and have a wrapper for this.

Now.... You may ask, what is all this about. I didn't want to go into detail at the beginning but now here it goes....

I am trying to write something that does what FRAPS do. Except video recording feature, I want to display various things in game (both as an overlay or just a regular text within game's code). FPS, current memory usage, snapshots of desktop are some of them.

I did over 2 months long research. And from my understanding, the popular method of IAT does NOT work anymore all the time. If you read this you will see why:

http://www.codeproject.com/dll/Win32APIHooking_Trouble.asp

Basically, the old fasion model included to get a pointer to a "method" in a library and overwrite it with yours (redirect). Now the safe method is pretty much loading YOUR library (before any load happens) instead of original ones and reroute the calls over your library (you have a proxy dll basically that works better).

The problem is i don't know how to do #1 and #2 above.

Any help will be greatly appreciated, please do post some code samples as I am very very new to unmanaged C++ and the whole idea of WIN API.
Nov 14 '07 #1
1 1292
weaknessforcats
9,208 Expert Mod 8TB
1. How can I know when a random library is loaded in the system (XP/Vista)? Can be system32 library, can be my library, but ANY library.
You can stop trying now. There is nothing in Windows that indicates whether a library has been loaded or not. You would need to modify the kernal.
Nov 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Gord | last post by:
Hello, If you set the flag for an overwrite prompt using the 'Save' common dialog, how do you read the response when the user clicks the Yes or No in the 'overwrite' message box? Everything...
5
by: Christine Nguyen | last post by:
I've written a program in VB.net. I need to open a file in binary mode and edit it. I cannot find a way to partially overwrite existing data. There are certain hex values I need to replace in the...
15
by: Ramaraj M Bijur | last post by:
Hi All, Could anyone help me to resolve following problem in C the IDE used is Microsoft VC++, Please let me know the which option in VC++ will do the needful The problem statement:...
2
by: B-Dog | last post by:
Is there a way to make vb.net to overwrite the file when moving? Here is what I'm trying to do: If System.IO.File.Exists(dest) Then 'handle overwrite here If MessageBox.Show("Do you want...
3
by: Developer | last post by:
I use the RichTextBox and sometimes put it into overwrite mode. I'd like the cursor to show whether its in overwrite or insert mode. I often use Cursor.Current = Cursors.WaitCursor and...
3
by: Kai Kuehne | last post by:
Hi list! It is possible to overwrite only one function with the property-function? x = property(getx, setx, delx, 'doc') I just want to overwrite setx, but when I set the others to None, I...
9
by: martinezfive | last post by:
Hi, I feel no doubt some documentation contains my answer, so bare with me. Given the following: #inclde <stdio.h> #include <sstream> void f() { std::stringstream a("Hello World!\n");
1
by: Aere | last post by:
Hello, I'm coding a program that saves information about my patients, so i created a rich textbox for every field. (Name, Tel, etc). The program saves a .txt for each field, no matter if there is...
2
by: hzgt9b | last post by:
I know how to overwrite a function. Normally this is what I would do: function someFunction() { /* orig definition here */ } //later in the execution stream I would do... someFunction = function...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.