From ab07022ff320b2595a057395d60c158fc8f15faa Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Tue, 14 Jan 2025 17:52:22 +0100 Subject: [PATCH 1/3] [copyright + license] Fix headers Replace the header from source code files using the following script: ```Python for dir_path, dir_names, file_names in os.walk("flare-floss"): for file_name in file_names: try: file_path = f"{dir_path}/{file_name}" f = open(file_path, "rb+") content = f.read() m = re.search(OLD_HEADER, content) if not m: continue print(f"{file_path}: {m.group('year')}") content = content.replace(m.group(0), NEW_HEADER % m.group("year")) f.seek(0) f.write(content) except: continue ``` Some files had the copyright headers inside a `"""` comment and needed manual changes before applying the script. The old header had the confusing sentence `All rights reserved`, which does not make sense for an open source license. Replace the header by the default Google header that corrects this issue and keep floss consistent with other Google projects. --- .github/pyinstaller/floss.spec | 16 ++++++++- .github/pyinstaller/hooks/hook-vivisect.py | 15 +++++++- floss/api_hooks.py | 15 +++++++- floss/const.py | 15 +++++++- floss/decoding_manager.py | 15 +++++++- floss/features/extract.py | 15 +++++++- floss/features/features.py | 15 +++++++- floss/function_argument_getter.py | 15 +++++++- floss/identify.py | 15 +++++++- floss/language/go/coverage.py | 15 +++++++- floss/language/go/extract.py | 15 +++++++- floss/language/identify.py | 15 +++++++- floss/language/rust/coverage.py | 15 +++++++- floss/language/rust/extract.py | 15 +++++++- floss/language/rust/rust_version_database.py | 15 +++++++- floss/logging_.py | 15 +++++++- floss/main.py | 15 +++++++- floss/render/default.py | 15 +++++++- floss/render/json.py | 15 +++++++- floss/render/sanitize.py | 15 +++++++- floss/results.py | 15 +++++++- floss/stackstrings.py | 15 +++++++- floss/string_decoder.py | 15 +++++++- floss/strings.py | 15 +++++++- floss/tightstrings.py | 15 +++++++- floss/utils.py | 15 +++++++- floss/version.py | 15 +++++++- pyproject.toml | 15 +++++++- scripts/extract_rust_hashes.py | 38 ++++++++++++++------ scripts/idaplugin.py | 15 +++++++- scripts/render-binja-import-script.py | 22 +++++++----- scripts/render-ghidra-import-script.py | 23 +++++++----- scripts/render-ida-import-script.py | 29 ++++++++++----- scripts/render-r2-import-script.py | 23 +++++++----- scripts/render-x64dbg-database.py | 23 +++++++----- tests/conftest.py | 15 +++++++- tests/fixtures.py | 15 +++++++- tests/test_buf_filled_with.py | 15 +++++++- tests/test_cli_args.py | 15 +++++++- tests/test_main.py | 15 +++++++- tests/test_memdiff.py | 15 +++++++- tests/test_render.py | 15 +++++++- tests/test_scripts.py | 15 +++++++- 43 files changed, 623 insertions(+), 91 deletions(-) diff --git a/.github/pyinstaller/floss.spec b/.github/pyinstaller/floss.spec index c4a1821fa..9ec067a92 100644 --- a/.github/pyinstaller/floss.spec +++ b/.github/pyinstaller/floss.spec @@ -1,5 +1,19 @@ # -*- mode: python -*- -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + import subprocess # when invoking pyinstaller from the project root, diff --git a/.github/pyinstaller/hooks/hook-vivisect.py b/.github/pyinstaller/hooks/hook-vivisect.py index 8038b7146..eb9acdc48 100644 --- a/.github/pyinstaller/hooks/hook-vivisect.py +++ b/.github/pyinstaller/hooks/hook-vivisect.py @@ -1,4 +1,17 @@ -# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved. +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from PyInstaller.utils.hooks import copy_metadata diff --git a/floss/api_hooks.py b/floss/api_hooks.py index 318b9363d..e8dc9f2bf 100644 --- a/floss/api_hooks.py +++ b/floss/api_hooks.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import contextlib from typing import Any, List, Tuple diff --git a/floss/const.py b/floss/const.py index acf0c85a4..fa3a2233f 100644 --- a/floss/const.py +++ b/floss/const.py @@ -1,4 +1,17 @@ -# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved. +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + KILOBYTE = 1024 MEGABYTE = 1024 * KILOBYTE diff --git a/floss/decoding_manager.py b/floss/decoding_manager.py index 02e951c65..9cf7bd081 100644 --- a/floss/decoding_manager.py +++ b/floss/decoding_manager.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Tuple from dataclasses import dataclass diff --git a/floss/features/extract.py b/floss/features/extract.py index 06fc91068..f79bbf880 100644 --- a/floss/features/extract.py +++ b/floss/features/extract.py @@ -1,4 +1,17 @@ -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Any, Tuple, Callable, Iterator import envi diff --git a/floss/features/features.py b/floss/features/features.py index 5f6c460ff..1ea341d87 100644 --- a/floss/features/features.py +++ b/floss/features/features.py @@ -1,4 +1,17 @@ -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import floss.identify diff --git a/floss/function_argument_getter.py b/floss/function_argument_getter.py index a828fb5eb..3a344d6ab 100644 --- a/floss/function_argument_getter.py +++ b/floss/function_argument_getter.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import contextlib from typing import Set, List diff --git a/floss/identify.py b/floss/identify.py index e219d12a4..45e63d24b 100644 --- a/floss/identify.py +++ b/floss/identify.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import copy import operator diff --git a/floss/language/go/coverage.py b/floss/language/go/coverage.py index 94b7fa29d..5081dfc59 100644 --- a/floss/language/go/coverage.py +++ b/floss/language/go/coverage.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import sys import logging import pathlib diff --git a/floss/language/go/extract.py b/floss/language/go/extract.py index c1e5bf95f..95e5e95ac 100644 --- a/floss/language/go/extract.py +++ b/floss/language/go/extract.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re import sys diff --git a/floss/language/identify.py b/floss/language/identify.py index d337a6166..bc22cfc5b 100644 --- a/floss/language/identify.py +++ b/floss/language/identify.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re from enum import Enum diff --git a/floss/language/rust/coverage.py b/floss/language/rust/coverage.py index d36992f3a..0596a1ec1 100644 --- a/floss/language/rust/coverage.py +++ b/floss/language/rust/coverage.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import sys import logging diff --git a/floss/language/rust/extract.py b/floss/language/rust/extract.py index 4d40c3af9..b31c4b96c 100644 --- a/floss/language/rust/extract.py +++ b/floss/language/rust/extract.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import sys import logging import pathlib diff --git a/floss/language/rust/rust_version_database.py b/floss/language/rust/rust_version_database.py index 8f89d6cb6..e27f08590 100644 --- a/floss/language/rust/rust_version_database.py +++ b/floss/language/rust/rust_version_database.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + ############################################################################################# # File: rust_version_database.py diff --git a/floss/logging_.py b/floss/logging_.py index 863a228f4..36509e76c 100644 --- a/floss/logging_.py +++ b/floss/logging_.py @@ -1,4 +1,17 @@ -# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved. +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging from enum import Enum diff --git a/floss/main.py b/floss/main.py index b3f821d1d..f428b4e65 100644 --- a/floss/main.py +++ b/floss/main.py @@ -1,5 +1,18 @@ #!/usr/bin/env python -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import sys import codecs diff --git a/floss/render/default.py b/floss/render/default.py index a3d7aa097..9526c3f9b 100644 --- a/floss/render/default.py +++ b/floss/render/default.py @@ -1,4 +1,17 @@ -# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved. +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import io import sys diff --git a/floss/render/json.py b/floss/render/json.py index d95900538..a6474dfdf 100644 --- a/floss/render/json.py +++ b/floss/render/json.py @@ -1,4 +1,17 @@ -# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved. +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import datetime diff --git a/floss/render/sanitize.py b/floss/render/sanitize.py index 584614015..46501ebdf 100644 --- a/floss/render/sanitize.py +++ b/floss/render/sanitize.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import string diff --git a/floss/results.py b/floss/results.py index bd8b90f1a..c56ad4765 100644 --- a/floss/results.py +++ b/floss/results.py @@ -1,4 +1,17 @@ -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re import json diff --git a/floss/stackstrings.py b/floss/stackstrings.py index afe91b7c1..80148f704 100644 --- a/floss/stackstrings.py +++ b/floss/stackstrings.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Set, List, Optional from dataclasses import dataclass diff --git a/floss/string_decoder.py b/floss/string_decoder.py index 6d6534bef..0bd8748c8 100644 --- a/floss/string_decoder.py +++ b/floss/string_decoder.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Set, List from dataclasses import dataclass diff --git a/floss/strings.py b/floss/strings.py index a11836397..1dc1ccc82 100644 --- a/floss/strings.py +++ b/floss/strings.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re from typing import Iterable diff --git a/floss/tightstrings.py b/floss/tightstrings.py index 89260ae0c..199b2e67e 100644 --- a/floss/tightstrings.py +++ b/floss/tightstrings.py @@ -1,4 +1,17 @@ -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Set, List, Tuple, Iterator, Optional diff --git a/floss/utils.py b/floss/utils.py index b5bd6c119..80ee23eea 100644 --- a/floss/utils.py +++ b/floss/utils.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import re import sys diff --git a/floss/version.py b/floss/version.py index 15f4e05c4..c1f87aa91 100644 --- a/floss/version.py +++ b/floss/version.py @@ -1,3 +1,16 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # caution: this file gets overwritten when building using PyInstaller, don't add required data in here without handling __version__ = "3.1.1" diff --git a/pyproject.toml b/pyproject.toml index 7df52f5ac..17063702a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,17 @@ -# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved. +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: [package root]/LICENSE.txt diff --git a/scripts/extract_rust_hashes.py b/scripts/extract_rust_hashes.py index c50ba520b..4c822f0be 100644 --- a/scripts/extract_rust_hashes.py +++ b/scripts/extract_rust_hashes.py @@ -1,5 +1,18 @@ #!/usr/bin/env python3 -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ File name: extract_rust_hashes.py @@ -9,14 +22,6 @@ Usage: $ python3 extract_rust_hashes.py - -Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. -You may obtain a copy of the License at: [package root]/LICENSE.txt -Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. """ import subprocess @@ -55,7 +60,20 @@ # write the hashes to a file header = """ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + ############################################################################################# # File: rust_version_database.py diff --git a/scripts/idaplugin.py b/scripts/idaplugin.py index 6c7bad60c..9f62f1a12 100644 --- a/scripts/idaplugin.py +++ b/scripts/idaplugin.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + #!/usr/bin/env python3 """ diff --git a/scripts/render-binja-import-script.py b/scripts/render-binja-import-script.py index 24ccd83ac..b63dd93e9 100644 --- a/scripts/render-binja-import-script.py +++ b/scripts/render-binja-import-script.py @@ -1,5 +1,17 @@ #!/usr/bin/env python3 -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. """ render-binja-import-script.py @@ -12,14 +24,6 @@ $ floss suspicious.exe -j > floss-results.json $ python render-binja-import-script.py floss-results.json > apply_floss.py # now run `apply_floss.py` in Binary Ninja - -Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. -You may obtain a copy of the License at: [package root]/LICENSE.txt -Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. """ import sys import base64 diff --git a/scripts/render-ghidra-import-script.py b/scripts/render-ghidra-import-script.py index 49cc18959..cb3dcb671 100644 --- a/scripts/render-ghidra-import-script.py +++ b/scripts/render-ghidra-import-script.py @@ -1,5 +1,18 @@ #!/usr/bin/env python3 -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ render-ghidra-import-script.py @@ -12,14 +25,6 @@ $ floss suspicious.exe -j > floss-results.json $ python render-ghidra-import-script.py floss-results.json > apply_floss.py # now run `apply_floss.py` in Ghidra - -Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. -You may obtain a copy of the License at: [package root]/LICENSE.txt -Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. """ import sys import base64 diff --git a/scripts/render-ida-import-script.py b/scripts/render-ida-import-script.py index f2267204e..db4b08f20 100644 --- a/scripts/render-ida-import-script.py +++ b/scripts/render-ida-import-script.py @@ -1,4 +1,25 @@ #!/usr/bin/env python3 +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: [package root]/LICENSE.txt +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and limitations under the License. """ render-ida-import-script.py @@ -11,14 +32,6 @@ $ floss suspicious.exe -j > floss-results.json $ python render-ida-import-script.py floss-results.json > apply_floss.py # now run `apply_floss.py` in IDA - -Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. -You may obtain a copy of the License at: [package root]/LICENSE.txt -Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. """ import sys import base64 diff --git a/scripts/render-r2-import-script.py b/scripts/render-r2-import-script.py index 635d84757..2fa73aded 100644 --- a/scripts/render-r2-import-script.py +++ b/scripts/render-r2-import-script.py @@ -1,5 +1,18 @@ #!/usr/bin/env python3 -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ render-r2-import-script.py @@ -12,14 +25,6 @@ $ floss suspicious.exe -j > floss-results.json $ python render-r2-import-script.py floss-results.json > apply_floss.py # now run `apply_floss.py` in radare2 - -Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. -You may obtain a copy of the License at: [package root]/LICENSE.txt -Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. """ import sys import base64 diff --git a/scripts/render-x64dbg-database.py b/scripts/render-x64dbg-database.py index 6dbbd9c7b..50eb3f0ac 100644 --- a/scripts/render-x64dbg-database.py +++ b/scripts/render-x64dbg-database.py @@ -1,5 +1,18 @@ #!/usr/bin/env python3 -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ render-x64dbg-database.py @@ -11,14 +24,6 @@ $ floss suspicious.exe -j > floss-results.json $ python render-x64dbg-database.py floss-results.json > database.json # open `database.json` in x64dbg - -Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. -You may obtain a copy of the License at: [package root]/LICENSE.txt -Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. """ import sys import json diff --git a/tests/conftest.py b/tests/conftest.py index cfb1fa2c1..08413f9d5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from pathlib import Path diff --git a/tests/fixtures.py b/tests/fixtures.py index b09af4ae7..f7517ccea 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -1,4 +1,17 @@ -# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved. +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from pathlib import Path diff --git a/tests/test_buf_filled_with.py b/tests/test_buf_filled_with.py index 19c21d7c1..7a248d743 100644 --- a/tests/test_buf_filled_with.py +++ b/tests/test_buf_filled_with.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import mmap import tempfile diff --git a/tests/test_cli_args.py b/tests/test_cli_args.py index 8f3317924..17b415aa6 100644 --- a/tests/test_cli_args.py +++ b/tests/test_cli_args.py @@ -1,4 +1,17 @@ -# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved. +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest from fixtures import scfile, exefile diff --git a/tests/test_main.py b/tests/test_main.py index 9cae69c2a..fcc4358ad 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,4 +1,17 @@ -# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved. +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest import fixtures diff --git a/tests/test_memdiff.py b/tests/test_memdiff.py index a86d1f59d..916d7fb78 100644 --- a/tests/test_memdiff.py +++ b/tests/test_memdiff.py @@ -1,4 +1,17 @@ -# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved. +# Copyright 2017 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest import envi.memory diff --git a/tests/test_render.py b/tests/test_render.py index e382127b2..ab9d8ee22 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -1,4 +1,17 @@ -# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved. +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from floss.results import ( Strings, diff --git a/tests/test_scripts.py b/tests/test_scripts.py index 6cfaa72b4..407e39c9a 100644 --- a/tests/test_scripts.py +++ b/tests/test_scripts.py @@ -1,4 +1,17 @@ -# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved. +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: [package root]/LICENSE.txt From 210362b964356cfd4c5ccb4763c3a54116808732 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Wed, 15 Jan 2025 16:53:26 +0100 Subject: [PATCH 2/3] [LICENSE] Correct LICENSE file Replace LICENSE text file with the official Apache one: https://www.apache.org/licenses/LICENSE-2.0.txt This changes `Copyright (C) 2021 Mandiant, Inc.` by the following template language that had been incorrectly replaced: `Copyright [yyyy] [name of copyright owner]` --- LICENSE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 5cd5cef2a..d64569567 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -179,7 +179,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (C) 2017 Mandiant, Inc. + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From bafcecd3e40f7bf42df81ceac8ac2b86674b7631 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Wed, 15 Jan 2025 16:58:04 +0100 Subject: [PATCH 3/3] [CONTRIBUTING] Add CONTRIBUTING file Add CONTRIBUTING file with information about CLA and Google's code of conduct to follow Google conventions/policies. We should add other information to this file in the future to make contributing to the project easier. --- .github/CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 000000000..68b4a5a3c --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing + +Thanks for taking the time to contribute to floss! :sparkling_heart: + +## Before contributing code + +### Sign our Contributor License Agreement + +Contributions to this project must be accompanied by a [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). +You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. + +If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again. + +Visit to see your current agreements or to sign a new one. + +## Review our community guidelines + +This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct).