Ejemplo n.º 1
0
        public byte[] Execute(byte[] EA, int pointer_position)
        {
            if (HNDL == 0)
            {
                return(EA);
            }
            if (EA.Length < 1)
            {
                Execute(); return(EA);
            }
            int wrt = 0;
            int FP  = EF.VirtualAllocEx(HNDL, 0, CD.LENGTH, 0x1000, 4);
            int OP  = EF.VirtualAllocEx(HNDL, 0, EA.Length, 0x1000, 4);

            Copy(OP, pointer_position, 4);
            EF.WriteProcessMemory(HNDL, FP, CD.DATA, CD.LENGTH, ref wrt);
            EF.WriteProcessMemory(HNDL, OP, EA, EA.Length, ref wrt);
            int TH = EF.CreateRemoteThread(HNDL, 0, 0, FP, 0, 0, ref wrt);

            if (TH == -1)
            {
                EF.VirtualFreeEx(HNDL, FP, CD.LENGTH, 0x8); EF.VirtualFreeEx(HNDL, OP, EA.Length, 0x8); return(EA);
            }
            EF.WaitForSingleObject(TH, 0xFFFFFFFF);
            EF.ReadProcessMemory(HNDL, OP, EA, EA.Length, ref wrt);
            EF.CloseHandle(TH);
            EF.VirtualFreeEx(HNDL, FP, CD.LENGTH, 0x8);
            EF.VirtualFreeEx(HNDL, OP, EA.Length, 0x8);
            return(EA);
        }
Ejemplo n.º 2
0
        public Boolean Send()
        {
            if (HNDL == 0)
            {
                return(false);
            }
            byte[] WP =
            {
                0x60,                               // PUSHAH
                0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, // mov ecx, [BA]
                0x8B, 0x49, 0x20,                   // mov ecx, [ecx + 20]
                0x68, 0x11, 0x11, 0x11, 0x11,       // push PACKET_LENGTH
                0x68, 0x22, 0x22, 0x22, 0x22,       // push PACKET_PTR
                0xB8, 0x33, 0x33, 0x33, 0x33,       // mov eax, SendPacketFunction
                0xFF, 0xD0,                         // call eax
                0x61, 0xC3                          // POPAD, RET
            };
            Packet FD = new Packet(HNDL, WP);

            FD.Copy(OFS.BA, 3, 4);
            FD.Copy(OFS.PA, 21, 4);
            FD.Copy(CD.LENGTH, 11, 4);
            int FP = -1; int PP = -1; int wrt = -1;

            try
            {
                FP = EF.VirtualAllocEx(HNDL, 0, FD.CD.LENGTH, 0x1000, 4);
                PP = EF.VirtualAllocEx(HNDL, 0, CD.LENGTH, 0x1000, 4);
                FD.Copy(PP, 16, 4);
                EF.WriteProcessMemory(HNDL, FP, FD.CD.DATA, FD.CD.LENGTH, ref wrt);
                EF.WriteProcessMemory(HNDL, PP, CD.DATA, CD.LENGTH, ref wrt);
            }
            catch (Exception)
            {
                if (FP > 0)
                {
                    EF.VirtualFreeEx(HNDL, FP, FD.CD.LENGTH, 0x8);
                }
                if (PP > 0)
                {
                    EF.VirtualFreeEx(HNDL, PP, CD.LENGTH, 0x8);
                }
                return(false);
            }
            int hProcThread = EF.CreateRemoteThread(HNDL, 0, 0, FP, 0, 0, ref wrt);

            if (hProcThread == -1)
            {
                EF.VirtualFreeEx(HNDL, FP, FD.CD.LENGTH, 0x8);
                EF.VirtualFreeEx(HNDL, PP, CD.LENGTH, 0x8);
                return(false);
            }
            EF.WaitForSingleObject(hProcThread, 0xFFFFFFFF);
            EF.CloseHandle(hProcThread);
            EF.VirtualFreeEx(HNDL, FP, FD.CD.LENGTH, 0x8);
            EF.VirtualFreeEx(HNDL, PP, CD.LENGTH, 0x8);
            return(true);
        }
Ejemplo n.º 3
0
        public static int WD(int HNDL, int PTR, int value)
        {
            byte[] buffer = new byte[4];
            int[]  vv     = new int[1] {
                value
            };
            Buffer.BlockCopy(vv, 0, buffer, 0, 4);
            int write = 0;

            EF.WriteProcessMemory(HNDL, PTR, buffer, 4, ref write);
            return(write);
        }
Ejemplo n.º 4
0
        public Boolean Execute()
        {
            if (HNDL == 0)
            {
                return(false);
            }
            int wrt = 0;
            int FP  = EF.VirtualAllocEx(HNDL, 0, CD.LENGTH, 0x1000, 4);

            EF.WriteProcessMemory(HNDL, FP, CD.DATA, CD.LENGTH, ref wrt);
            int TH = EF.CreateRemoteThread(HNDL, 0, 0, FP, 0, 0, ref wrt);

            if (TH == -1)
            {
                EF.VirtualFreeEx(HNDL, FP, CD.LENGTH, 0x8); return(false);
            }
            EF.WaitForSingleObject(TH, 0xFFFFFFFF);
            EF.CloseHandle(TH);
            EF.VirtualFreeEx(HNDL, FP, CD.LENGTH, 0x8);
            return(true);
        }