4242 help = "BinDiff differ directory" ,
4343)
4444@click .option ("-o" , "--output" , type = click .Path (), default = None , help = "Output file matching" )
45- @click .argument ("primary" , type = click .Path (exists = True ), metavar = "<primary file>" )
46- @click .argument ("secondary" , type = click .Path (exists = True ), metavar = "<secondary file>" )
47- def main (ida_path : str , bindiff_path : str , output : str , primary : str , secondary : str ) -> None :
45+ @click .argument ("primary" , type = click .Path (exists = True , path_type = Path ), metavar = "<primary file>" )
46+ @click .argument ("secondary" , type = click .Path (exists = True , path_type = Path ), metavar = "<secondary file>" )
47+ def main (ida_path : str , bindiff_path : str , output : str , primary : Path , secondary : Path ) -> None :
4848 """
4949 bindiffer is a very simple utility to diff two binary files using BinDiff
5050 in command line. The two input files can be either binary files (in which
@@ -79,9 +79,6 @@ def main(ida_path: str, bindiff_path: str, output: str, primary: str, secondary:
7979 logging .error ("Output file name is too long (%s)." , output )
8080 exit (1 )
8181
82- primary = Path (primary )
83- secondary = Path (secondary )
84-
8582 if not (primary .suffix == ".BinExport" and secondary .suffix == ".BinExport" ):
8683 for file in [primary , secondary ]:
8784 mime_type = magic .from_file (file , mime = True )
@@ -95,11 +92,11 @@ def main(ida_path: str, bindiff_path: str, output: str, primary: str, secondary:
9592
9693 # Export each binary separately (and then diff to be able to print it)
9794 logging .info (f"export primary: { primary } .BinExport" )
98- ProgramBinExport .from_binary_file (primary , open_export = False , override = True )
95+ ProgramBinExport .generate (primary , override = True )
9996 primary = Path (str (primary ) + ".BinExport" )
10097
10198 logging .info (f"export secondary: { secondary } .BinExport" )
102- ProgramBinExport .from_binary_file (secondary , open_export = False , override = True )
99+ ProgramBinExport .generate (secondary , override = True )
103100 secondary = Path (str (secondary ) + ".BinExport" )
104101
105102 logging .info ("start diffing" )
0 commit comments