aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/suite/synctools/compare_mapping_insn.py
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /capstone/suite/synctools/compare_mapping_insn.py
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'capstone/suite/synctools/compare_mapping_insn.py')
-rwxr-xr-xcapstone/suite/synctools/compare_mapping_insn.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/capstone/suite/synctools/compare_mapping_insn.py b/capstone/suite/synctools/compare_mapping_insn.py
new file mode 100755
index 000000000..7477be811
--- /dev/null
+++ b/capstone/suite/synctools/compare_mapping_insn.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+# compare instructions in 2 files of MappingInsn.inc
+# find instructions in MappingInsn1, that does not exist in MappingInsn2
+# by Nguyen Anh Quynh, 2019
+
+import sys
+
+if len(sys.argv) == 1:
+ print("Syntax: %s <MappingInsn1.inc> <MappingInsn2.inc>" %sys.argv[0])
+ sys.exit(1)
+
+f = open(sys.argv[1])
+mapping1 = f.readlines()
+f.close()
+
+f = open(sys.argv[2])
+mapping2 = f.readlines()
+f.close()
+
+insn1 = []
+for line in mapping1:
+ if 'X86_INS_' in line:
+ tmp = line.split(',')
+ insn_id = tmp[0].strip()
+ insn1.append(insn_id)
+
+insn2 = []
+for line in mapping2:
+ if 'X86_INS_' in line:
+ tmp = line.split(',')
+ insn_id = tmp[0].strip()
+ insn2.append(insn_id)
+
+for insn_id in insn1:
+ if not insn_id in insn2:
+ print("instruction %s is not in list 2" %insn_id)
+
+