From 261839af5d98b6be4535b460746d629b8425871a Mon Sep 17 00:00:00 2001 From: wangluwei Date: Tue, 28 Mar 2023 10:38:43 +0800 Subject: [PATCH] add gen_elf_info and gen_ldd_info function --- src/binhandler.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/binhandler.py b/src/binhandler.py index a45bd8a..7f00c9b 100644 --- a/src/binhandler.py +++ b/src/binhandler.py @@ -78,3 +78,19 @@ class ABI: self.so_dep_rpm_dict = dict() self.NOTFOUND = "Not Found" + def gen_elf_info(self): + self.logger.info(f"Checking ELF information of file {self.binfile} ...") + output, _ = utils.run_subprocess( + f"{READELF} -s {self.binfile}", print_output=False + ) + + output_file = os.path.join(self.output_dir, self.READELF_FILE) + utils.store_content_to_file(output_file, output) + + def gen_ldd_info(self): + self.logger.info(f"Checking ldd information of file {self.binfile} ...") + output, _ = utils.run_subprocess(f"{LDD} {self.binfile}", print_output=False) + + output_file = os.path.join(self.output_dir, self.LDD_FILE) + utils.store_content_to_file(output_file, output) + -- Gitee