[WoW] [3.0.9] [C#] Results of lua_dostring menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [WoW] [3.0.9] [C#] Results of lua_dostring

    It's bruteforce, it's messy, and it's absolutely retarded. I tried to swallow the C++ information and recreate it in C#.

    "LOL OMG MY EYES" - yeah, I know.

    Keep in mind: All the following snippets are in no way perfect, but they seem to do their job.

    Any ideas / suggestions for improvement? Let me know.
    Just wanna flame me for how ugly it is? Please don't hurt my feelings.
    If you really want to use these as a basis, then feel free to do so.

    Patch&Restore the invalid-pointer-check function: NoMorePasting.com

    Register an own lua function (similar to registring an own console function): NoMorePasting.com

    A possible way of grabbing the strings: NoMorePasting.com

    The 'core': The own lua function: NoMorePasting.com


    A possible main-method to try it: NoMorePasting.com

    Note that I did include the GetTop(L) but didn't feel like doing another loop (ASM 4tw), so it only copies the object with the index 1.

    I really want to learn more than pointer arithmetics in C++ now...

    Possible result: http://img178.imageshack.us/img178/1549/dostringopt.jpg

    Credits as usual Cypher, jjaa, Shynd
    Greetings
    Last edited by SKU; 03-18-2009 at 04:57 AM.

    [WoW] [3.0.9] [C#] Results of lua_dostring
  2. #2
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Holy ****ing Christ I would hate to maintain that.

    Good job on getting it working on C# though. Tbh even if I were doing a C# framework I'd still do parts in C++, much too lazy to deal with writing that much ASM.

  3. #3
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indeed very niceley done, good job

  4. #4
    jjaa's Avatar Contributor
    Reputation
    245
    Join Date
    Dec 2006
    Posts
    562
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice work, but i think you are getting to the point were you should be using C++

  5. #5
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's actually incredibly well done.

    +rep to you SKU.

  6. #6
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jjaa View Post
    Nice work, but i think you are getting to the point were you should be using C++
    -.- Yah I guess you're right. Comparing the code you posted in the other lua thread with my implementation.. holy crap. I know it's probably been posted before, but any good (free) eBook / guide you could recommend? My C++ knowledge ends at basic OOP / pointer arithmetics. The only thing we did in the C++ class were math algorithms, nothing of the interesting stuff. *hopes apoc is not in a banning mood*

    Edit: Here my 1st attempt, using the "print" funtion of WoW to grab the result. So any lua_dostring would look like this: lua.doString("print(GetBattlefieldStatus(1))");
    Although I doubt Blizzard likes that. http://www.nomorepasting.com/getpaste.php?pasteid=25059
    Last edited by SKU; 03-18-2009 at 06:27 AM.

  7. #7
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SKU View Post
    -.- Yah I guess you're right. Comparing the code you posted in the other lua thread with my implementation.. holy crap. I know it's probably been posted before, but any good (free) eBook / guide you could recommend? My C++ knowledge ends at basic OOP / pointer arithmetics. The only thing we did in the C++ class were math algorithms, nothing of the interesting stuff. *hopes apoc is not in a banning mood*
    Atleast you have a C++ class, I get to work in Java for my uni. Madness.

    Cypher and others have posted ample books to start learning C++ before, but I was wondering, as C++ is such a huge language, are there any books out there that cover 'this' in detail (The general concept of working from inside another process, generally the style of C++ that gets posted here)

    Oh and great job on the lua stuff :]
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  8. #8
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Other than general reversing books, no.

    There is no book that teaches C++ in the concept of using it for 'hacking'.

    You will often come across snippets, tidbits, etc in reversing books though.

  9. #9
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Robske007a View Post
    Atleast you have a C++ class, I get to work in Java for my uni. Madness.

    Cypher and others have posted ample books to start learning C++ before, but I was wondering, as C++ is such a huge language, are there any books out there that cover 'this' in detail (The general concept of working from inside another process, generally the style of C++ that gets posted here)

    Oh and great job on the lua stuff :]
    Thanks Apoc and Rob, and I had a C++ class, now it's java aswell, and we don't even 'program' but rather proof that algorithms really do what they're supposed to do...

  10. #10
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Traditional education sucks.

  11. #11
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SKU View Post
    Thanks Apoc and Rob, and I had a C++ class, now it's java aswell, and we don't even 'program' but rather proof that algorithms really do what they're supposed to do...
    Even thought I don't yet study informatics I've got a hold on some of those prove the correctness of algorithm xy papers and they were full of variable scope mistakes xD
    Guess if you're an informatic prof you don't need to write working code at all :>
    Last edited by Xarg0; 03-18-2009 at 08:50 AM.
    I hacked 127.0.0.1

  12. #12
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any 'nil' return value causes a null-pointer crash

    Example : API IsMounted - WoWWiki - Your guide to the World of Warcraft
    /run G(IsMounted()) properly returns 1 when I'm mounted, crashes when dismounted (nil)
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  13. #13
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Had the same problem.

    Reason:
    When WoW returns nil it really does return nil. That means that if ToString returns a null pointer on a valid param then the param is actually "nil". I had to handle that explicitly.

    Example:
    Code:
                // Convert result to string
                const char* Out = LuaMgr::Get()->ToString(pState,i);
                // Boolean 'false' returns a null pointer and must be converted
                // manually.
                if (!Out  || !Out[0])
                    Out = "nil";

  14. #14
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Had the same problem.

    Reason:
    When WoW returns nil it really does return nil. That means that if ToString returns a null pointer on a valid param then the param is actually "nil". I had to handle that explicitly.

    Example:
    Code:
                // Convert result to string
                const char* Out = LuaMgr::Get()->ToString(pState,i);
                // Boolean 'false' returns a null pointer and must be converted
                // manually.
                if (!Out  || !Out[0])
                    Out = "nil";
    Oh, totally forgot to do a test eax,eax je ByeBye after tostring. Thanks for the info.

  15. #15
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bandaid fixes ftw

    Memory.Asm.AddLine("Nil:");
    Memory.Asm.AddLine("mov byte [{0}], 0x4E", pszString); // N
    Memory.Asm.AddLine("mov byte [{0}+1], 0x49", pszString); // I
    Memory.Asm.AddLine("mov byte [{0}+2], 0x4C", pszString); // L
    Memory.Asm.AddLine("mov eax, {0}", pszString);
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

Page 1 of 2 12 LastLast

Similar Threads

  1. Result of a Blonde Playing WoW
    By bloodshed794 in forum World of Warcraft General
    Replies: 2
    Last Post: 09-02-2010, 11:17 AM
  2. Lua_doString (WoW 3.1.1)
    By jockel in forum WoW Memory Editing
    Replies: 3
    Last Post: 05-04-2009, 10:42 AM
All times are GMT -5. The time now is 02:21 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search