mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
feature: setting for r2 disas
This commit is contained in:
@@ -13,6 +13,7 @@ class Config(object):
|
||||
self.data = {}
|
||||
self.ShowCommandOutput: bool = False
|
||||
self.debug: bool = False
|
||||
self.has_r2: bool = True
|
||||
|
||||
self.data_fixups = None
|
||||
self.data_fixup_entries = None
|
||||
|
||||
@@ -2,6 +2,7 @@ from typing import List, Dict
|
||||
import logging
|
||||
|
||||
from pe.r2helper import r2_disas
|
||||
from config import config
|
||||
|
||||
logger = logging.getLogger("Observer")
|
||||
|
||||
@@ -44,6 +45,9 @@ class Observer():
|
||||
|
||||
|
||||
def add_code_file(self, name, data: bytes):
|
||||
if not config.has_r2:
|
||||
return
|
||||
|
||||
ret = r2_disas(data)
|
||||
self.files.append((name + ".disas.ascii", ret['color']))
|
||||
#self.write_to_file(name + ".disas.txt", ret['text'])
|
||||
|
||||
Reference in New Issue
Block a user