Skip to content

Commit 2911cf9

Browse files
committed
compiler_archs: Add x86 and x86_64
1 parent f7645f9 commit 2911cf9

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

shellblocks/compiler_archs/x86.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from shellblocks.compiler_archs.x86_64 import CompilerArchX86_64
2+
3+
4+
class CompilerArchX86(CompilerArchX86_64):
5+
def __init__(self):
6+
super().__init__()
7+
8+
def get_gcc_flags(self):
9+
return super().get_gcc_flags() + [
10+
"-m32",
11+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import List
2+
3+
from shellblocks.compiler_archs.gcc import CompilerArchGCC
4+
from shellblocks.utils import sources_location
5+
6+
7+
class CompilerArchX86_64(CompilerArchGCC):
8+
def __init__(self):
9+
super().__init__()
10+
11+
def get_headers(self) -> List[str]:
12+
return ["arch/x86/utils.h"]
13+
14+
def get_ldscript_path(self):
15+
return (sources_location / "shellcode_ldscript.ld").as_posix()
16+
17+
def get_compiler_path(self):
18+
return "x86_64-linux-gnu-gcc-8"

0 commit comments

Comments
 (0)