Thread Rating:
  • 7 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release NoKnife Plugin
#81
it works, great, thx sooooooo much!
Reply

#82
thank you for this plug in you are amazing
Reply

#83
Could you post proper source code? I want to do some editing Sad
Reply

#84
zxz0O0, you wrote "This plugin uses signature scans to find the offsets"
But i see there are no code for that scan in the 1-st post.

I use the code below for scanning. But it seems the addresses are wrong.
Can you help to correct this, please.
Code:
namespace NoKnife
{
    using Addon;
    using System;
    using System.Runtime.InteropServices;

    public class Class1 : CPlugin
    {
        private int DefaultKnifeAddress;
        private int KnifeRange;
        private string str_Knife = "enabled";
        private bool Working = true;
        private int ZeroAddress;

        private int FindMem(byte?[] search, int num = 1, int start = 0x1000000, int end = 0x3d00000)
        {
            int num2 = 0;
            try
            {
                int num3 = 0;
                for (int i = start; i < end; i++)
                {
                    num2 = i;
                    bool flag = false;
                    for (int j = 0; j < search.Length; j++)
                    {
                        if (search[j].HasValue)
                        {
                            int num7 = num2[0];
                            if (num7 != search[j])
                            {
                                break;
                            }
                        }
                        if (j == (search.Length - 1))
                        {
                            if (num == 1)
                            {
                                flag = true;
                            }
                            else
                            {
                                num3++;
                                if (num3 == num)
                                {
                                    flag = true;
                                }
                            }
                        }
                        else
                        {
                            num2++;
                        }
                    }
                    if (flag)
                    {
                        return i;
                    }
                }
            }
            catch (Exception exception)
            {
                base.ServerPrint(string.Concat(new object[] { "FindMem: ", exception.Message, "\nAddress: ", num2 }));
            }
            return 0;
        }

        private void Knife(bool bl)
        {
            if (!bl)
            {
                this.KnifeRange(0) = this.ZeroAddress;
                this.str_Knife = "disabled";
                base.ServerSay("Knifing disabled", false);
            }
            else
            {
                this.KnifeRange[0] = this.DefaultKnifeAddress;
                this.str_Knife = "enabled";
                base.ServerSay("Knifing enabled", false);
            }
        }

        public override ChatType OnSay(string Message, ServerClient Client)
        {
            if (Message == "!knife")
            {
                base.TellClient(Client.ClientNum, "PM: Knifing " + this.str_Knife, true);
                return ChatType.ChatNone;
            }
            if (!Message.StartsWith("!knife "))
            {
                return ChatType.ChatContinue;
            }
            if (!this.Working)
            {
                base.TellClient(Client.ClientNum, "NoKnife Plugin is not working. Addresses are wrong", true);
            }
            else if (Message == "!knife 0")
            {
                this.Knife(false);
            }
            else if (Message == "!knife 1")
            {
                this.Knife(true);
            }
            return ChatType.ChatNone;
        }

        public override void OnServerLoad()
        {
            try
            {
                base.ServerPrint("\n NoKnife Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh and Makavel\n");
                base.ServerPrint(" www.youtube.com/zxz0O0 \n www.itsmods.com\n");
                byte?[] search = new byte?[] {
                    0x8b, null, null, null, 0x83, null, 4, null, 0x83, null, 12, 0xd9, null, null, null, 0x8b,
                    null, 0xd9, null, null, null, 0xd9, 5
                 };
                this.KnifeRange = this.FindMem(search, 1, 0x400000, 0x500000) + search.Length;
                if (this.KnifeRange == search.Length)
                {
                    byte?[] nullableArray2 = new byte?[] {
                        0x8b, null, null, null, 0x83, null, 0x18, null, 0x83, null, 12, 0xd9, null, null, null, 0x8d,
                        null, null, null, 0xd9, null, null, null, 0xd9, 5
                     };
                    this.KnifeRange = this.FindMem(nullableArray2, 1, 0x400000, 0x500000) + nullableArray2.Length;
                    if (this.KnifeRange == nullableArray2.Length)
                    {
                        this.KnifeRange = 0;
                    }
                }
                this.DefaultKnifeAddress = this.KnifeRange[0];
                byte?[] nullableArray3 = new byte?[] {
                    0xd9, 0x5c, null, null, 0xd8, null, null, 0xd8, null, null, 0xd9, 0x5c, null, null, 0x83, null,
                    1, 15, 0x86, null, 0, 0, 0, 0xd9
                 };
                this.ZeroAddress = (this.FindMem(nullableArray3, 1, 0x400000, 0x500000) + nullableArray3.Length)[2];
                if (((this.KnifeRange == 0) || (this.DefaultKnifeAddress == 0)) || (this.ZeroAddress == 0))
                {
                    base.ServerPrint("Error finding address: NoKnife Plugin will not work");
                    this.Working = false;
                }
                else
                {
                    uint num;
                    VirtualProtect((IntPtr)this.KnifeRange, (IntPtr)4, 0x40, out num);
                }
                if (base.GetServerCFG("Knife", "Enabled", "1") == "0")
                {
                    this.Knife(false);
                }
            }
            catch (Exception exception)
            {
                base.ServerPrint("Error in NoKnife Plugin. Plugin will not work.");
                base.ServerPrint(exception.ToString());
                this.Working = false;
            }
        }

        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll")]
        private static extern bool VirtualProtect(IntPtr lpAddress, IntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);
    }
}
Reply

#85
(05-14-2013, 21:15)Diskretor Wrote: zxz0O0, you wrote "This plugin uses signature scans to find the offsets"
But i see there are no code for that scan in the 1-st post.

I use the code below for scanning. But it seems the addresses are wrong.
Can you help to correct this, please.

The plugin is working AFAIK, the source code on the main post is outdated I think.
did you decompile it or what?
Reply

#86
This code is outdated and doesn't work for me.
Yes. I trying to see the source of DLL that normally worked.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,165 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,745 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,541 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,668 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,177 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,272 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,637 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,711 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,272 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,063 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.