Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lz packer detection #33

Merged
merged 5 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions tools/fileinfo/detection/linkers/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from regression_tests import *

class Test_Watcom1(Test):
settings=TestSettings(
tool='fileinfo',
input=[
'sample_watcom_001.dat',
'sample_watcom_002.dat',
],
args='--json'
)

def test_corrupted_pe(self):
assert self.fileinfo.succeeded
self.assertTrue((self.fileinfo.output['tools'][1]['name'] == 'Watcom') or (self.fileinfo.output['tools'][3]['name'] == 'Watcom'))
Binary file not shown.
Binary file not shown.
Binary file not shown.
41 changes: 40 additions & 1 deletion tools/fileinfo/features/pe-packers/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
from regression_tests import *

class Test_ActiveMark(Test):
settings=TestSettings(
tool='fileinfo',
input=[
'sample_activemark.dat',
],
args='--json'
)

def test_corrupted_pe(self):
assert self.fileinfo.succeeded
self.assertTrue(self.fileinfo.output['tools'][1]['name'] == 'ActiveMark')

class Test_MPRMMGVA(Test):
settings=TestSettings(
tool='fileinfo',
input=[
'sample_mprmmgva.dat',
],
args='--json'
)

def test_corrupted_pe(self):
assert self.fileinfo.succeeded
self.assertTrue(self.fileinfo.output['tools'][0]['name'] == 'MPRMMGVA')

class Test_SafeDisc(Test):
settings=TestSettings(
tool='fileinfo',
Expand All @@ -13,7 +39,7 @@ class Test_SafeDisc(Test):

def test_corrupted_pe(self):
assert self.fileinfo.succeeded
self.assertTrue((self.fileinfo.output['tools'][1]['name'] == 'SafeDisc') or (self.fileinfo.output['tools'][2]['name'] == 'SafeDisc'))
self.assertIn('SafeDisc', [tool['name'] for tool in self.fileinfo.output['tools']])

class Test_SecuROM(Test):
settings=TestSettings(
Expand Down Expand Up @@ -44,3 +70,16 @@ class Test_StarForce(Test):
def test_corrupted_pe(self):
assert self.fileinfo.succeeded
self.assertTrue('StarForce' in self.fileinfo.output['tools'][0]['name'])

class Test_Petite(Test):
settings=TestSettings(
tool='fileinfo',
input=[
'sample_petite_001.dat',
],
args='--json'
)

def test_corrupted_pe(self):
assert self.fileinfo.succeeded
self.assertEqual(self.fileinfo.output['tools'][0]['name'], 'Petite')
3 changes: 2 additions & 1 deletion tools/fileinfo/features/vmprotect-heuristic/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def test_correctly_analyzes_input_file(self):
self.fileinfo.output['Detected tool'],
[
'VMProtect (packer), combined heuristic',
'Microsoft Linker (12.0) (linker), combined heuristic'
'Microsoft Linker (12.0) (linker), combined heuristic',
'Microsoft (linker), dos header style'
]
)