Skip to content

Instantly share code, notes, and snippets.

@fredimachado
Created February 1, 2012 16:13
Show Gist options
  • Save fredimachado/1717771 to your computer and use it in GitHub Desktop.
Save fredimachado/1717771 to your computer and use it in GitHub Desktop.
diff --git a/Formulas.cs b/Formulas.cs
index f65d65c..fabc88b 100644
--- a/Formulas.cs
+++ b/Formulas.cs
@@ -372,6 +372,44 @@ namespace OpcodeTools
{
return ((opcode & 0x8000) >> 13) | ((opcode & 0x80) >> 7) | ((opcode & 0x800) >> 10);
}
+ }
+
+ public class Windows422 : FormulasBase
+ {
+ public override string ToString()
+ {
+ return "4.2.2.14545 Windows";
+ }
+
+ protected override bool AuthCheck(uint opcode)
+ {
+ return (opcode & 0xEDFE) == 384;
+ }
+
+ protected override bool SpecialCheck(uint opcode)
+ {
+ return (opcode & 0x294D) == 8268;
+ }
+
+ protected override bool NormalCheck(uint opcode)
+ {
+ return (opcode & 0x2942) == 2114 && opcode != 7363 && opcode != 52479;
+ }
+
+ public override uint CalcCryptedFromOpcode(uint opcode)
+ {
+ return opcode & 1 | ((opcode & 0x3C | ((opcode & 0x80 | ((opcode & 0x600 | ((opcode & 0x1000 | (opcode >> 1) & 0x6000) >> 1)) >> 1)) >> 1)) >> 1);
+ }
+
+ public override uint CalcSpecialFromOpcode(uint opcode)
+ {
+ return (opcode & 2 | ((opcode & 0x30 | (((opcode & 0x80) | ((opcode & 0x600 | ((opcode & 0x1000 | (opcode >> 1) & 0x6000) >> 1)) >> 1)) >> 1)) >> 2)) >> 1;
+ }
+
+ public override uint CalcAuthFromOpcode(uint opcode)
+ {
+ return opcode & 1 | ((opcode & 0x200 | (opcode >> 2) & 0x400) >> 8);
+ }
}
public class Windows430 : FormulasBase
@@ -450,5 +488,43 @@ namespace OpcodeTools
{
return ((opcode & 0x1000) >> 9) | opcode & 1 | ((opcode & 0x400) >> 8) | ((opcode & 0x20) >> 4);
}
+ }
+
+ public class Windows432 : FormulasBase
+ {
+ public override string ToString()
+ {
+ return "4.3.2.15211 Windows";
+ }
+
+ protected override bool AuthCheck(uint opcode)
+ {
+ return (opcode & 0xEDDE) == 264;
+ }
+
+ protected override bool SpecialCheck(uint opcode)
+ {
+ return (opcode & 0xE50A) == 1024;
+ }
+
+ protected override bool NormalCheck(uint opcode)
+ {
+ return (opcode & 0x9701) != 1281;
+ }
+
+ public override uint CalcCryptedFromOpcode(uint opcode)
+ {
+ return (((opcode & 0xFE) | ((opcode & 0x800 | (opcode >> 1) & 0x3000) >> 3)) >> 1);
+ }
+
+ public override uint CalcSpecialFromOpcode(uint opcode)
+ {
+ return (opcode & 1 | (((opcode & 4) | (((opcode & 0xF0) | ((opcode & 0x200 | (opcode >> 1) & 0xC00) >> 1)) >> 1)) >> 1));
+ }
+
+ public override uint CalcAuthFromOpcode(uint opcode)
+ {
+ return (opcode & 1 | ((opcode & 0x20 | ((opcode & 0x200 | (opcode >> 2) & 0x400) >> 3)) >> 4));
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment