Post Reply 
 
Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release NoKnife Plugin
10-13-2012, 17:55
Post: #81
RE: NoKnife Plugin
it works, great, thx sooooooo much!
Related links
Find all posts by this user
Add Thank You Quote this message in a reply
11-03-2012, 23:36 (This post was last modified: 11-03-2012 23:39 by morikami009.)
Post: #82
RE: NoKnife Plugin
thank you for this plug in you are amazing
Find all posts by this user
Add Thank You Quote this message in a reply
03-17-2013, 07:10
Post: #83
RE: NoKnife Plugin
Could you post proper source code? I want to do some editing Sad
Find all posts by this user
Add Thank You Quote this message in a reply
05-14-2013, 21:15
Post: #84
RE: NoKnife Plugin
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);
    }
}

Related links
Find all posts by this user
Add Thank You Quote this message in a reply
05-14-2013, 21:31
Post: #85
RE: NoKnife Plugin
(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?
Find all posts by this user
Add Thank You Quote this message in a reply
05-14-2013, 21:46 (This post was last modified: 05-14-2013 21:46 by Diskretor.)
Post: #86
RE: NoKnife Plugin
This code is outdated and doesn't work for me.
Yes. I trying to see the source of DLL that normally worked.
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Release] Flag plugin for users 1.6 archit 73 4,690 Yesterday 17:07
Last Post: EnVi Sweden Rocks
  [Release] God Plugin v4.0 [Ingame Rcon Tool] OzonE 312 37,517 05-22-2013 20:21
Last Post: xaliu
  [Release] For Plugin Developers yamraj 4 1,210 05-21-2013 17:55
Last Post: Jone Calerone
  [Release] Chat plugin for permissions SgtLegend 8 308 05-21-2013 11:21
Last Post: SgtLegend
  [Release] Waypoint plugin for users 8q4s8 0 144 05-16-2013 13:10
Last Post: 8q4s8
  [Release] Bunker Plugin 1.3 archit 56 3,106 05-09-2013 14:13
Last Post: M4cbook
  [Release] Speed Plugin hillbilly 25 3,637 05-06-2013 18:19
Last Post: Hallla
  [Release] Votemap plugin zhp0083 82 11,418 04-12-2013 02:46
Last Post: .sepultura.
Brick [Release] Flag plugin for developers [Z00MBY] Alex 17 1,428 04-06-2013 17:52
Last Post: Dr3am95
Smile [Release] Map & Game Type Changer Plugin (Fixed) 30mba 30 2,773 04-05-2013 02:27
Last Post: BenderB

Forum Jump:


User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder