july keenfield (kizi) <priv kizi gmail com> |
Sunday, December 16 2007 09:06.46 CST |
I wrote immdbg python script as follows.
#-----------------------------------------
# hooktest.py
class TestHook( libhook.LogBpHook ):
def __init__( self ):
libhook.LogBpHook.__init__( self );
def run( self, regs ):
ImmDbgr = immlib.Debugger();
ImmDbgr.Log( "Test" );
def main(args):
T = TestHook();
T.add( "TestHook", int( args[0], 16 ) );
return "set hook";
#----------------------------------
copied it to PyCommand,
and, invoked at commandline as "!hooktest 0x412120"
0x412120 is the head address of function that I wanted to hook.
finally i ran the immdbg.
when the above script invoked, it output "Test" in Log window,
and hang up...
what's wrong with me...orz
The problem of this kind inherits an element of Return Value Failure.[b] Usually this kind of behavior is shown when an object does not return the unique value. This means the object is not returned properly.
In multithreading enviornment , this type of problem occurs when number of threads are activated and one out of them perform malfunctioning. Other cause is failure in returning the thread. This is due to cross referential interdependencies of various functional threads in the code.
In your case , it has been oberved that the hook function does not return properly and entangled some where after performing the task.
Another possible cause is [b]Argument Specification. The passing arguments should be scrutinized properly.
Try to check the Hook functions.One can set practical Debug Checks while Traversing Hooks in a code.
|
|