Skip to content

Commit

Permalink
fixed imports and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrphrazer committed Feb 23, 2022
1 parent 034aa03 commit 82300f7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
from binaryninja import PluginCommand

from obfuscation_detection import detect_obfuscation
from obfuscation_detection import heuristics
from .obfuscation_detection import detect_obfuscation
from .obfuscation_detection.heuristics import *

PluginCommand.register("Obfuscation Detection\\All",
"Detects obfuscated code via heuristics", detect_obfuscation)

PluginCommand.register("Obfuscation Detection\\Flattened Functions",
"Heuristic to detect flattened functions", heuristics.find_flattened_functions)
"Heuristic to detect flattened functions", find_flattened_functions)

PluginCommand.register("Obfuscation Detection\\Complex Functions",
"Heuristic to detect complex functions", heuristics.find_complex_functions)
"Heuristic to detect complex functions", find_complex_functions)

PluginCommand.register("Obfuscation Detection\\Large Basic Blocks",
"Heuristic to detect functions with large basic blocks", heuristics.find_large_basic_blocks)
"Heuristic to detect functions with large basic blocks", find_large_basic_blocks)

PluginCommand.register("Obfuscation Detection\\Instruction Overlapping",
"Heuristic to detect instruction overlapping", heuristics.find_instruction_overlapping)
"Heuristic to detect instruction overlapping", find_instruction_overlapping)

PluginCommand.register("Obfuscation Detection\\Uncommon Instruction Sequences",
"Heuristic to detect uncommon instruction sequences", heuristics.find_uncommon_instruction_sequences)
"Heuristic to detect uncommon instruction sequences", find_uncommon_instruction_sequences)
6 changes: 3 additions & 3 deletions obfuscation_detection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def detect_obfuscation(bv):
# find large basic blocks
find_large_basic_blocks(bv)

# find overlapping instructions
find_instruction_overlapping(bv)

# find uncommon instruction sequences
find_uncommon_instruction_sequences(bv)

# find overlapping instructions
find_instruction_overlapping(bv)
2 changes: 1 addition & 1 deletion obfuscation_detection/heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from binaryninja import highlight

from obfuscation_detection.utils import *
from .utils import *


def find_flattened_functions(bv):
Expand Down
2 changes: 0 additions & 2 deletions obfuscation_detection/ngrams.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from collections import Counter

# 1k most common 3-grams of x86_64
MOST_COMMON_3GRAMS = {'addaddadd',
'addaddcmp',
Expand Down
2 changes: 1 addition & 1 deletion obfuscation_detection/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import Counter
from math import ceil

from obfuscation_detection.ngrams import MOST_COMMON_3GRAMS
from .ngrams import MOST_COMMON_3GRAMS


def calc_flattening_score(function):
Expand Down

0 comments on commit 82300f7

Please sign in to comment.