コード例 #1
0
func (bb *BasicBlock) GetInstructions(dis disassembly.Disassembler, as AS.AddressSpace) ([]gapstone.Instruction, error) {
	var instructions []gapstone.Instruction
	e := dis.IterateInstructions(as, bb.Start, func(insn gapstone.Instruction) (bool, error) {
		instructions = append(instructions, insn)
		return true, nil
	})
	return instructions, e
}
コード例 #2
0
func SkipInstruction(emu *emulator.Emulator, dis disassembly.Disassembler) error {

	pc := emu.GetInstructionPointer()
	insn, e := dis.ReadInstruction(emu, pc)
	check(e)

	nextPc := AS.VA(insn.Address + insn.Size)
	logrus.Debugf("Skipping from %s to %s", pc, nextPc)
	emu.SetInstructionPointer(nextPc)
	return nil
}