예제 #1
0
파일: ChatHook.cs 프로젝트: jariz/jZm
        public override void HookFrame(ZombieAPI API)
        {
            uint bytesout;

            uint bytesWritten;

            byte[] ptrChat = new byte[4];

            I.ReadProcessMemory(ProcessHandle, chatAddress, ptrChat, 4, out bytesout);

            if (ptrChat[0] != 0x00 && ptrChat[2] != 0x00)
            {
                I.ReadProcessMemory(ProcessHandle, (IntPtr)BitConverter.ToInt32(ptrChat, 0), chatBytes, 128, out bytesout);

                if (chatBytes[0] != 0x00)
                {
                    calls++;
                    if (calls == 2)
                    {
                        string d = "";
                    }
                    string FinalChat = System.Text.Encoding.ASCII.GetString(chatBytes);

                    GameObjects.Player player = ReadG_SayClient(API);

                    int res = I.WriteProcessMemory(ProcessHandle, (IntPtr)BitConverter.ToInt32(ptrChat, 0), btnull, (uint)btnull.Length, out bytesWritten);

                    //remove 0bytes
                    FinalChat = FinalChat.Replace("\0", "");

                    API.TriggerOnChat(player, FinalChat);
                }
            }
        }
예제 #2
0
파일: GEntity.cs 프로젝트: jariz/jZm
        /// <summary>
        /// Initialize a new GEntity based on the offset.
        /// </summary>
        /// <remarks>
        /// DO NOT CALL FROM PLUGIN. Use <see cref="ZombieAPI.Entities"/> to get all entities.
        /// </remarks>
        /// <param name="Game">The game process</param>
        /// <param name="EntityAddr">The offset of the entity</param>
        /// <param name="Parent">ZombieAPI that initializes this class</param>
        public GEntity(Process Game, int EntityAddr, ZombieAPI Parent)
        {
            this.Mem = new RemoteMemory(Game);
            Position = EntityAddr;
            BaseOffset = EntityAddr;
            _parent = Parent;

            a_ClientNum = aInt(); //0x0000
            a_Stance = aInt(); //0x0004
            Move(16); //0x0008
            a_Origin = aVec(3); //0x0018
            Move(24); //0x0024
            a_Angles = aVec(2); //0x003C
            Move(28); //0x0044
            a_CurrentWeapon = aInt(); //0x0060
            Move(116); //0x0064
            a_entityType = aShort(); //0x00D8
            Move(66); //0x00DA
            a_newOrigin = aVec(3); //0x0011C
            Move(44); //0x0128
            a_playerAddr = aInt(); //0x154
            Move(4); //0x0158
            a_teamAddr = aInt(); //0x015C
            Move(12); //0x0160
            a_ModelIndex = aInt(); //0x016C
            Move(56); //0x0170
            a_Health = aInt(); //0x01A8
            Mem.Move(29320); //0x01AC
        }
예제 #3
0
파일: DVar.cs 프로젝트: jariz/jZm
        /// <summary>
        /// Initializes a new DVar object
        /// </summary>
        /// <param name="Game"></param>
        /// <param name="DvarAddr"></param>
        /// <param name="Parent"></param>
        public DVar(Process Game, int DvarAddr, ZombieAPI Parent)
        {
            this.Mem = new RemoteMemory(Game);
            Position = DvarAddr;
            BaseOffset = DvarAddr;
            _parent = Parent;
            Mem.Position = Position;

            a_Name = aInt(); //0x0000
            Mem.Position = a_Name;
            Mem.Position = Mem.ReadInt32();
            _name = Mem.ReadStringSmart();
            Mem.Position = Position;

            a_Desc = aInt(); //0x0004
            Mem.Position = a_Desc;
            Mem.Position = Mem.ReadInt32();
            _desc = Mem.ReadStringSmart();
            Mem.Position = Position;

            Move(4); //0x0008
            a_Flags = aInt(); //0x000C
            a_Type = aInt(); //0x0010
            Move(4); //0x0014
            a_DvarValueBool = aInt(); //0x0018
            a_DvarValueInt = aInt();
            a_DvarValueUInt = aInt();
            a_DvarValueFloat = aInt();
            a_DvarValueVector = aVec(4);
            a_DvarValueStringPointer = aInt();
            Move(36); //0x001C

            Value = new DVarValue(this);
        }
예제 #4
0
파일: ChatHook.cs 프로젝트: jariz/jZm
        private GameObjects.Player ReadG_SayClient(ZombieAPI api)
        {
            uint bytesout;

            byte[] ptrGNumber = new byte[4];

            I.ReadProcessMemory(ProcessHandle, gentityAddress, ptrGNumber, 4, out bytesout);

            if (ptrGNumber[0] != 0x00 && ptrGNumber[2] != 0x00)
            {
                I.ReadProcessMemory(ProcessHandle, (IntPtr)BitConverter.ToInt32(ptrGNumber, 0), gentityBytes, 4, out bytesout);

                if (gentityBytes != null)
                {
                    return api.Entities[BitConverter.ToInt32(gentityBytes, 0)].Player;
                }
            }
            return null;
        }
예제 #5
0
 public override void HookFrame(ZombieAPI API)
 {
 }
예제 #6
0
파일: Main.cs 프로젝트: jariz/jZm
 void API_OnPluginCrash(Exception exep, ZombieAPI.jZmPlugin plug)
 {
     Program.PluginExc(exep, plug);
 }