Call Lua callback in DLL cause some Error menu

User Tag List

Results 1 to 4 of 4
  1. #1
    rafaelcn's Avatar Private
    Reputation
    -6
    Join Date
    Jul 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Call Lua callback in DLL cause some Error

    I try to run BabBot ,but the code in this function cause some error like this:
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    the trouble line is
    int n = Lua_GetTop(Lua_GetState());


    Code:
    public static int InputHandler(uint luaState)
            {
                lock (dataLock)
                {
                    try
                    {
                        Log("InputHandler() - Calling ...");
    
                        Values.Clear();
    
                        int n = Lua_GetTop(Lua_GetState());
                        Log("InputHandler() - Lua_GetTop(Lua_GetState() Done!");
    
                        Log(string.Format("InputHandler() - Passed LUA_State (ignored): {0:X}", luaState));
                        Log(string.Format("InputHandler() - Our own LUA_State: {0:X}", Lua_GetState()));
                        Log("InputHandler() - Vars num: " + n);
    
                        for (int i = 1; i <= n; i++)
                        {
                            string res = Lua_ToString(Lua_GetState(), i, 0);
                            Log(string.Format(
                                                    "InputHandler() - Var[{0}] = {1}", i, res));
                            Values.Add(res);
                        }
    
                        Log("InputHandler() - Done");
                    }
                    catch (Exception e)
                    {
                        Log("InputHandler() exception: " + e.ToString());                
                    }
    
                    ValueReceived = true;
                }
                return 0;
            }
    Anyone have some idea for this ?

    Call Lua callback in DLL cause some Error
  2. #2
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you starting Visual Studio as admin?
    Are you using the correct offsets?
    Viano

  3. #3
    rafaelcn's Avatar Private
    Reputation
    -6
    Join Date
    Jul 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the offset should be right, I found them in ollydbg by myself. but thx a lot. I'll try to use these offset to a console project to check them .

  4. #4
    rafaelcn's Avatar Private
    Reputation
    -6
    Join Date
    Jul 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Viano is right, my offsets have some problem. It work fine for me when I fixed these offsets.

Similar Threads

  1. Calling Lua Functions from DLL
    By Viano in forum WoW Memory Editing
    Replies: 19
    Last Post: 07-28-2009, 07:56 PM
  2. [C++] Got Some Errors That I Cant Fix :S
    By Performer in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 09-30-2008, 07:14 PM
  3. [HELP] Some errors:S
    By brange in forum Programming
    Replies: 2
    Last Post: 03-16-2008, 04:38 AM
  4. Some errors in the run
    By Functions in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 01-12-2008, 01:49 AM
All times are GMT -5. The time now is 12: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