Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Reading from console
#1
Is it possible to read the console output from a script?
Reply

#2
Probably but why would you need that?
[Image: azuw.jpg]
Reply

#3
My external rcon plugin
Reply

#4
It's possible, Mine was able to do it.
You need to get the window offset and need to use some windows api functions though
Reply

#5
i am able to read the last used command in black ops console so its possible (commands like, +melee -melee or even dvars)
it was just some address
0x03536C5C for black ops, i will try to update this post if i find it for mw3

EDIT: cant find. Sad
Reply

#6
I don't understand this offset thing can you tell me how to do this?
Reply

#7
CSHARP Code
  1. unsafe string MW3Console
  2. {
  3. get
  4. {
  5. IntPtr form = *(IntPtr*)0x5933A50;
  6. IntPtr txtbox = FindWindowEx(form, IntPtr.Zero, "Edit", null);
  7. IntPtr console = FindWindowEx(form, txtbox, "Edit", null);
  8. StringBuilder sb = new StringBuilder(9999999);
  9. int result = SendMessageTimeout(
  10. console,
  11. 0x0D /*WM_GETTEXT*/,
  12. 9999999,
  13. sb,
  14. 10 /*SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG*/,
  15. 500,
  16. IntPtr.Zero);
  17. return sb.ToString();
  18. }
  19. }
  20.  
  21. [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)]
  22. public static extern IntPtr FindWindow(string className, string windowName);
  23. [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  24. public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
  25.  
  26. [DllImport("User32.dll", SetLastError = true)]
  27. public static extern int SendMessageTimeout(
  28. IntPtr hWnd,
  29. uint uMsg,
  30. uint wParam,
  31. StringBuilder lParam,
  32. uint fuFlags,
  33. uint uTimeout,
  34. IntPtr lpdwResult);


The offset (line 5) is outdated and I got it from nukem.
I think (but not entirely sure) that barata's tool can tell you what it is.
Reply

#8
This worked for me
CSHARP Code
  1. unsafe string MW3Console
  2. {
  3. get
  4. {
  5. IntPtr form = FindWindow("IW5 WinConsole", "Call of Duty: Modern Warfare 3 Dedicated Server");
  6. IntPtr txtbox = FindWindowEx(form,IntPtr.Zero,"Edit",null);
  7. IntPtr console = FindWindowEx(form, txtbox, "Edit", null);
  8. StringBuilder sb = new StringBuilder(9999999);
  9. int result = SendMessageTimeout(
  10. console,
  11. 0x0D /*WM_GETTEXT*/,
  12. 9999999,
  13. sb,
  14. 10 /*SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG*/,
  15. 500,
  16. IntPtr.Zero);
  17. return sb.ToString();
  18. }
  19. }
  20.  
  21. [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)]
  22. public static extern IntPtr FindWindow(string className, string windowName);
  23. [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  24. public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
  25.  
  26. [DllImport("User32.dll", SetLastError = true)]
  27. public static extern int SendMessageTimeout(
  28. IntPtr hWnd,
  29. uint uMsg,
  30. uint wParam,
  31. StringBuilder lParam,
  32. uint fuFlags,
  33. uint uTimeout,
  34. IntPtr lpdwResult);
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help mod not reading .iwd files? hmann 4 4,538 10-13-2013, 20:14
Last Post: hmann
  Help MW3 (External) Console - TeknoMW3? Strazeeh 7 8,709 10-01-2013, 21:54
Last Post: DeHEnergY
  Help MW3 (External) Console - TeknoMW3? Strazeeh 2 4,367 09-30-2013, 19:19
Last Post: surtek
  [Request] MW2 EXTERNAL CONSOLE!!! thomiromi 4 5,711 09-26-2013, 18:02
Last Post: Rendflex
  console or server browser MW2 kerm007 1 3,587 08-30-2013, 21:52
Last Post: Nekochan
  [News] T6 Console [PC] zer0w 42 31,533 08-08-2013, 17:27
Last Post: Bandarigoda123
  Help GSC Reading Files?! Howl3r 11 8,383 07-30-2013, 04:00
Last Post: DidUknowiPwn
Wink Help MW3 Server Console Bandarigoda123 0 3,210 07-26-2013, 04:01
Last Post: Bandarigoda123
  Help Help in address console Bandarigoda123 2 3,402 07-20-2013, 15:46
Last Post: Bandarigoda123
  [Release] Black Ops 1 "External" Console barata 16 19,125 07-19-2013, 21:15
Last Post: Jakeyellis

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.