I don't know where is the better place to ask that, here or at MadKernel... but anyways... has anyone played with stack tracing ? Let's suppose that we have a process (pid=5000) and then we have several threads running... lets take one like thread 4720... at the context we can access the current processor registers for that thread, so I think that it can't be that difficult to do a backtrace... does anyone know how to guess which function call belongs to which dll ? let's suppose that we have a thread and at the stack there is like 7 functions... can we backtrace that and also detects the holder of the function ? (dll or main thread)

Look at madExcept. It contains a unit named "madStackTrace", which can do a stack trace of the current thread. However, it's not too helpful, if the process was not compiled with madExcept, since then only exported APIs are known "functions". So such callstacks usually look very short.