Solved

Program Debugging

Posted on 1998-11-26
5
216 Views
Last Modified: 2010-08-05
Where I find docs or info about making a program that can load another programmer into the debugger, allowing me to intercept any API calls made by the debugged program???  I don't want a program that does this for me but info on making the program myself. thanks in advance.
0
Comment
Question by:Bashfull
  • 2
  • 2
5 Comments
 

Expert Comment

by:guga
Comment Utility
It can be very useful (source code) www.sysinternals.com
0
 

Author Comment

by:Bashfull
Comment Utility
nothing there is specifically what i need....
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
Comment Utility
Well, debugging a program is not that difficult (see documentation on 'DebugActiveProcess()'), but intercepting the API calls definitively is - but (assuming the target platform is Win32) that's the way to go:
- create a DLL that is mapped into the address space of the program to debug (see injlib.exe 'ftp://ftp.microsoft.com/softlib/mslfiles/INJLIB.EXE') and MS Systems Jounal May '94 'Load Your 32-bit DLL into Another Process's Address Space Using INJLIB' at http://www.microsoft.com/msj')
- patch the function tables so that every API call is redirected to one of your functions before you pass the through to the original function.

If that is what you need, i could even give you some code that illustrates this (well, at least patching the function tables is a task that _needs_ examples, as i would have to take another look at the sources as well)...

0
 

Author Comment

by:Bashfull
Comment Utility
If you can send the code or any help on patching the address tables please do so to darkgod@isdn.net.il.  thanks

p.s. my main objective is intercepting socket calls...
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Did you receive the source code?
I got the following:
   ----- The following addresses had transient non-fatal errors -----
<darkgod@isdn.net.il>

   ----- Transcript of session follows -----
451 timeout writing message to p1.isdn.net.il.
451 <darkgod@isdn.net.il>... I/O error: Error 0
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now