37 Commits

Author SHA1 Message Date
Ana Maria Martinez Gomez
3cd97ae9f2 [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.
2025-01-15 08:52:42 -07:00
N0stalgikow
0eb4291b25 Updating copyright across all files based on when it was first introduced. (#2027)
* updating copyright, back to the date of origin of file

* updating regex to account for linter violation
2024-03-13 14:04:53 +01:00
Willi Ballenthin
b9090b86ce tests: make fixtures available via conftest.py
closes #1592
2023-07-13 09:37:39 +02:00
Willi Ballenthin
c86ab51210 fix copyright headers everywhere 2023-07-13 05:03:33 +02:00
Willi Ballenthin
a43d2c115f tests: fix fixture imports 2023-07-06 19:04:53 +02:00
Willi Ballenthin
47074fd129 fix ruff issues 2023-07-06 17:49:40 +02:00
Yacine Elhamer
64ef2c8a65 add tests for vivisect's usage of debug symbols 2023-06-01 01:50:06 +01:00
Harsh Mehta
74009eb4a4 Updated Copyright (#1383)
* Updated Copyright
2023-03-14 17:58:43 +01:00
Willi Ballenthin
9e579f9de3 tests: viv: reenable elf tests
revert 56f9e16a8b

viv is reverted to v1.0.3 so tests should pass again ref $735
2021-08-26 16:50:57 -06:00
William Ballenthin
56f9e16a8b tests: viv: disable ELF tests due to #735 2021-08-23 17:51:28 -06:00
William Ballenthin
ac59e50b5f move capa/features/__init__.py logic to common.py
also cleanup imports across the board,
thanks to pylance.
2021-06-09 22:20:53 -06:00
Ana Maria Martinez Gomez
bbb7878e0a Enable tests for vivisect in Python3
Now we support vivisect as backend in Python3. We should test it.
2021-03-03 17:36:50 +01:00
Moritz Raabe
34e7991081 black 20.8b1 updates 2020-08-27 11:26:28 +02:00
William Ballenthin
295d3fee5d tests: limit tests to py2/py3 2020-08-16 05:03:57 -06:00
William Ballenthin
26c9811ba1 tests: viv: fix typo preventing some tests from running 2020-08-14 12:22:39 -06:00
William Ballenthin
b784f086b4 tests: make fixtures more consistent in prep for other backends 2020-08-14 12:04:53 -06:00
William Ballenthin
8cbe3f8546 tests: move expected features into fixtures for reuse
closes #225
2020-08-14 11:25:00 -06:00
Ana María Martínez Gómez
adaac03d1d extractor: remove characteristic(switch)
Get rid of the `characteristic(switch)` feature as any of our rules use
it and its analysis is not very easy. Analysis results most likely
differ across backends, leading to inconsistency.
2020-08-13 16:47:01 +02:00
Michael Hunhoff
70b4546c33 adding test for unmapped immediate data reference 2020-08-11 14:13:43 -06:00
William Ballenthin
e4acfd4852 merge 2020-08-04 09:48:26 -06:00
William Ballenthin
f02412bcc5 tests: fix function address 2020-08-03 19:10:05 -06:00
William Ballenthin
b09f29a996 features: viv: extract strings/bytes from nested pointers
closes #200
2020-08-03 17:35:29 -06:00
William Ballenthin
b81b5e5993 rules: add support for arch flavors of Number and Offset features
closes #210
2020-08-03 16:28:47 -06:00
William Ballenthin
c91f9a375e ida: parse offsets as signed numbers
closes #197
2020-07-25 00:58:44 -06:00
William Ballenthin
baeea5b6ec *: update license header to reference Apache 2.0
closes #173
2020-07-22 15:05:24 -06:00
Ana María Martínez Gómez
07764fb31f Use isort 5
Run `isort --profile black --length-sort --line-width 120 .`

Update documentation as well.
2020-07-16 22:02:53 +02:00
William Ballenthin
3faf175da7 *: add license header
closes #144
2020-07-15 14:14:53 -06:00
Michael Hunhoff
f09e683ef5 removing stale imports 2020-07-03 12:24:17 -06:00
William Ballenthin
1188103d1c pep8: isort 2020-07-02 10:52:05 -06:00
William Ballenthin
c185e9ef09 pep8: black 2020-07-02 10:32:26 -06:00
William Ballenthin
db2b1caeae Merge branch 'master' into fmt-black 2020-07-02 10:25:24 -06:00
Ana María Martínez Gómez
64124c0b64 Remove True from Characteristic rules and output
Get rid of `True` in characteristic (rules, output and json) as it is
implicit. This way, the same syntax is used for characteristic as for
the rest of the features.

Co-authored-by: William Ballenthin <william.ballenthin@fireeye.com>
2020-07-02 16:50:15 +02:00
William Ballenthin
d23ef48bb6 pep8 2020-07-01 12:33:13 -06:00
Willi Ballenthin
53f374024b Merge branch 'master' into doc/code-review-improvements 2020-06-24 08:22:52 -06:00
Moritz Raabe
beba3fb3c7 double to single quotes 2020-06-24 15:00:35 +02:00
Moritz Raabe
d2d1f26e7b update documentation 2020-06-24 12:55:35 +02:00
William Ballenthin
add3537447 import source files, forgetting about 938 prior commits 2020-06-18 09:13:19 -06:00