fosslight-binary 5.1.1__tar.gz → 5.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/PKG-INFO +2 -2
  2. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/README.md +1 -1
  3. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/requirements.txt +2 -2
  4. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/setup.py +1 -1
  5. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/binary_analysis.py +12 -8
  6. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/cli.py +22 -2
  7. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary.egg-info/PKG-INFO +2 -2
  8. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary.egg-info/requires.txt +2 -2
  9. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/LICENSE +0 -0
  10. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/LICENSES/Apache-2.0.txt +0 -0
  11. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/LICENSES/LicenseRef-3rd_party_licenses.txt +0 -0
  12. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/MANIFEST.in +0 -0
  13. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/setup.cfg +0 -0
  14. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/__init__.py +0 -0
  15. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/_binary.py +0 -0
  16. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/_binary_dao.py +0 -0
  17. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/_help.py +0 -0
  18. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/_jar_analysis.py +0 -0
  19. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary/_simple_mode.py +0 -0
  20. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary.egg-info/SOURCES.txt +0 -0
  21. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary.egg-info/dependency_links.txt +0 -0
  22. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary.egg-info/entry_points.txt +0 -0
  23. {fosslight_binary-5.1.1 → fosslight_binary-5.1.3}/src/fosslight_binary.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight_binary
3
- Version: 5.1.1
3
+ Version: 5.1.3
4
4
  Summary: FOSSLight Binary Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_binary_scanner
6
6
  Author: LG Electronics
@@ -25,7 +25,7 @@ Description: <!--
25
25
  ## 👏 Contributing Guide
26
26
 
27
27
  We always welcome your contributions.
