Skip to content

Commit 6a23f7d

Browse files
authored
Merge pull request #134 from yaroslav-o/master
Allow python 3.12 and update lief to 0.14.1
2 parents cad6cbf + 09d278a commit 6a23f7d

File tree

5 files changed

+68
-54
lines changed

5 files changed

+68
-54
lines changed

checksec/output.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
from pathlib import Path
55
from typing import List, Union
66

7-
from lief.PE import MACHINE_TYPES
7+
from lief.PE import Header
88
from rich.console import Console
99
from rich.progress import BarColumn, Progress, TextColumn
1010
from rich.table import Table
1111

1212
from checksec.elf import ELFChecksecData, PIEType, RelroType
1313
from checksec.pe import PEChecksecData
1414

15+
MACHINE_TYPES = Header.MACHINE_TYPES
16+
1517

1618
class AbstractChecksecOutput(ABC):
1719
def __init__(self, libc_detected: bool = False):

checksec/pe.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
from pathlib import Path
33

44
import lief
5-
from lief.PE import DLL_CHARACTERISTICS, HEADER_CHARACTERISTICS, MACHINE_TYPES, Signature
5+
from lief.PE import Header, OptionalHeader, Signature
66

77
from .binary import BinarySecurity
88

9+
DLL_CHARACTERISTICS = OptionalHeader.DLL_CHARACTERISTICS
10+
HEADER_CHARACTERISTICS = Header.CHARACTERISTICS
11+
MACHINE_TYPES = Header.MACHINE_TYPES
12+
913
PEChecksecData = namedtuple(
1014
"PEChecksecData",
1115
[
@@ -113,8 +117,10 @@ def has_isolation(self) -> bool:
113117

114118
@property
115119
def checksec_state(self) -> PEChecksecData:
120+
machine: MACHINE_TYPES = self.bin.header.machine
121+
machine_int = machine.value
116122
return PEChecksecData(
117-
machine=self.bin.header.machine,
123+
machine=machine_int,
118124
nx=self.has_nx,
119125
canary=self.has_canary,
120126
aslr=self.is_aslr,

poetry.lock

Lines changed: 53 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ checksec = 'checksec.__main__:entrypoint'
1414

1515
[tool.poetry.dependencies]
1616
python = ">=3.10,<3.13"
17-
lief = "0.13.0"
17+
lief = "0.14.1"
1818
docopt = "0.6.2"
19-
rich = "13.3.5"
20-
pylddwrap = "1.0.1"
19+
rich = "^13.4"
20+
pylddwrap = "^1.0"
2121

2222
[tool.poetry.dev-dependencies]
2323
flake8 = "5.0.4"

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
2-
import subprocess
32
import shutil
3+
import subprocess
44
from pathlib import Path
55
from typing import Dict
66

0 commit comments

Comments
 (0)