Lua Do String menu

User Tag List

Page 3 of 3 FirstFirst 123
Results 31 to 41 of 41
  1. #31
    Ellesar1's Avatar Member
    Reputation
    20
    Join Date
    Feb 2009
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it just means that the whole TLS rewriting which noone knows what it is for doesn't break something.

    since the address for the lua function seems to be okay, i think that you push the arguments in a wrong order or push wrong arguments. maybe you should push the location of the 2nd last byte from your lua string instead of 0. so, luastr addr + luastr length - 1

    Lua Do String
  2. #32
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope... Checked that. luastr length doesn't help.

    As you can see function takes 3 parameters. But there's a variable (global as i understand). Can it be so my code overwrites it so it crashes wow?
    i did it 4 lulz

  3. #33
    Ellesar1's Avatar Member
    Reputation
    20
    Join Date
    Feb 2009
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope since it works without calling the function actually. if it would make something bad, wow would also crash when it trys to call dostring().


    call() just pushes the current IP on the stack and moves the instruction pointer to the given location.

  4. #34
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Huh? You don't have to overwrite any globals...

    The way to go is:

    1. Get the address of the TLS of WoWs Mainthread
    2. Write that address to your threads TLS-pointer so your thread accesses the mainthreads storage
    3. Simply call lua_doString

  5. #35
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. TLS is at fs:[0x2C] (judging by this Win32 Thread Information Block - Wikipedia, the free encyclopedia).
    So it should be:

    1.
    Code:
    mov EDX, [0x012705B0]
    mov EDX, [EDX+0x00002D94]// edx = wow's main thread's tls
    2.
    Code:
    mov EAX, FS:[0x2C]
    mov EAX, [EAX]
    add EAX, 8 //eax = this thread tls
    mov [EAX], EDX
    3.
    Code:
    call 0x007CF6B0
    retn
    Right? And what about luastr?
    Last edited by furang; 10-10-2009 at 12:54 PM.
    i did it 4 lulz

  6. #36
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lua_doString is a cdecl-call. So call it pushing parameters from right to left.

    Code:
    push 0 //lua-state
    push address-of-your-lua-string
    push address-of-your-lua-string //again
    call lua_doString

  7. #37
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So what we've got?
    Code:
    mov EDX, [0x012705B0]
    mov EDX, [EDX+0x00002D94]// edx = wow's main thread's tls. right?
    mov EAX, FS:[0x2C]
    mov EAX, [EAX]
    add EAX, 8 //eax = this thread tls. right?
    mov [EAX], EDX
    push 0
    push offset luastr
    push offset luastr
    call 0x007CF6B0// lua_DoString addr
    add esp, 0xC//fixing stack
    retn
    Is that right? Correct me please if i'm mistaken.
    i did it 4 lulz

  8. #38
    Ellesar1's Avatar Member
    Reputation
    20
    Join Date
    Feb 2009
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks flo, your explanation gives this whole TLS thing a sense.

    Since we run an additional (!) thread with our code, it doesn't have access to wow's main process memory. due to this fact, we get the TLS or our new thread from FS:[0x2] and change the pointer to WoW's main TLS.

    makes perfectly sense. +rep!

  9. #39
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya. Thats why TLS is called Thread's Local Storage.
    But can anyone please tell me is my code correct and if it's not can anyone tell what am i doing wrong?
    Last edited by furang; 10-10-2009 at 02:18 PM.
    i did it 4 lulz

  10. #40
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by furang View Post
    Ya. Thats why TLS is called Thread's Local Storage.
    But can anyone please tell me is my code correct and if it's not can anyone tell what am i doing wrong?
    Your code seems pretty ok, did you test it?
    Btw, if you are using C/C++ its possible to do it out-of-process without using any asm, take a look at Cyphers RtlRemoteCall-Rewrite. With some modifications (you have to fix the TLS before) it should work perfectly.

  11. #41
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope...(((
    Here's they real code i'm using
    Code:
    mov         edx,[0012705B0]
    mov         edx,[edx][000002D94]
    mov         eax,fs:[00000002C]
    mov         eax,[eax]
    add         eax,8
    mov         [eax],edx
    push        0
    mov         eax,12345678
    push        eax
    push        eax
    call        0007CF6B0 
    add         esp,00C
    retn
    nop
    When i allocate memory for luastr i rewrite 12345678 with it. Checked and debuged it. The address is rewritten corectly. But it crashes wow(
    Don't know what to do. I enabled break on new thread. But i haven't find my code near breakpoint. I'm confused.
    i did it 4 lulz

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Lua Do String
    By kingdeking in forum WoW Memory Editing
    Replies: 12
    Last Post: 08-16-2012, 06:50 PM
  2. [ArcEmu] MySQL/Lua from string choosing
    By kerovi in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 01-11-2011, 01:24 PM
  3. Lua do most of the strings?
    By luciferc in forum WoW Memory Editing
    Replies: 23
    Last Post: 07-11-2009, 04:45 AM
  4. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
  5. LUA Refrences
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-22-2007, 08:09 PM
All times are GMT -5. The time now is 05:05 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search