GithubHelp home page GithubHelp logo

Comments (6)

elibi avatar elibi commented on July 18, 2024

@jbremer

from monitor.

jbremer avatar jbremer commented on July 18, 2024

Could you try with OllyDBG or x64dbg? As you can see in the command-line string that's created it passes the process identifier along using the -p switch - I'm not sure if that works for WinDBG?
We could add support for WinDBG if you prefer, but initially this switch was intended for Olly.
For WinDBG I propose we add a flag --dbg-windbg that then uses the WinDBG command-line (which I'm sure you can find out for us) instead of the Olly one.

Thanks!

from monitor.

jbremer avatar jbremer commented on July 18, 2024

Or just something like --windbg C:\..., of course.

from monitor.

elibi avatar elibi commented on July 18, 2024

The command line is fine and actually works.
However, what's not working is the monitor's injection to the WinDBG process, which I don't fully understand why we need it anyways.

When I replaced the "start_app" call with a simple CreateProcess everything worked seamlessly.

from monitor.

jbremer avatar jbremer commented on July 18, 2024

It executes the CreateProcess from its own process. I just used start_app rather than CreateProcessW because it's there anyway and includes some flags that we use normally anyway.
Can you show a diff of your solution that does work for you?

from monitor.

elibi avatar elibi commented on July 18, 2024

Sure.

diff --git a/bin/inject.c b/bin/inject.c
index 6d93799..f1eb91f 100644
--- a/bin/inject.c
+++ b/bin/inject.c
@@ -548,6 +548,14 @@ int main()
     uint32_t pid = 0, tid = 0, from = 0, inj_mode = INJECT_NONE;
     uint32_t show_window = SW_SHOWNORMAL, only_start = 0, resume_thread_ = 0;

+    STARTUPINFO si;
+    PROCESS_INFORMATION pi;
+
+    ZeroMemory( &si, sizeof(si) );
+    si.cb = sizeof(si);
+    ZeroMemory( &pi, sizeof(pi) );
+
+
     for (int idx = 1; idx < argc; idx++) {
         if(wcscmp(argv[idx], L"--crt") == 0) {
             inj_mode = INJECT_CRT;
@@ -796,8 +804,9 @@ int main()
         wchar_t buf[1024];
         wsprintfW(buf, L"\"%s\" -p %d", dbg_path, pid);

-        start_app(GetCurrentProcessId(), dbg_path, buf,
-            NULL, NULL, SW_SHOWNORMAL);
+//        start_app(GetCurrentProcessId(), dbg_path, buf,
+//            NULL, NULL, SW_SHOWNORMAL);
+       CreateProcessW(NULL, buf, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);

         Sleep(5000);
     }

from monitor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.