Lua code in IDA for unpacked binary menu

User Tag List

Results 1 to 7 of 7
  1. #1
    0xd5d's Avatar Member
    Reputation
    11
    Join Date
    Mar 2021
    Posts
    20
    Thanks G/R
    22/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua code in IDA for unpacked binary

    Hello,
    I'm currently looking into making improvements on my working wow classic pixel bot to make it read memory. I'd like to find the offset/addresses by myself to have a good understanding of what is going on

    I'm wondering why even for unpacked binaries, the LUA method code is not always clear in IDA. For example, following this ([Tutorial] How to find simple stuff) tutorial, I'm trying to have a look at the "GetMinimapZoneText" LUA method.

    IDA shows this:
    GetMinimapZoneText_IDA.PNG

    At 0x142984D08 there is no clear "sub_..." method and the code at 0x14057B878 is not readable (just "dq" instructions).
    code_not_readable.PNG

    I first practiced on an old client version (3.3.5) and I didn't have this issue.

    Is it a consequence of the Blizzard obfuscation? is there any workaround?

    Lua code in IDA for unpacked binary
  2. #2
    thateuler's Avatar Member
    Reputation
    8
    Join Date
    May 2019
    Posts
    29
    Thanks G/R
    22/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you must have an older version of ida. I'm using 7.6, it works well.

    You should be able to undefined (keypress 'u') at qword_blah+38h, and then convert to code (keypress 'c') at that same location.

    The thing about Lua C functions is that the call target can't be determined easily with just static information (like can be done with an e8 call). but are called by the Lua execution engine using absolute indirect (ff) addressing. My guess is that your specific version of ida can't detect where the function starts. So just telling ida directly should work.

    All lua C functions are the same prototype and call convention. function with one argument, returning void. the argument is passed in rcx and is a pointer to the Lua context (s_context usually). The ida I use detects these Lua functions as __fastcall convention. which afaik is working just fine.

    Edit: looks like Lua c function return int. not void.

    lua/lua.h at v5.1.1 . lua/lua . GitHub. (i think that wow uses a modified Lua 5.1.4. but I don't see a tag for 5.1.4 on GitHub.)
    Last edited by thateuler; 04-17-2022 at 02:37 PM.

  3. Thanks 0xd5d (1 members gave Thanks to thateuler for this useful post)
  4. #3
    0xd5d's Avatar Member
    Reputation
    11
    Join Date
    Mar 2021
    Posts
    20
    Thanks G/R
    22/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you.
    I'm using IDA free version, the last one: v7.7.220118.
    Tried with IDA free version v6 and got the same behavior.

    Maybe it's linked to the free version then
    Last edited by 0xd5d; 04-17-2022 at 02:38 PM.

  5. #4
    doityourself's Avatar ★ Elder ★
    Reputation
    1424
    Join Date
    Nov 2008
    Posts
    843
    Thanks G/R
    35/448
    Trade Feedback
    0 (0%)
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    ida free got some function detecton issues even when defining them manually.

  6. Thanks 0xd5d (1 members gave Thanks to doityourself for this useful post)
  7. #5
    Razzue's Avatar Contributor Avid Ailurophile

    CoreCoins Purchaser Authenticator enabled
    Reputation
    379
    Join Date
    Jun 2017
    Posts
    588
    Thanks G/R
    186/268
    Trade Feedback
    2 (100%)
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Zone ID: GameBase + 0x2B285F8 (tbc)
    Map ID: [GameBase + 0x2B278F0] + 0x160

    Zone Ids
    Map Ids

    Off note, I just recently noticed the classic clients store both classic AND retail Zone Ids in memory. roflmao

    closest i could find was link to 5.1.5, doubt "too" much changed from .4 -> .5 though :P link from lua site directly
    Last edited by Razzue; 04-18-2022 at 02:27 AM.

  8. Thanks 0xd5d (1 members gave Thanks to Razzue for this useful post)
  9. #6
    ChrisIsMe's Avatar Contributor
    Reputation
    164
    Join Date
    Apr 2017
    Posts
    210
    Thanks G/R
    67/100
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    aaaaaaaaaaaaaaaaaaaa
    Last edited by ChrisIsMe; 11-01-2023 at 05:01 PM.
    no war

  10. Thanks Razzue, 0xd5d (2 members gave Thanks to ChrisIsMe for this useful post)
  11. #7
    0xd5d's Avatar Member
    Reputation
    11
    Join Date
    Mar 2021
    Posts
    20
    Thanks G/R
    22/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the record, changed to the pro version, most of the above issues have disappeared.
    Thanks all

Similar Threads

  1. [Tool] Rizzo - Code Signature Plugin for IDA
    By homer91 in forum WoW Memory Editing
    Replies: 1
    Last Post: 10-15-2014, 01:35 PM
  2. Need help with a piece of lua code for an addon.
    By gezus in forum Programming
    Replies: 2
    Last Post: 04-26-2014, 01:02 PM
  3. Replies: 11
    Last Post: 11-21-2011, 12:25 AM
All times are GMT -5. The time now is 06:24 AM. 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