예제 #1
0
 private VMStandardFilters IsStandardFilter(byte[] code, int codeSize)
 {
     VMStandardFilterSignature[] stdList = new VMStandardFilterSignature[]{
         new VMStandardFilterSignature(53, 0xad576887, VMStandardFilters.VMSF_E8),
         new VMStandardFilterSignature(57, 0x3cd7e57e, VMStandardFilters.VMSF_E8E9),
         new VMStandardFilterSignature(120, 0x3769893f, VMStandardFilters.VMSF_ITANIUM),
         new VMStandardFilterSignature(29, 0x0e06077d, VMStandardFilters.VMSF_DELTA),
         new VMStandardFilterSignature(149, 0x1c2c5dc8, VMStandardFilters.VMSF_RGB),
         new VMStandardFilterSignature(216, 0xbc85e701, VMStandardFilters.VMSF_AUDIO),
         new VMStandardFilterSignature(40, 0x46b9c560, VMStandardFilters.VMSF_UPCASE)};
     uint CodeCRC = RarCRC.CheckCrc(0xffffffff, code, 0, code.Length) ^ 0xffffffff;
     for (int i = 0; i < stdList.Length; i++)
     {
         if (stdList[i].CRC == CodeCRC && stdList[i].Length == code.Length)
         {
             return (stdList[i].Type);
         }
     }
     return (VMStandardFilters.VMSF_NONE);
 }
예제 #2
0
 private VMStandardFilters IsStandardFilter(byte[] code, int codeSize)
 {
     VMStandardFilterSignature[] signatureArray = new VMStandardFilterSignature[] { new VMStandardFilterSignature(0x35, 0xad576887, VMStandardFilters.VMSF_E8), new VMStandardFilterSignature(0x39, 0x3cd7e57e, VMStandardFilters.VMSF_E8E9), new VMStandardFilterSignature(120, 0x3769893f, VMStandardFilters.VMSF_ITANIUM), new VMStandardFilterSignature(0x1d, 0xe06077d, VMStandardFilters.VMSF_DELTA), new VMStandardFilterSignature(0x95, 0x1c2c5dc8, VMStandardFilters.VMSF_RGB), new VMStandardFilterSignature(0xd8, 0xbc85e701, VMStandardFilters.VMSF_AUDIO), new VMStandardFilterSignature(40, 0x46b9c560, VMStandardFilters.VMSF_UPCASE) };
     uint num = RarCRC.CheckCrc(uint.MaxValue, code, 0, code.Length) ^ uint.MaxValue;
     for (int i = 0; i < signatureArray.Length; i++)
     {
         if ((signatureArray[i].CRC == num) && (signatureArray[i].Length == code.Length))
         {
             return signatureArray[i].Type;
         }
     }
     return VMStandardFilters.VMSF_NONE;
 }