private void displayPayload(object shellcode) { shellcode_RTB.Clear(); payload = shellcode as GrayStorm.dataBox; if (shellcode is GrayStorm.dataBox) { if (disassemble_CB.Checked) { beaEngine.disassemble disasm = new beaEngine.disassemble(); unsafe { //Prevent garbage collector from relocating a movable variable for the duration of the disassembly and get the IntPtr of a byte array. fixed(byte *pointer = payload.data) { IntPtr offset = (IntPtr)pointer; disasm.disassembler(payload.data, this.shellcode_RTB, offset); } } } else { foreach (byte opcode in payload.data) { shellcode_RTB.AppendText(String.Format("0x{0:X2}\n", opcode)); } } } }
private void displayPayload(object shellcode) { shellcode_RTB.Clear(); payload = shellcode as GrayStorm.dataBox; if (shellcode is GrayStorm.dataBox) { if (disassemble_CB.Checked) { beaEngine.disassemble disasm = new beaEngine.disassemble(); unsafe { //Prevent garbage collector from relocating a movable variable for the duration of the disassembly and get the IntPtr of a byte array. fixed (byte* pointer = payload.data) { IntPtr offset = (IntPtr)pointer; disasm.disassembler(payload.data, this.shellcode_RTB, offset); } } } else { foreach (byte opcode in payload.data) { shellcode_RTB.AppendText(String.Format("0x{0:X2}\n", opcode)); } } } }