Skip to content

Commit

Permalink
Add tests for pe timestamps (#112)
Browse files Browse the repository at this point in the history
* Add tests for pe timestamps

* Update timestamp format
  • Loading branch information
HoundThe authored Oct 25, 2021
1 parent 8ceb72e commit 77182a0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions tools/fileinfo/features/pull-1035-pe-timestamps/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from regression_tests import *


class Test1(Test):
settings = TestSettings(
tool='fileinfo',
args='--json --verbose',
input='TidyESP.ex'
)

def test_pe_timestamps(self):
assert self.fileinfo.succeeded
self.assertEqual(self.fileinfo.output['timestamps']
['coffHeader'], 'Jan 9 04:52:11 2016 GMT')
self.assertEqual(self.fileinfo.output['timestamps']
['loadConfigDir'], 'Apr 18 05:10:52 2031 GMT')
self.assertEqual(self.fileinfo.output['timestamps']
['exportDir'], "Aug 23 03:12:51 2021 GMT")
self.assertEqual(self.fileinfo.output['timestamps']
['debugDirEntries'][0], "Jan 9 04:52:11 2016 GMT")
self.assertEqual(self.fileinfo.output['timestamps']
['debugDirEntries'][1], "Jan 9 04:52:11 2016 GMT")
self.assertEqual(
self.fileinfo.output['timestamps']['resourceDirectories'][0],
'Oct 19 11:13:06 2021 GMT')
self.assertEqual(self.fileinfo.output['timestamps']
['pdbDebugInfos'][0], 'Jul 25 04:53:49 2006 GMT')


class Test2(Test):
settings = TestSettings(
tool='fileinfo',
args='--json --verbose',
input='7110C2E35B423FCDB50D32DFCBE961CB5E67D9E8C87324A98E6F0191A862C495.ex'
)

def test_pe_timestamps(self):
assert self.fileinfo.succeeded
self.assertEqual(self.fileinfo.output['timestamps']
['coffHeader'], 'Apr 6 14:39:04 2016 GMT')
self.assertEqual(self.fileinfo.output['timestamps']
['loadConfigDir'], 'Jan 1 00:02:52 1970 GMT')
self.assertEqual(
self.fileinfo.output['timestamps']['resourceDirectories'][0],
'Aug 9 18:46:24 1970 GMT')
self.assertEqual(
self.fileinfo.output['timestamps']['resourceDirectories'][1],
'Feb 7 06:22:42 1970 GMT')
self.assertEqual(
self.fileinfo.output['timestamps']['resourceDirectories'][2],
'Aug 21 02:23:31 1971 GMT')
self.assertEqual(
self.fileinfo.output['timestamps']['resourceDirectories'][3],
"Apr 10 04:14:11 2024 GMT")

0 comments on commit 77182a0

Please sign in to comment.