Skip to content

Commit 8c9bef4

Browse files
authored
Merge pull request #967 from s-ff/migrate-to-pyproject-toml
Migrate to pyproject toml
2 parents ff9de8e + a063377 commit 8c9bef4

File tree

4 files changed

+114
-106
lines changed

4 files changed

+114
-106
lines changed

floss/main.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ def make_parser(argv):
200200
type=str,
201201
choices=[l.value for l in Language if l != Language.UNKNOWN],
202202
default=Language.UNKNOWN.value,
203-
help="use language-specific string extraction, auto-detect language by default, disable using 'none'"
204-
if show_all_options
205-
else argparse.SUPPRESS,
203+
help=(
204+
"use language-specific string extraction, auto-detect language by default, disable using 'none'"
205+
if show_all_options
206+
else argparse.SUPPRESS
207+
),
206208
)
207209
advanced_group.add_argument(
208210
"-l",
@@ -215,9 +217,11 @@ def make_parser(argv):
215217
type=lambda x: int(x, 0x10),
216218
default=None,
217219
nargs="+",
218-
help="only analyze the specified functions, hex-encoded like 0x401000, space-separate multiple functions"
219-
if show_all_options
220-
else argparse.SUPPRESS,
220+
help=(
221+
"only analyze the specified functions, hex-encoded like 0x401000, space-separate multiple functions"
222+
if show_all_options
223+
else argparse.SUPPRESS
224+
),
221225
)
222226
advanced_group.add_argument(
223227
"--disable-progress",
@@ -228,17 +232,21 @@ def make_parser(argv):
228232
"--signatures",
229233
type=str,
230234
default=SIGNATURES_PATH_DEFAULT_STRING,
231-
help="path to .sig/.pat file or directory used to identify library functions, use embedded signatures by default"
232-
if show_all_options
233-
else argparse.SUPPRESS,
235+
help=(
236+
"path to .sig/.pat file or directory used to identify library functions, use embedded signatures by default"
237+
if show_all_options
238+
else argparse.SUPPRESS
239+
),
234240
)
235241
advanced_group.add_argument(
236242
"-L",
237243
"--large-file",
238244
action="store_true",
239-
help="allow processing files larger than {} MB".format(int(MAX_FILE_SIZE / MEGABYTE))
240-
if show_all_options
241-
else argparse.SUPPRESS,
245+
help=(
246+
"allow processing files larger than {} MB".format(int(MAX_FILE_SIZE / MEGABYTE))
247+
if show_all_options
248+
else argparse.SUPPRESS
249+
),
242250
)
243251
advanced_group.add_argument(
244252
"--version",

floss/render/default.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,19 @@ def render_string_type_rows(results: ResultDocument) -> List[Tuple[str, str]]:
9191
return [
9292
(
9393
" static strings",
94-
f"{len_ss:>{len(str(len_ss))}} ({len_chars_ss:>{len(str(len_chars_ss))}d} characters)"
95-
if results.analysis.enable_static_strings
96-
else DISABLED,
94+
(
95+
f"{len_ss:>{len(str(len_ss))}} ({len_chars_ss:>{len(str(len_chars_ss))}d} characters)"
96+
if results.analysis.enable_static_strings
97+
else DISABLED
98+
),
9799
),
98100
(
99101
" language strings",
100-
f"{len_ls:>{len(str(len_ss))}} ({len_chars_ls:>{len(str(len_chars_ss))}d} characters)"
101-
if results.metadata.language
102-
else DISABLED,
102+
(
103+
f"{len_ls:>{len(str(len_ss))}} ({len_chars_ls:>{len(str(len_chars_ss))}d} characters)"
104+
if results.metadata.language
105+
else DISABLED
106+
),
103107
),
104108
(
105109
" stack strings",

pyproject.toml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at: [package root]/LICENSE.txt
5+
# Unless required by applicable law or agreed to in writing, software distributed under the License
6+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7+
# See the License for the specific language governing permissions and limitations under the License.
8+
9+
[build-system]
10+
requires = ["setuptools", "setuptools-scm"]
11+
build-backend = "setuptools.build_meta"
12+
13+
[project]
14+
name = "flare-floss"
15+
description = "FLARE Obfuscated String Solver"
16+
license = {file = "LICENSE.txt"}
17+
authors = [
18+
{name = "Willi Ballenthin", email = "william.ballenthin@mandiant.com"},
19+
{name = "Moritz Raabe", email = "moritz.raabe@mandiant.com"},
20+
]
21+
requires-python=">=3.8"
22+
keywords = ["floss", "malware", "analysis", "obfuscation", "strings", "FLARE"]
23+
classifiers = [
24+
"Development Status :: 5 - Production/Stable",
25+
"Intended Audience :: Developers",
26+
"Intended Audience :: Information Technology",
27+
"License :: OSI Approved :: Apache Software License",
28+
"Natural Language :: English",
29+
"Programming Language :: Python :: 3",
30+
"Topic :: Security",
31+
]
32+
33+
dependencies = [
34+
"tabulate==0.9.0",
35+
"vivisect==1.1.1",
36+
"viv-utils[flirt]==0.7.9",
37+
"pydantic==1.10.9",
38+
"tqdm==4.65.0",
39+
"networkx==3.1",
40+
"halo==0.0.31",
41+
"rich==13.4.2",
42+
"pefile>=2022.5.30",
43+
"binary2strings==0.1.13",
44+
]
45+
dynamic = ["version", "readme"]
46+
47+
[tool.setuptools.dynamic]
48+
version = {attr = "floss.version.__version__"}
49+
readme = {file = "README.md"}
50+
51+
[tool.setuptools]
52+
packages = ["floss", "floss.sigs"]
53+
54+
[project.optional-dependencies]
55+
dev = [
56+
"pre-commit==3.5.0",
57+
"pyyaml==6.0.1",
58+
"pytest==8.0.2",
59+
"pytest-sugar==0.9.4",
60+
"pytest-instafail==0.5.0",
61+
"pytest-cov==4.1.0",
62+
"pycodestyle==2.11.1",
63+
"black==23.12.1",
64+
"isort==5.13.2",
65+
"mypy==1.8.0",
66+
# type stubs for mypy
67+
"types-PyYAML==6.0.10",
68+
"types-tabulate==0.9.0.20240106",
69+
]
70+
build = [
71+
"pyinstaller==6.3.0",
72+
"setuptools==69.1.1",
73+
"build==1.0.3"
74+
]
75+
76+
77+
[project.urls]
78+
Homepage = "https://www.github.com/mandiant/flare-floss"
79+
Repository = "https://www.github.com/mandiant/flare-floss.git"
80+
Documentation = "https://github.com/mandiant/flare-floss/tree/master/doc"
81+
Signatures = "https://github.com/mandiant/flare-floss/tree/master/floss/sigs"
82+
83+
[project.scripts]
84+
floss = "floss.main:main"

setup.py

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)