Solved

Program Debugging

Posted on 1998-11-26
5
223 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
ID: 1178697
It can be very useful (source code) www.sysinternals.com
0
 

Author Comment

by:Bashfull
ID: 1178698
nothing there is specifically what i need....
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 1178699
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
ID: 1178700
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
ID: 1178701
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

856 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