Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Help me please

  1. #11
    Coders
    Join Date
    Nov 2009
    Location
    Belgium
    Posts
    990

    Re: Help me please

    I'll write you a little example in C# (Didn't feel like popping up vb once again since I'v been using it for 4 hours already in class...).
    And I don't feel like posting any copy/paste codes!

    So, lets call those API's!
    Code:
    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
    [DllImport("user32.dll", SetLastError = true)]
    public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, IntPtr windowTitle);
    
    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
    static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
    In vb.NET you should get those API's like this if I'm right, haven't used that for a while...
    So anyone correct me if I'm wrong!
    Code:
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"  (ByVal
    lpClassName As String, ByVal lpWindowName As String) As  Integer
    
    Public Declare Function FindWindowEx Lib "user32" (ByVal hWnd1 As  Long,
    ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As  Long
    Lets get back to the C# part:
    Code:
    private const int WM_CHAR           = 0x0102;
    private const int WM_GETTEXT        = 0x000D;
    private const int WM_GETTEXTLENGTH  = 0x000E;
    Code:
    public static void SendETCommand(string Command, string ConsoleName)
            {
                Command += '\r';
    
                IntPtr parenthWnd = FindWindow(ConsoleName, null);
                if (parenthWnd != IntPtr.Zero)
                {
                    IntPtr hWnd = FindWindowEx(parenthWnd, IntPtr.Zero, "Edit", IntPtr.Zero);
                    HandleRef hRef = new HandleRef(null, hWnd);
                    IntPtr Parameters = new IntPtr(1);
                    for (int i = 0; i < Command.Length; i++) // Lets pass the chars
                    {
                        SendMessage(hRef, WM_CHAR, new IntPtr(Command[i]), Parameters);
                    }
                }
            }
    Haven't tested it but this should work.

    PS: Resources found a long long time ago, when I was in my beginningstage of C#. Can't really remember the sites I'v used to get this result, my bad!

    And remember, Google is your best friend. C# translations to vb.NET shouldn't be that hard, minimal programming skill is required. And if you want to read the console, I would recommand you hooking the ET console (didn't Sinner wrote a tutorial about this? I guess so, a long time ago).

    Or register some cvars, code this in C++ and inject it in your game.

    Code:
    vmCvar_t    cvar_mowl_close;
    extern vmCvar_t cvar_mowl_close;
    Call this in CG_INIT:
    Code:
    hooks.o_syscall( CG_CVAR_REGISTER, &cvar_mowl_close, "mowl_close" , "0", CVAR_ARCHIVE );
    Call this in DrawActiveFrame:
    Code:
    hooks.o_syscall( CG_CVAR_UPDATE, &cvar_mowl_close );
    Just work it out like: if (cvar_mowl_close.integer) QuitGame();

    I guess I gave you enough to play around with, be sure the start is a pain in the ass!

    Note: The code snippets could contain faults, I haven't really tested any of these, nor the cvars as I use diffirent methods. I dislike getting them registered ingame, pb detection if they scan for it
    Anyways, it gives you a small overview of how it works.

    Quote Originally Posted by Goldeneye View Post
    is that even possible?
    More or less, I wrote my first wallhack in vb.NET
    Bytepatching *sigh*

    Kind regards,
    mOwl

  2. #12
    VIP Goldeneye's Avatar
    Join Date
    Aug 2007
    Location
    the Netherlands
    Posts
    718

    Re: Help me please

    Quote Originally Posted by mOwl View Post
    More or less, I wrote my first wallhack in vb.NET
    Bytepatching *sigh*l
    wich makes u able to 'hook' some functions, not just an full bot, and i cant really call an bytepatched wallhack an bot

  3. #13
    Coders
    Join Date
    Nov 2009
    Location
    Belgium
    Posts
    990

    Re: Help me please

    Quote Originally Posted by Goldeneye View Post
    wich makes u able to 'hook' some functions, not just an full bot, and i cant really call an bytepatched wallhack an bot
    Not sure if thats possible. Not really going to try it.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •