Jump to content
Default Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Default Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble

Recommended Posts

An exception ocurred! WeScript might crash!

Type: System.OverflowException
Message: Arithmetic operation resulted in an overflow.

Stracktrace:
   at System.IntPtr.ToInt32()
   at WeScript.SDK.Utils.SDKUtil.ReadStructureEx[T](IntPtr processHandle, IntPtr address, Boolean is64bit, Int32 structSize)
   at LoLExample.Program.OnRenderer(Int32 fps, EventArgs args)
   at WeScriptWrapper.Renderer.RendererInternal(Int32 fps)

Share this post


Link to post
Share on other sites
17 hours ago, ty01314 said:

An exception ocurred! WeScript might crash!

Type: System.OverflowException
Message: Arithmetic operation resulted in an overflow.

Stracktrace:
   at System.IntPtr.ToInt32()
   at WeScript.SDK.Utils.SDKUtil.ReadStructureEx[T](IntPtr processHandle, IntPtr address, Boolean is64bit, Int32 structSize)
   at LoLExample.Program.OnRenderer(Int32 fps, EventArgs args)
   at WeScriptWrapper.Renderer.RendererInternal(Int32 fps)

Use the solution of @emptieness from the previous page.


giphy.gif

Gaben strategies too OP.

Share this post


Link to post
Share on other sites
On 9/20/2020 at 8:44 PM, emptieness said:

The following line crashes the assembly:


var heroData = SDKUtil.ReadStructureEx<GameObjectStruct>(processHandle, heroPtr, isWow64Process);

Just wrap it into a try/catch block and continue the loop if an exception is thrown.


                GameObjectStruct heroData;

                try
                {
                    // This line here fails and crashes the program.
                    heroData = SDKUtil.ReadStructureEx<GameObjectStruct>(processHandle, heroPtr, isWow64Process);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    continue;
                }
  Reveal hidden contents

spacer.png

 

Could someone explain this to me in more detail, or upload fixed file? I'm absolute retard when it comes to coding/scripting

Share this post


Link to post
Share on other sites
1 hour ago, elivel said:

Could someone explain this to me in more detail, or upload fixed file? I'm absolute retard when it comes to coding/scripting

Same waiting for solution.

Share this post


Link to post
Share on other sites
On 9/20/2020 at 9:44 PM, emptieness said:

The following line crashes the assembly:


var heroData = SDKUtil.ReadStructureEx<GameObjectStruct>(processHandle, heroPtr, isWow64Process);

Just wrap it into a try/catch block and continue the loop if an exception is thrown.


                GameObjectStruct heroData;

                try
                {
                    // This line here fails and crashes the program.
                    heroData = SDKUtil.ReadStructureEx<GameObjectStruct>(processHandle, heroPtr, isWow64Process);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    continue;
                }
  Hide contents

spacer.png

 

 

Share this post


Link to post
Share on other sites
6 hours ago, Aristo said:

 

Yeah but what do we do? what is wrap into try catch and countinue the loop?

Share this post


Link to post
Share on other sites
7 hours ago, Inspired said:

Updated for 10.20!

Thanks a lot man, really appreciated <3!

Share this post


Link to post
Share on other sites

Please check 'WorldToScreen';
Screen coordinates change occasionally

Share this post


Link to post
Share on other sites
On 10/12/2020 at 4:18 AM, duya said:

Please check 'WorldToScreen';
Screen coordinates change occasionally

lower your game graphics, you are playing on high


giphy.gif

Gaben strategies too OP.

Share this post


Link to post
Share on other sites
4 hours ago, Feretorix said:

降低游戏画面,就可以高玩

thank you

Share this post


Link to post
Share on other sites

Updata 10.21

        public struct GameObjectStruct
        {
            [FieldOffset(0x0)]
            public UInt32 baseOffs;
            [FieldOffset(0x20)]
            public UInt16 oObjIndex;
            [FieldOffset(0x4C)]
            public UInt16 oObjTeam;
            [FieldOffset(0xCC)]
            public UInt32 oObjNetworkID;
            [FieldOffset(0x220)]
            public Vector3 oObjPos;
            [FieldOffset(0x270)]
            public byte oObjVisibility;
            [FieldOffset(0xDC4)]
            public float oObjHealth;
            [FieldOffset(0xDD4)]
            public float oObjMaxHealth;
            [FieldOffset(0x12B0)]
            public float oObjArmor;
            [FieldOffset(0x12C8)]
            public float oObjMoveSpeed;
            [FieldOffset(0x12D0)]
            public float oObjAtkRange;

            //public string oObjChampionName
            //{
            //    get
            //    {
            //        return Memory.ReadString(processHandle, (IntPtr)(this.baseOffs + 0x3134), false);
            //    }
            //}

            public SpellDataStruct GetSpellData(spellSlot splSlot)
            {
                var ptr = Memory.ReadPointer(processHandle, (IntPtr)(this.baseOffs + 0x2720 + 0x478 + (uint)splSlot * 4), isWow64Process);
                return SDKUtil.ReadStructure<SpellDataStruct>(processHandle, ptr);
            }

        }

==================================================================================================================================================

        private static void OnTick(int counter, EventArgs args)
        {
            if (processHandle == IntPtr.Zero) //if we still don't have a handle to the process
            {
                var wndHnd = Memory.FindWindowClassName("RiotWindowClass"); //classname
                if (wndHnd != IntPtr.Zero) //if it exists
                {
                    //Console.WriteLine("weheree");
                    var calcPid = Memory.GetPIDFromHWND(wndHnd); //get the PID of that same process
                    if (calcPid > 0) //if we got the PID
                    {
                        processHandle = Memory.OpenProcess(PROCESS_ALL_ACCESS, calcPid); //the driver will get a stripped handle, but doesn't matter, it's still OK
                        if (processHandle != IntPtr.Zero)
                        {
                            //if we got access to the game, check if it's x64 bit, this is needed when reading pointers, since their size is 4 for x86 and 8 for x64
                            isWow64Process = Memory.IsProcess64Bit(processHandle);
                        }
                        else
                        {
                            //Console.WriteLine("failed to get handle");
                        }
                    }
                }
            }
            else //else we have a handle, lets check if we should close it, or use it
            {
                var wndHnd = Memory.FindWindowClassName("RiotWindowClass"); //classname
                if (wndHnd != IntPtr.Zero) //window still exists, so handle should be valid? let's keep using it
                {
                    //the lines of code below execute every 33ms outside of the renderer thread, heavy code can be put here if it's not render dependant
                    gameProcessExists = true;
                    wndMargins = Renderer.GetWindowMargins(wndHnd);
                    wndSize = Renderer.GetWindowSize(wndHnd);
                    isGameOnTop = Renderer.IsGameOnTop(wndHnd);
                    isOverlayOnTop = Overlay.IsOnTop();

                    if (GameBase == IntPtr.Zero) //do we have access to Gamebase address?
                    {
                        GameBase = Memory.GetModule(processHandle, null, isWow64Process); //if not, find it
                        Console.WriteLine($"GameBase: {GameBase.ToString("X")}");
                    }
                    else
                    {
                        if (GameSize == IntPtr.Zero)
                        {
                            GameSize = Memory.GetModuleSize(processHandle, null, isWow64Process);
                            Console.WriteLine($"GameSize: {GameSize.ToString("X")}");
                        }
                        else
                        {
                            if (oLocalPlayer == IntPtr.Zero)
                            {
                                oLocalPlayer = (IntPtr)(GameBase.ToInt64() + 0x3504A14); //A1 ? ? ? ? 85 C0 74 07 05 ? ? ? ? EB 02 33 C0 56
                                Console.WriteLine($"oLocalPlayer: {oLocalPlayer.ToString("X")}");
                            }
                            if (oHeroManager == IntPtr.Zero)
                            {
                                oHeroManager = (IntPtr)(GameBase.ToInt64() + 0x1C65D08); //FF 52 30 8B 4F 04 8B 35 ? ? ? ? (Champion_Kills) string
                                Console.WriteLine($"oObjManager: {oHeroManager.ToString("X")}");
                            }
                            if (oRenderer == IntPtr.Zero)
                            {
                                oRenderer = (IntPtr)(GameBase.ToInt64() + 0x352CA10); //8B 15 ? ? ? ? 83 EC 08 F3
                                Console.WriteLine($"oRenderer: {oRenderer.ToString("X")}");
                            }
                            if (oGameTime == IntPtr.Zero)
                            {
                                oGameTime = (IntPtr)(GameBase.ToInt64() + 0x34FCA04); //D9 5C 24 14 F3 0F 10 4C 24 14 0F 57 C0
                                Console.WriteLine($"oGameTime: {oGameTime.ToString("X")}");
                            }
                        }
                    }
                }
                else //else most likely the process is dead, clean up
                {
                    Memory.CloseHandle(processHandle); //close the handle to avoid leaks
                    processHandle = IntPtr.Zero; //set it like this just in case for C# logic
                    gameProcessExists = false;
                    //clear your offsets, modules
                    GameBase = IntPtr.Zero;
                    GameSize = IntPtr.Zero;
                    oLocalPlayer = IntPtr.Zero;
                    oHeroManager = IntPtr.Zero;
                    oRenderer = IntPtr.Zero;
                    oGameTime = IntPtr.Zero;
                    gameTime = 0;
                }
            }
        }

  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, duya said:

Updata 10.21

        public struct GameObjectStruct
        {
            [FieldOffset(0x0)]
            public UInt32 baseOffs;
            [FieldOffset(0x20)]
            public UInt16 oObjIndex;
            [FieldOffset(0x4C)]
            public UInt16 oObjTeam;
            [FieldOffset(0xCC)]
            public UInt32 oObjNetworkID;
            [FieldOffset(0x220)]
            public Vector3 oObjPos;
            [FieldOffset(0x270)]
            public byte oObjVisibility;
            [FieldOffset(0xDC4)]
            public float oObjHealth;
            [FieldOffset(0xDD4)]
            public float oObjMaxHealth;
            [FieldOffset(0x12B0)]
            public float oObjArmor;
            [FieldOffset(0x12C8)]
            public float oObjMoveSpeed;
            [FieldOffset(0x12D0)]
            public float oObjAtkRange;

            //public string oObjChampionName
            //{
            //    get
            //    {
            //        return Memory.ReadString(processHandle, (IntPtr)(this.baseOffs + 0x3134), false);
            //    }
            //}

            public SpellDataStruct GetSpellData(spellSlot splSlot)
            {
                var ptr = Memory.ReadPointer(processHandle, (IntPtr)(this.baseOffs + 0x2720 + 0x478 + (uint)splSlot * 4), isWow64Process);
                return SDKUtil.ReadStructure<SpellDataStruct>(processHandle, ptr);
            }

        }

==================================================================================================================================================

        private static void OnTick(int counter, EventArgs args)
        {
            if (processHandle == IntPtr.Zero) //if we still don't have a handle to the process
            {
                var wndHnd = Memory.FindWindowClassName("RiotWindowClass"); //classname
                if (wndHnd != IntPtr.Zero) //if it exists
                {
                    //Console.WriteLine("weheree");
                    var calcPid = Memory.GetPIDFromHWND(wndHnd); //get the PID of that same process
                    if (calcPid > 0) //if we got the PID
                    {
                        processHandle = Memory.OpenProcess(PROCESS_ALL_ACCESS, calcPid); //the driver will get a stripped handle, but doesn't matter, it's still OK
                        if (processHandle != IntPtr.Zero)
                        {
                            //if we got access to the game, check if it's x64 bit, this is needed when reading pointers, since their size is 4 for x86 and 8 for x64
                            isWow64Process = Memory.IsProcess64Bit(processHandle);
                        }
                        else
                        {
                            //Console.WriteLine("failed to get handle");
                        }
                    }
                }
            }
            else //else we have a handle, lets check if we should close it, or use it
            {
                var wndHnd = Memory.FindWindowClassName("RiotWindowClass"); //classname
                if (wndHnd != IntPtr.Zero) //window still exists, so handle should be valid? let's keep using it
                {
                    //the lines of code below execute every 33ms outside of the renderer thread, heavy code can be put here if it's not render dependant
                    gameProcessExists = true;
                    wndMargins = Renderer.GetWindowMargins(wndHnd);
                    wndSize = Renderer.GetWindowSize(wndHnd);
                    isGameOnTop = Renderer.IsGameOnTop(wndHnd);
                    isOverlayOnTop = Overlay.IsOnTop();

                    if (GameBase == IntPtr.Zero) //do we have access to Gamebase address?
                    {
                        GameBase = Memory.GetModule(processHandle, null, isWow64Process); //if not, find it
                        Console.WriteLine($"GameBase: {GameBase.ToString("X")}");
                    }
                    else
                    {
                        if (GameSize == IntPtr.Zero)
                        {
                            GameSize = Memory.GetModuleSize(processHandle, null, isWow64Process);
                            Console.WriteLine($"GameSize: {GameSize.ToString("X")}");
                        }
                        else
                        {
                            if (oLocalPlayer == IntPtr.Zero)
                            {
                                oLocalPlayer = (IntPtr)(GameBase.ToInt64() + 0x3504A14); //A1 ? ? ? ? 85 C0 74 07 05 ? ? ? ? EB 02 33 C0 56
                                Console.WriteLine($"oLocalPlayer: {oLocalPlayer.ToString("X")}");
                            }
                            if (oHeroManager == IntPtr.Zero)
                            {
                                oHeroManager = (IntPtr)(GameBase.ToInt64() + 0x1C65D08); //FF 52 30 8B 4F 04 8B 35 ? ? ? ? (Champion_Kills) string
                                Console.WriteLine($"oObjManager: {oHeroManager.ToString("X")}");
                            }
                            if (oRenderer == IntPtr.Zero)
                            {
                                oRenderer = (IntPtr)(GameBase.ToInt64() + 0x352CA10); //8B 15 ? ? ? ? 83 EC 08 F3
                                Console.WriteLine($"oRenderer: {oRenderer.ToString("X")}");
                            }
                            if (oGameTime == IntPtr.Zero)
                            {
                                oGameTime = (IntPtr)(GameBase.ToInt64() + 0x34FCA04); //D9 5C 24 14 F3 0F 10 4C 24 14 0F 57 C0
                                Console.WriteLine($"oGameTime: {oGameTime.ToString("X")}");
                            }
                        }
                    }
                }
                else //else most likely the process is dead, clean up
                {
                    Memory.CloseHandle(processHandle); //close the handle to avoid leaks
                    processHandle = IntPtr.Zero; //set it like this just in case for C# logic
                    gameProcessExists = false;
                    //clear your offsets, modules
                    GameBase = IntPtr.Zero;
                    GameSize = IntPtr.Zero;
                    oLocalPlayer = IntPtr.Zero;
                    oHeroManager = IntPtr.Zero;
                    oRenderer = IntPtr.Zero;
                    oGameTime = IntPtr.Zero;
                    gameTime = 0;
                }
            }
        }

ty ❤️

Share this post


Link to post
Share on other sites
1 minute ago, Aristo said:

upload the pictures to any website like https://imgur.com/ and post the link.

Draw images

I want to draw the skill images

Share this post


Link to post
Share on other sites
11 hours ago, duya said:

Draw images

I want to draw the skill images

lol, I thought you have some problems and wanted to send a image kek, explanation is important 😛

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...