Exemplo n.º 1
0
    def analyze(self, experiment, version):
        exe = experiment.as_binary_filename(experiment, version)
        suffix = ida.get_suffix(experiment)

        ida.selectIdaSuffix(exe, suffix, experiment.path)
        ida.run_Ida_Script(exe, "analyze_turbodiff.idc", suffix,
                           experiment.path, [".ana", ".dis", ".turbodiffinfo"],
                           "")
Exemplo n.º 2
0
    def match(self, experiment, v1, v2):
        exe1 = experiment.as_binary_filename(experiment, v1)
        exe2 = experiment.as_binary_filename(experiment, v2)
        suffix = ida.get_suffix(experiment)

        file_base = self.filename_base(experiment, v1, v2)

        options = "turbodiff_bart:%s %s" % (multiplatform.local_dir_entry(
            experiment.path, exe2) + ".idb", file_base)

        ida.selectIdaSuffix(exe1, suffix, experiment.path)
        ida.selectIdaSuffix(exe2, suffix, experiment.path)
        ida.run_Ida_Script(exe1, "match_turbodiff.idc", suffix,
                           experiment.path, [".turbodiffdump"], options,
                           file_base)
Exemplo n.º 3
0
def match(experiment, v1, v2):
    exe1 = experiment.as_binary_filename(experiment, v1)
    exe2 = experiment.as_binary_filename(experiment, v2)
    suffix = ida.get_suffix(experiment)

    file_base = filename_base(experiment, v1, v2)

    options = "patchdiff2_bart:%s %s" % (multiplatform.local_dir_entry(
        experiment.path, exe2) + ".idb", file_base)

    ida.selectIdaSuffix(exe1, suffix, experiment.path)
    ida.selectIdaSuffix(exe2, suffix, experiment.path)
    ida.run_Ida_Script(exe1, "match_patchdiff2.idc", suffix, experiment.path, [
        ".patchdiff2.identical.out", ".patchdiff2.info", ".patchdiff2.matches",
        "patchdiff2.unmatched1", ".patchdiff2.unmatched2"
    ], options, file_base)
Exemplo n.º 4
0
    def match(self, experiment, v1, v2):
        exe1 = experiment.as_binary_filename(experiment, v1)
        exe2 = experiment.as_binary_filename(experiment, v2)
        suffix = ida.get_suffix(experiment)

        file_base = self.filename_base(experiment, v1, v2)

        ida.selectIdaSuffix(exe1, suffix, experiment.path)
        ida.selectIdaSuffix(exe2, suffix, experiment.path)

        ida_call = '"%s" -A -S%s\\%s ' % (ida.ida_binary, ida.ida_scriptdir,
                                          "binarydiffer.idc")

        logging.info("Running BinaryDiffer %s against %s", exe1, exe2)
        call([
            binarydiffer, exe1, exe2,
            self.full_filename(experiment, v1, v2), ida_call
        ])
Exemplo n.º 5
0
    def run_BinDiff_once(self, v1, v2, out_file, suffix, path):
        ida.selectIdaSuffix(v1, suffix, path)
        ida.selectIdaSuffix(v2, suffix, path)

        logging.info(
            "Running BinDiff, comparing file %s with %s (with suffix %s)", v1,
            v2, suffix)

        self.binExport(v1, suffix, path)
        self.binExport(v2, suffix, path)

        logging.info("Diffing...")
        # TODO: log output?
        target_bindiff = "%s/%s_vs_%s.BinDiff" % (multiplatform.asLocal(path),
                                                  v1, v2)

        try:
            os.remove(target_bindiff)
        except OSError, e:
            pass