Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Trigonometry(ModuleDefMD module)
- {
- double tobemodified = 0;
- double result = 0;
- foreach (TypeDef type in module.Types)
- {
- foreach (MethodDef method in type.Methods)
- {
- if (!method.HasBody)
- {
- continue;
- }
- if (method.Body.HasInstructions)
- {
- for (int i = 0; i < method.Body.Instructions.Count; i++)
- {
- if (method.Body.Instructions[i].OpCode == OpCodes.Ldc_R8 && method.Body.Instructions[i + 1].OpCode == OpCodes.Call && method.Body.Instructions[i + 1].ToString().Contains("Sin"))
- {
- tobemodified = Convert.ToDouble(method.Body.Instructions[i].Operand);
- result = Math.Sin(tobemodified);
- method.Body.Instructions[i].Operand = result;
- method.Body.Instructions.RemoveAt(i + 1);
- SolvedMath++;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement