Exemplo n.º 1
0
        private void Init()
        {
            DebugInstance = null;

            SymbolSrv = new DebuggerSymbolServer();

            KernelSymbolProvider = new KernelProvider();
            SymbolSrv.RegisterProvider(KernelSymbolProvider);

            RegisterEventInterfaces(this);
        }
Exemplo n.º 2
0
        private void HandleCreateProcess(WinDebug.DEBUG_EVENT DebugEvent)
        {
            var DebugInfo = DebugEvent.CreateProcessInfo;

            var Process = new DebuggerProcess();

            Process.Core      = true;
            Process.Handle    = DebugInfo.hProcess;
            Process.ProcessID = WinLowLevel.GetProcessId(Process.Handle);
            Process.Path      = ResolveProcessPath(DebugInfo.hFile);

            // Skip over allocated Xbox memory
            Process.ImageBase = DebugInfo.lpBaseOfImage + VM_PLACEHOLDER_SIZE;

            var MainThread = new DebuggerThread(Process);

            MainThread.Handle     = DebugInfo.hThread;
            MainThread.ThreadID   = NativeMethods.GetThreadId(DebugInfo.hThread);
            MainThread.ThreadBase = DebugInfo.lpThreadLocalBase;

            // Setup as the main thread
            // TODO Check that we need to treat this as a special case
            Process.MainThread = MainThread;

            DebugInstance = new DebuggerInstance(Process);
            RegisterEventInterfaces(DebugInstance);

            foreach (IDebuggerProcessEvents Event in ProcessEvents)
            {
                Event.OnProcessCreate(Process);
            }

            foreach (IDebuggerThreadEvents Event in ThreadEvents)
            {
                Event.OnThreadCreate(MainThread);
            }

            var XboxModule = new DebuggerModule();

            XboxModule.Path      = Target;
            XboxModule.ImageBase = DebugInfo.lpBaseOfImage;
            XboxModule.Core      = true;

            foreach (IDebuggerModuleEvents Event in ModuleEvents)
            {
                Event.OnModuleLoaded(XboxModule);
            }
        }