public void Set(OpCode src) { data = src.data; op1 = src.op1; op2 = src.op2; relative = src.relative; }
private static void exe3() { var exe = GetOutput("03.exe"); var module = new Module(IMAGE_SUBSYSTEM.WINDOWS_GUI); var c = new List<OpCode>(); var MessageBox = module.GetFunction(CallType.Std, "user32.dll", "MessageBoxW"); var ExitProcess = module.GetFunction(CallType.Std, "kernel32.dll", "ExitProcess"); c.Add(I386.Push(3)); var label = new OpCode(); c.Add(label); c.AddRange(MessageBox.Invoke(0, "yes", "no", 0)); c.Add(I386.Dec(new Addr32(Reg32.ESP))); c.Add(I386.Jcc(Cc.NZ, label.Address)); c.Add(I386.Add(Reg32.ESP, 4)); c.AddRange(ExitProcess.Invoke(0)); module.Text.OpCodes = c.ToArray(); try { module.Link(exe); } catch (IOException) { } Process.Start(exe); }