Exemple #1
0
 def insert_random_instructions(instructions, amount=1):
     len_instr = len(instructions)
     for _ in range(amount):
         index = Rnd.uni_integer(0, len_instr - 1)
         instructions.insert(
             index,
             evmdasm.registry.create_instruction(
                 opcode=Rnd.uni_integer(0x00, 0xff)))
         Rnd.randomize_operand(instructions[index])
     return instructions
Exemple #2
0
 def randomize_operand(instructions, amount=1):
     len_instr = len(instructions)
     for _ in range(amount):
         index = Rnd.uni_integer(0, len_instr - 1)
         Rnd.randomize_operand(instructions[index])
     return instructions