Skip to content

Duplicate entries in InstructionDefinitions.incΒ #586

@hainest

Description

@hainest

I was doing some parsing on InstructionDefinitions.inc and found that there are 128 duplicated entries. Given the definition of ZydisInstructionDefinition, it's not immediately clear to me why this would be. Are they redundant entries to make lookup faster?

Here are a few examples. I've included the perl script to fully reproduce my findings.

line 25 is a duplicate of line 21
line 26 is a duplicate of line 22
line 47 is a duplicate of line 43
line 48 is a duplicate of line 44

I didn't see a previous issue about this, but apologies for the noise if I missed it.


version: master@f2ad85f

use strict;
use warnings;

die "Usage: $0 /path/to/InstructionDefinitions.inc\n" unless @ARGV==1;

open my $fdIn, '<', $ARGV[0] or die "$ARGV[0]: $!\n";

my %all_insns = ();
while(<$fdIn>) {
  s/\s//g;
  last if $_ eq '};';  # only parse ISTR_DEFINITIONS_LEGACY
  if(exists $all_insns{$_}) {
    print "line $. is a duplicate of line $all_insns{$_}\n";
  } else {
    $all_insns{$_}=$.;
  } 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions