Skip to content

Commit 3cd97ae

Browse files
Ana06williballenthin
authored andcommitted
[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("capa"): for file_name in file_names: # header are only in `.py` and `.toml` files if file_name[-3:] not in (".py", "oml"): continue 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) ``` Some files had the copyright headers inside a `"""` comment and needed manual changes before applying the script. `hook-vivisect.py` and `pyinstaller.spec` didn't include the license in the header and also needed manual changes. 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 capa consistent with other Google projects. Adapt the linter to work with the new header. Replace also the copyright text in the `web/public/index.html` file for consistency.
1 parent b4aa65d commit 3cd97ae

File tree

196 files changed

+2541
-1225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+2541
-1225
lines changed

.github/flake8.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ per-file-ignores =
4040

4141
copyright-check = True
4242
copyright-min-file-size = 1
43-
copyright-regexp = Copyright \(C\) \d{4} Mandiant, Inc. All Rights Reserved.
43+
copyright-regexp = Copyright \d{4} Google LLC

.github/pyinstaller/hooks/hook-vivisect.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
214

315
from PyInstaller.utils.hooks import copy_metadata
416

.github/pyinstaller/pyinstaller.spec

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# -*- mode: python -*-
2-
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
316
import sys
417

518
import capa.rules.cache

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
### Development
2424

25-
- license: Correct LICENSE file @Ana06
25+
- license & copyright: Correct LICENSE file and improve copyright and license information headers in the source code files @Ana06
2626
- documentation: Improve CLA and Code of Conduct information in CONTRIBUTING @Ana06
2727

2828
### Raw diffs

capa/capabilities/common.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
2+
# Copyright 2023 Google LLC
3+
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at: [package root]/LICENSE.txt
6-
# Unless required by applicable law or agreed to in writing, software distributed under the License
7-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8-
# See the License for the specific language governing permissions and limitations under the License.
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
916
import logging
1017
import itertools
1118
import collections

capa/capabilities/dynamic.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
2+
# Copyright 2023 Google LLC
3+
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at: [package root]/LICENSE.txt
6-
# Unless required by applicable law or agreed to in writing, software distributed under the License
7-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8-
# See the License for the specific language governing permissions and limitations under the License.
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
916
import logging
1017
import itertools
1118
import collections

capa/capabilities/static.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
2+
# Copyright 2023 Google LLC
3+
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at: [package root]/LICENSE.txt
6-
# Unless required by applicable law or agreed to in writing, software distributed under the License
7-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8-
# See the License for the specific language governing permissions and limitations under the License.
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
916
import time
1017
import logging
1118
import itertools

capa/engine.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2020 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
import copy
1017
import collections

capa/exceptions.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2022 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
816
class UnsupportedRuntimeError(RuntimeError):
917
pass
1018

capa/features/address.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2022 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815
import abc
916

1017

capa/features/basicblock.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2020 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
from capa.features.common import Feature
1017

capa/features/com/__init__.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2024 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815
from enum import Enum
916

1017
from capa.helpers import assert_never

capa/features/com/classes.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2024 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
COM_CLASSES: dict[str, list[str]] = {
1017
"ClusAppWiz": ["24F97150-6689-11D1-9AA7-00C04FB93A80"],

capa/features/com/interfaces.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2024 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
COM_INTERFACES: dict[str, list[str]] = {
1017
"IClusterApplicationWizard": ["24F97151-6689-11D1-9AA7-00C04FB93A80"],

capa/features/common.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2021 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
import re
1017
import abc

capa/features/extractors/base_extractor.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2021 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
import abc
1017
import hashlib

capa/features/extractors/binexport2/__init__.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815
"""
916
Proto files generated via protobuf v24.4:
1017

capa/features/extractors/binexport2/arch/arm/helpers.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2024 Google LLC
2+
#
23
# 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.
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
from capa.features.extractors.binexport2.binexport2_pb2 import BinExport2
1017

0 commit comments

Comments
 (0)