28
- Please see the [CONTRIBUTING guide](https://fosslight.org/fosslight-guide-en/learn/1_contribution.html) for how to contribute.
28
+ Please see the [CONTRIBUTING guide](https://fosslight.org/hub-guide-en/contribution/1_contribution.html) for how to contribute.
29
29
 
30
30
 
31
31
  ## 📄 License
@@ -17,7 +17,7 @@ Please see the [**User Guide**](https://fosslight.org/fosslight-guide-en/scanner
17
17
  ## 👏 Contributing Guide
18
18
 
19
19
  We always welcome your contributions.
20
- Please see the [CONTRIBUTING guide](https://fosslight.org/fosslight-guide-en/learn/1_contribution.html) for how to contribute.
20
+ Please see the [CONTRIBUTING guide](https://fosslight.org/hub-guide-en/contribution/1_contribution.html) for how to contribute.
21
21
 
22
22
 
23
23
  ## 📄 License
@@ -2,11 +2,11 @@ binaryornot
2
2
  numpy
3
3
  pandas
4
4
  parmap
5
- psycopg2-binary
5
+ psycopg2-binary==2.9.9
6
6
  python-dateutil
7
7
  py-tlsh
8
8
  pytz
9
9
  XlsxWriter
10
10
  PyYAML
11
- fosslight_util>=2.1.0
11
+ fosslight_util>=2.1.6
12
12
  dependency-check
@@ -33,7 +33,7 @@ if __name__ == "__main__":
33
33
 
34
34
  setup(
35
35
  name=_PACKAEG_NAME,
36
- version='5.1.1',
36
+ version='5.1.3',
37
37
  package_dir={"": "src"},
38
38
  packages=find_packages(where='src'),
39
39
  description='FOSSLight Binary Scanner',
@@ -63,6 +63,8 @@ def get_checksum_and_tlsh(bin_with_path):
63
63
  checksum_value = str(sha1_hash.hexdigest())
64
64
  try:
65
65
  tlsh_value = str(tlsh.hash(byte))
66
+ if tlsh_value == "TNULL" or (not tlsh_value):
67
+ tlsh_value = TLSH_CHECKSUM_NULL
66
68
  except:
67
69
  tlsh_value = TLSH_CHECKSUM_NULL
68
70
  f.close()
@@ -90,12 +92,15 @@ def init(path_to_find_bin, output_file_name, formats, path_to_exclude=[]):
90
92
  for i, output_extension in enumerate(output_extensions):
91
93
  if output_files[i] is None or output_files[i] == "":
92
94
  if formats:
93
- if formats[i].startswith('spdx'):
94
- if platform.system() != 'Windows':
95
- output_files[i] = f"fosslight_spdx_bin_{start_time}"
96
- else:
97
- logger.warning('spdx format is not supported on Windows. Please remove spdx from format.')
95
+ if formats[i].startswith('spdx') or formats[i].startswith('cyclonedx'):
96
+ if platform.system() == 'Windows':
97
+ logger.warning(f'{formats[i]} is not supported on Windows. Please remove {formats[i]} from format.')
98
98
  to_remove.append(i)
99
+ else:
100
+ if formats[i].startswith('spdx'):
101
+ output_files[i] = f"fosslight_spdx_bin_{start_time}"
102
+ elif formats[i].startswith('cyclonedx'):
103
+ output_files[i] = f'fosslight_cyclonedx_bin_{start_time}'
99
104
  else:
100
105
  if output_extension == _json_ext:
101
106
  output_files[i] = f"fosslight_opossum_bin_{start_time}"
@@ -200,12 +205,11 @@ def find_binaries(path_to_find_bin, output_dir, formats, dburl="", simple_mode=F
200
205
  writing_msg = ""
201
206
  results = []
202
207
  bin_list = []
203
- base_dir_name = os.path.basename(path_to_find_bin)
204
208
  scan_item = ScannerItem(PKG_NAME, "")
205
- abs_path_to_exclude = [os.path.abspath(os.path.join(base_dir_name, path)) for path in path_to_exclude if path.strip() != ""]
209
+ abs_path_to_exclude = [os.path.abspath(path) for path in path_to_exclude if path.strip() != ""]
206
210
 
207
211
  if not os.path.isdir(path_to_find_bin):
208
- error_occured(error_msg=f"Can't find the directory : {path_to_find_bin}",
212
+ error_occured(error_msg=f"(-p option) Can't find the directory: {path_to_find_bin}",
209
213
  result_log=_result_log,
210
214
  exit=True,
211
215
  mode=mode)
@@ -5,6 +5,7 @@
5
5
  import argparse
6
6
  import sys
7
7
  import os
8
+ import shutil
8
9
  from fosslight_util.help import print_package_version
9
10
  from fosslight_binary._help import print_help_msg
10
11
  from fosslight_binary.binary_analysis import find_binaries
@@ -13,6 +14,23 @@ from fosslight_util.timer_thread import TimerThread
13
14
  _PKG_NAME = "fosslight_binary"
14
15
 
15
16
 
17
+ def get_terminal_size():
18
+ size = shutil.get_terminal_size()
19
+ return size.lines
20
+
21
+
22
+ def paginate_file(file_path):
23
+ lines_per_page = get_terminal_size() - 1
24
+ with open(file_path, 'r', encoding='utf8') as file:
25
+ lines = file.readlines()
26
+
27
+ for i in range(0, len(lines), lines_per_page):
28
+ os.system('clear' if os.name == 'posix' else 'cls')
29
+ print(''.join(lines[i: i + lines_per_page]))
30
+ if i + lines_per_page < len(lines):
31
+ input("Press Enter to see the next page...")
32
+
33
+
16
34
  def main():
17
35
  global windows
18
36
  path_to_find_bin = ""
@@ -85,8 +103,10 @@ def main():
85
103
  data_path = os.path.join(base_path, 'LICENSES')
86
104
  print(f"*** {_PKG_NAME} open source license notice ***")
87
105
  for ff in os.listdir(data_path):
88
- f = open(os.path.join(data_path, ff), 'r', encoding='utf8')
89
- print(f.read())
106
+ source_file = os.path.join(data_path, ff)
107
+ destination_file = os.path.join(base_path, ff)
108
+ paginate_file(source_file)
109
+ shutil.copyfile(source_file, destination_file)
90
110
  sys.exit(0)
91
111
 
92
112
  timer = TimerThread()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-binary
3
- Version: 5.1.1
3
+ Version: 5.1.3
4
4
  Summary: FOSSLight Binary Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_binary_scanner
6
6
  Author: LG Electronics
@@ -25,7 +25,7 @@ Description: <!--
25
25
  ## 👏 Contributing Guide
26
26
 
27
27
  We always welcome your contributions.
28
- Please see the [CONTRIBUTING guide](https://fosslight.org/fosslight-guide-en/learn/1_contribution.html) for how to contribute.
28
+ Please see the [CONTRIBUTING guide](https://fosslight.org/hub-guide-en/contribution/1_contribution.html) for how to contribute.
29
29
 
30
30
 
31
31
  ## 📄 License
@@ -2,13 +2,13 @@ binaryornot
2
2
  numpy
3
3
  pandas
4
4
  parmap
5
- psycopg2-binary
5
+ psycopg2-binary==2.9.9
6
6
  python-dateutil
7
7
  py-tlsh
8
8
  pytz
9
9
  XlsxWriter
10
10
  PyYAML
11
- fosslight_util>=2.1.0
11
+ fosslight_util>=2.1.6
12
12
  dependency-check
13
13
 
14
14
  [:"darwin" in sys_platform]