?
Solved

Program Debugging

Posted on 1998-11-26
5
Medium Priority
?
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.
Suggested Courses

770 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