Results 1 to 6 of 6

Thread: Hook a console DLL

  1. #1
    settoken
    Guest

    Hook a console DLL

    Hi there,

    I have a game and a dev console DLL. Using dependancy walker gave me the list of all the functions of the console DLL and which ones are exported to the game.
    So the console is used by the game but there's no way to show it using commands or special keys.

    What I want is to create a wrapper between both so I can launch the console using "~" or (if there's no interface integrated) just redirect I/O to my own.

    I suspect the console used by the dev to be Lua5.1 command prompt as there's also a lua DLL in the main folder and I know for sure that the UI and debugging functions are coded in Lua 5.1.

    If someone could help me with it, it would be great as I really don't know where to begin.

    THX
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    Howdy,

    I have a question or two before we proceed.

    Is this an online game?
    If not, is it a windows based PC game?

    There is a ton of documentation regarding lua.
    A lot depends on which platform you are using.

    Woodmann
    Learn Or Die.

  3. #3
    settoken
    Guest
    thx

    it is locally installed in a steam folder on my PC. It's a windows based game.

    I've searched a lot on the subject before asking for help. I've tried to launch the game via lua with the io.popen function without success, I've tried several cmd lines at startup, debugged an unpacked version to collect some information etc... so I have some clues on how it works.
    Now I'm to the point where I need some help. I think that having the game into several separate dlls can help to identify the flow and eventually hook the functions related to the console. I easily get a list of each using dependancy walker but I don't know how to use that information now.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    I have no idea.

    If the game is pc based and comes with a console.dll,
    I dont understand why you cant fire it up.

    I suppose you can try getconsolewindow() but that is
    platform dependent, so I dont think it works in win7.

    Lua is open source so ask them.

    Woodmann

    Hang on, A steam folder is linux/wine based.
    Is this true for your app?

    Upon further review, Lua is not the problem.
    Steam is the problem.
    Their support shows ~ as the correct command to bring up the console.
    If this is not working then perhaps you have a platform problem.
    Maybe you have a game that runs in win7 but was meant to
    run in XP or some other platform with full support?

    I'm just guessing here as I read what I can find.
    Learn Or Die.

  5. #5
    |< x != '+' BanMe's Avatar
    Join Date
    Oct 2008
    Location
    Farmington NH
    Posts
    510
    Blog Entries
    4
    Have you tried using GetCommandLine() to see what is passed in? and used that to launch a process with CreateProcess?

    How does a 'console' dll differ from any other dll, other then it exports a console for input? IE dump the exports of interesting dlls or fire up olly and look threw them,
    and hook away.

    Now if you're saying that the console is a separate process that is launched and services the 'game' as some sorta interpreter then im lost.. :]

    regards BanMe
    No hate for the lost children;
    more love for the paths we walk,
    'words' shatter the truth we seek.
    from the heart and mind of Me
    me, to you.. down and across

    No more words from me, to you...
    Hate and love shatter the heart and Mind of Me.
    For the Lost Children;For the paths we walk; the real truth we seek!

  6. #6
    settoken
    Guest
    @Woodman The game is distributed by Steam but it's not Source engine based. The version of the game that has the console DLL is a demo. I suppose the devs just released a limited house build as a demo because the full release doesn't have these libs as separated DLLs but compiled in the exe instead. It makes sense as during developpment it is more efficient to have finished parts of the game precompiled so they would just have to compile the small parts of the code they are working on.

    My opinion is that the console is purposely not activated. It's not a malfunction or compatibility issue that prevent the end user from using it. There are lots of debugging functions that you can activate with it and as the game is build using Lua (execept for the engine), it would allow modders to make major overhauls.

    From what I've read on the subject, lua is embedded in C++. So there is the engine, a set of functions for communication with lua, lua's main implementation, parallel lua states each managing parts of the game (UI, AI, Diplomacy etc) and external compiled lua scripts. The interface should be between the external scripts and the managers IMHO.
    I've tried to launch the game via the lua interpreter with io.popen wich I supposed could hook the Virtual Machine ingame and give me an output of what is processed.
    If you launch the game in IDA pro, you get messages from the debuggee about what is processed.

    @BanMe thx for your input unfortunatly I don't know how to do this or I would try. I'm a noob. Never hooked anything you know.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Vi-like console hex-editor with scripting
    By XVilka in forum Linux RCE
    Replies: 4
    Last Post: November 17th, 2011, 23:16
  2. Hook remote process.
    By Kurapica in forum Advanced Reversing and Programming
    Replies: 2
    Last Post: August 22nd, 2009, 09:05
  3. Direct3D 9 Hook v1.1
    By Ring3 Circus in forum Blogs Forum
    Replies: 3
    Last Post: February 4th, 2008, 14:26
  4. disassembling a console app
    By sirdan in forum The Newbie Forum
    Replies: 1
    Last Post: April 26th, 2003, 15:32
  5. Searching Mouse Hook
    By GlutrotesLicht in forum Tools of Our Trade (TOT) Messageboard
    Replies: 2
    Last Post: January 13th, 2001, 06:01

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
  •