diff --git a/tools/fileinfo/bugs/dot-net-edge-cases/DotNetSample32.exe_ b/tools/fileinfo/bugs/dot-net-edge-cases/DotNetSample32.exe_ new file mode 100644 index 0000000..c12ef6f Binary files /dev/null and b/tools/fileinfo/bugs/dot-net-edge-cases/DotNetSample32.exe_ differ diff --git a/tools/fileinfo/bugs/dot-net-edge-cases/DotNetSample32_NoDataDir.exe_ b/tools/fileinfo/bugs/dot-net-edge-cases/DotNetSample32_NoDataDir.exe_ new file mode 100644 index 0000000..0f1a7ac Binary files /dev/null and b/tools/fileinfo/bugs/dot-net-edge-cases/DotNetSample32_NoDataDir.exe_ differ diff --git a/tools/fileinfo/bugs/dot-net-edge-cases/TestDotNetInResources32.exe_ b/tools/fileinfo/bugs/dot-net-edge-cases/TestDotNetInResources32.exe_ new file mode 100644 index 0000000..6f44bfa Binary files /dev/null and b/tools/fileinfo/bugs/dot-net-edge-cases/TestDotNetInResources32.exe_ differ diff --git a/tools/fileinfo/bugs/dot-net-edge-cases/TestDotNetInResources64.exe_ b/tools/fileinfo/bugs/dot-net-edge-cases/TestDotNetInResources64.exe_ new file mode 100644 index 0000000..82b4a4d Binary files /dev/null and b/tools/fileinfo/bugs/dot-net-edge-cases/TestDotNetInResources64.exe_ differ diff --git a/tools/fileinfo/bugs/dot-net-edge-cases/test.py b/tools/fileinfo/bugs/dot-net-edge-cases/test.py new file mode 100644 index 0000000..e698620 --- /dev/null +++ b/tools/fileinfo/bugs/dot-net-edge-cases/test.py @@ -0,0 +1,31 @@ +from regression_tests import * + +class DotNetEdgeCaseTest1(Test): + settings = TestSettings( + tool='fileinfo', + args='--json --verbose', + input=['DotNetSample32.exe_', 'DotNetSample32_NoDataDir.exe_'] + ) + + def test_is_dotnet(self): + assert self.fileinfo.succeeded + self.assertEqual(self.fileinfo.output['fileFormat'], 'PE') + self.assertEqual(self.fileinfo.output['languages'][0]['name'], 'CIL/.NET') + self.assertTrue(self.fileinfo.output['languages'][0]['bytecode']) + self.assertEqual(self.fileinfo.output['dotnetInfo']['runtimeVersion'], '2.5') + self.assertEqual(self.fileinfo.output['dotnetInfo']['moduleVersionId'], 'e843efa5-5493-4098-8cd4-aa9a386da08e') + self.assertEqual(self.fileinfo.output['dotnetInfo']['classes'][0]['fullyQualifiedName'], 'TestNetAppForms.Program') + +class DotNetEdgeCaseTest2(Test): + settings = TestSettings( + tool='fileinfo', + args='--json --verbose', + input=['TestDotNetInResources32.exe_', 'TestDotNetInResources64.exe_'] + ) + + def test_is_not_dotnet(self): + assert self.fileinfo.succeeded + self.assertEqual(self.fileinfo.output['fileFormat'], 'PE') + self.assertFalse('languages' in self.fileinfo.output) + self.assertFalse('dotnetInfo' in self.fileinfo.output) + diff --git a/tools/fileinfo/features/pe-loader-corruptions/000-correct-file-small-alignment-32bit.ex_ b/tools/fileinfo/features/pe-loader-corruptions/000-correct-file-small-alignment-32bit.ex_ index c9711c3..7c261a6 100644 Binary files a/tools/fileinfo/features/pe-loader-corruptions/000-correct-file-small-alignment-32bit.ex_ and b/tools/fileinfo/features/pe-loader-corruptions/000-correct-file-small-alignment-32bit.ex_ differ