diff --git a/docs/contributing/writing-tests.md b/docs/contributing/writing-tests.md index 82b9ad8ba..cddb5688c 100644 --- a/docs/contributing/writing-tests.md +++ b/docs/contributing/writing-tests.md @@ -62,7 +62,7 @@ import gdb import pwndbg import tests -BINARY = tests.get_binary("symbol_1600_and_752.out") +BINARY = tests.get_binary("symbol_1600_and_752.native.out") ``` Since these tests run inside GDB, we can import the `gdb` Python library. We also import the `tests` module, diff --git a/tests/binaries/host/crash_simple.asm.nocompile b/tests/binaries/host/crash_simple.asm.nocompile deleted file mode 100644 index c3abd8a7b..000000000 --- a/tests/binaries/host/crash_simple.asm.nocompile +++ /dev/null @@ -1,7 +0,0 @@ -global _start - -; This binary is there for tests that need a binary that crashes -; and is as simple as possible - -_start: -mov dword [eax], 0 diff --git a/tests/binaries/host/crash_simple.native.c b/tests/binaries/host/crash_simple.native.c new file mode 100644 index 000000000..12e025da1 --- /dev/null +++ b/tests/binaries/host/crash_simple.native.c @@ -0,0 +1,40 @@ + +__attribute__((naked)) +void _start(void) { +#if defined(__x86_64__) + // x86_64: guaranteed illegal instruction + __asm__("ud2"); +#elif defined(__i386__) + // x86 (i386): guaranteed illegal instruction + __asm__("ud2"); +#elif defined(__aarch64__) + // AArch64: undefined instruction + __asm__("udf #0"); +#elif defined(__arm__) + // ARM32 (A32): UDF undefined instruction + __asm__(".word 0xE7F000F0"); +#elif defined(__riscv) || defined(__riscv__) + // RISC-V: opcode=0 is not a valid instruction (illegal) + __asm__(".word 0x00000000"); +#elif defined(__powerpc64__) || defined(__ppc64__) + // PowerPC64: reserved/illegal instruction + __asm__(".long 0x00000000"); +#elif defined(__powerpc__) || defined(__ppc__) + // PowerPC32: reserved/illegal instruction + __asm__(".long 0x00000000"); +#elif defined(__mips__) && (__mips == 64) + // MIPS64: reserved/illegal instruction + __asm__(".word 0x00000000"); +#elif defined(__mips__) + // MIPS32: reserved/illegal instruction + __asm__(".word 0x00000000"); +#elif defined(__loongarch__) || defined(__loongarch64__) + // LoongArch64: guaranteed illegal instruction + __asm__(".word 0x002a0000"); +#elif defined(__s390x__) + // IBM Z (s390x): illegal instruction + __asm__(".long 0x00000000"); +#else + #error "Unsupported architecture: no illegal instruction defined" +#endif +} \ No newline at end of file diff --git a/tests/binaries/host/crash_simple.out.hardcoded b/tests/binaries/host/crash_simple.out.hardcoded deleted file mode 100755 index b4addb107..000000000 Binary files a/tests/binaries/host/crash_simple.out.hardcoded and /dev/null differ diff --git a/tests/binaries/host/div_zero.c b/tests/binaries/host/div_zero.native.c similarity index 100% rename from tests/binaries/host/div_zero.c rename to tests/binaries/host/div_zero.native.c diff --git a/tests/binaries/host/gosample.go b/tests/binaries/host/gosample.native.go similarity index 100% rename from tests/binaries/host/gosample.go rename to tests/binaries/host/gosample.native.go diff --git a/tests/binaries/host/heap_bins.c b/tests/binaries/host/heap_bins.native.c similarity index 100% rename from tests/binaries/host/heap_bins.c rename to tests/binaries/host/heap_bins.native.c diff --git a/tests/binaries/host/heap_find_fake_fast.c b/tests/binaries/host/heap_find_fake_fast.native.c similarity index 100% rename from tests/binaries/host/heap_find_fake_fast.c rename to tests/binaries/host/heap_find_fake_fast.native.c diff --git a/tests/binaries/host/heap_jemalloc_extent_info.c b/tests/binaries/host/heap_jemalloc_extent_info.native.c similarity index 100% rename from tests/binaries/host/heap_jemalloc_extent_info.c rename to tests/binaries/host/heap_jemalloc_extent_info.native.c diff --git a/tests/binaries/host/heap_jemalloc_heap.c b/tests/binaries/host/heap_jemalloc_heap.native.c similarity index 100% rename from tests/binaries/host/heap_jemalloc_heap.c rename to tests/binaries/host/heap_jemalloc_heap.native.c diff --git a/tests/binaries/host/heap_malloc_chunk.c b/tests/binaries/host/heap_malloc_chunk.native.c similarity index 100% rename from tests/binaries/host/heap_malloc_chunk.c rename to tests/binaries/host/heap_malloc_chunk.native.c diff --git a/tests/binaries/host/heap_malloc_chunk_dump.c b/tests/binaries/host/heap_malloc_chunk_dump.native.c similarity index 100% rename from tests/binaries/host/heap_malloc_chunk_dump.c rename to tests/binaries/host/heap_malloc_chunk_dump.native.c diff --git a/tests/binaries/host/heap_musl.c b/tests/binaries/host/heap_musl.native.c similarity index 100% rename from tests/binaries/host/heap_musl.c rename to tests/binaries/host/heap_musl.native.c diff --git a/tests/binaries/host/heap_vis.c b/tests/binaries/host/heap_vis.native.c similarity index 100% rename from tests/binaries/host/heap_vis.c rename to tests/binaries/host/heap_vis.native.c diff --git a/tests/binaries/host/initialized_heap.c b/tests/binaries/host/initialized_heap.native.c similarity index 100% rename from tests/binaries/host/initialized_heap.c rename to tests/binaries/host/initialized_heap.native.c diff --git a/tests/binaries/host/issue_1565.c b/tests/binaries/host/issue_1565.native.c similarity index 100% rename from tests/binaries/host/issue_1565.c rename to tests/binaries/host/issue_1565.native.c diff --git a/tests/binaries/host/linked-lists.c b/tests/binaries/host/linked-lists.native.c similarity index 100% rename from tests/binaries/host/linked-lists.c rename to tests/binaries/host/linked-lists.native.c diff --git a/tests/binaries/host/makefile b/tests/binaries/host/makefile index 63c52eff1..cd403dbd0 100644 --- a/tests/binaries/host/makefile +++ b/tests/binaries/host/makefile @@ -1,19 +1,30 @@ +HOST_ARCH := $(shell uname -m) +HOST_ARCH_32 := empty + +ifeq ($(HOST_ARCH),x86_64) + HOST_ARCH = x86-64 + HOST_ARCH_32 := i386 +else ifeq ($(HOST_ARCH),i686) + HOST_ARCH := i386 +endif + ZIGCC = uv run python3 -m ziglang cc CC = gcc +CXX = g++ MUSLCC = musl-gcc DEBUG = 1 CFLAGS += -Wall -SOURCES_C = $(wildcard *.c) +SOURCES_C = $(wildcard *.native.c) $(wildcard *.$(HOST_ARCH).c) $(wildcard *.$(HOST_ARCH_32).c) LINKED_C = $(SOURCES_C:.c=.out) NASM = nasm -f elf64 LD = ld -SOURCES_ASM = $(wildcard *.asm) +SOURCES_ASM = $(wildcard *.$(HOST_ARCH).asm) $(wildcard *.$(HOST_ARCH_32).asm) LINKED_ASM = $(SOURCES_ASM:.asm=.out) LDFLAGS = GO = go -SOURCES_GO = $(wildcard *.go) +SOURCES_GO = $(wildcard *.native.go) $(wildcard *.$(HOST_ARCH).go) $(wildcard *.$(HOST_ARCH_32).go) LINKED_GO = $(SOURCES_GO:.go=.out) ifeq ($(TARGET), x86) @@ -36,8 +47,10 @@ GLIBC_2_33=$(PWD)/glibcs/2.33 .PHONY : all clean -CUSTOM_TARGETS = reference_bin_pie.out reference_bin_nopie.out reference_bin_nopie.i386.out symbol_1600_and_752.out initialized_heap.x86-64.out initialized_heap_big.i386.out linked_lists.out onegadget.x86-64.out onegadget.i386.out heap_jemalloc_extent_info.out heap_jemalloc_heap.out heap_musl_dyn.out heap_musl_static.out gosample.i386.out gosample.x86-64.out -ALL_TARGETS := $(LINKED_C) $(LINKED_ASM) $(LINKED_GO) $(CUSTOM_TARGETS) +CUSTOM_TARGETS = reference_bin_pie.native.out reference_bin_nopie.native.out reference_bin_nopie.i386.out symbol_1600_and_752.native.out initialized_heap.x86-64.out initialized_heap_big.i386.out linked_lists.native.out onegadget.x86-64.out onegadget.i386.out heap_jemalloc_extent_info.native.out heap_jemalloc_heap.native.out heap_musl_dyn.native.out heap_musl_static.native.out gosample.i386.out gosample.x86-64.out +NATIVE_CUSTOM_TARGETS := $(filter %.native.out %.$(HOST_ARCH).out %.$(HOST_ARCH_32).out,$(CUSTOM_TARGETS)) + +ALL_TARGETS := $(LINKED_C) $(LINKED_ASM) $(LINKED_GO) $(NATIVE_CUSTOM_TARGETS) all: $(ALL_TARGETS) @@ -46,7 +59,7 @@ all: $(ALL_TARGETS) @$(CC) $(CFLAGS) -w -o $@ $? $(LDFLAGS) %.out : %.asm - @echo "[+] Building and linking '$@'" + @echo "[+] Building '$@'" @$(NASM) -o $@.o $? @$(LD) -Ttext 0x400080 --section-start .note.gnu.property=0x8000000 -o $@ $@.o @@ -55,155 +68,159 @@ all: $(ALL_TARGETS) @$(GO) build -gcflags "-N -l" -o $@ $? @# Not stripped on purpose -gosample.i386.out : gosample.go - @echo "[+] Building gosample.i386.out" +crash_simple.native.out: crash_simple.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -O0 -nostdlib -ffreestanding -fno-stack-protector -fno-sanitize=all -o $@ $? + +gosample.i386.out : gosample.native.go + @echo "[+] Building '$@'" @GOARCH=386 $(GO) build -gcflags "-N -l" -o $@ $? @# Not stripped on purpose -gosample.x86-64.out : gosample.go - @echo "[+] Building gosample.x86-64.out" +gosample.x86-64.out : gosample.native.go + @echo "[+] Building '$@'" @GOARCH=amd64 $(GO) build -gcflags "-N -l" -o $@ $? @# Not stripped on purpose heap_bugs.x86-64.out: heap_bugs.x86-64.c - @echo "[+] Building heap_bugs.x86-64.out" + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -Wno-int-to-pointer-cast -Wno-int-conversion -Wno-unused-variable \ -target x86_64-linux-gnu.2.33 \ -Wl,-rpath=${GLIBC_2_33}:\ -Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \ - -o heap_bugs.x86-64.out heap_bugs.x86-64.c + -o $@ $? # TODO/FIXME: We should probably force this to 2.29? a version with tcache? #heap_bins.out: heap_bins.c -# @echo "[+] Building heap_bins.out" +# @echo "[+] Building '$@'" # ${ZIGCC} \ # -target x86_64-linux-gnu.2.33 \ # -Wl,-rpath=${GLIBC_2_33} \ # -Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \ -# -g -O0 -o heap_bins.out heap_bins.c +# -g -O0 -o $@ $? # Note: we use -pthread -lpthread because we hit this bug on CI builds: # https://sourceware.org/bugzilla/show_bug.cgi?id=24548 -heap_vis.out: heap_vis.c - @echo "[+] Building heap_vis.out" - ${CC} -g -O0 -Wno-nonnull -o heap_vis.out heap_vis.c -pthread -lpthread - -heap_malloc_chunk.out: heap_malloc_chunk.c - @echo "[+] Building heap_malloc_chunk.out" - ${CC} -g -O0 -Wno-nonnull -Wno-unused-result -o heap_malloc_chunk.out heap_malloc_chunk.c -pthread -lpthread - -heap_jemalloc_extent_info.out: heap_jemalloc_extent_info.c - @echo "[+] Building heap_jemalloc_extent_info.out" - ${CC} -g -O0 -Wno-nonnull -Wno-unused-result \ - -o heap_jemalloc_extent_info.out heap_jemalloc_extent_info.c \ +heap_vis.native.out: heap_vis.native.c + @echo "[+] Building '$@'" + ${CC} -g -O0 -Wno-nonnull -o $@ $? -pthread -lpthread + +heap_malloc_chunk.native.out: heap_malloc_chunk.native.c + @echo "[+] Building '$@'" + ${CC} -g -O0 -Wno-nonnull -Wno-unused-result -o $@ $? -pthread -lpthread + +heap_jemalloc_extent_info.native.out: heap_jemalloc_extent_info.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -g -O0 -Wno-nonnull -Wno-unused-result \ + -o $@ $? \ -Wl,-Bstatic -ljemalloc -Wl,-Bdynamic -lpthread -lm -lstdc++ -pthread -ldl -heap_jemalloc_heap.out: heap_jemalloc_heap.c - @echo "[+] Building heap_jemalloc_heap.out" - ${CC} -g -O0 -Wno-nonnull -Wno-unused-result \ - -o heap_jemalloc_heap.out heap_jemalloc_heap.c \ +heap_jemalloc_heap.native.out: heap_jemalloc_heap.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -g -O0 -Wno-nonnull -Wno-unused-result \ + -o $@ $? \ -Wl,-Bstatic -ljemalloc -Wl,-Bdynamic -lpthread -lm -lstdc++ -pthread -ldl -heap_musl_dyn.out: heap_musl.c - @echo "[+] Building heap_musl_dyn.out" - ${MUSLCC} -g3 -O0 heap_musl.c -o heap_musl_dyn.out +heap_musl_dyn.native.out: heap_musl.native.c + @echo "[+] Building '$@'" + ${MUSLCC} -g3 -O0 -o $@ $? # Ideally I would do: # strip heap_musl_static.out # here because it would ensure mallocng commands are tested on # a musl with no symbols. But that also makes it very hard to # write the tests. -heap_musl_static.out: heap_musl.c - @echo "[+] Building heap_musl_static.out" - ${MUSLCC} -g3 -O0 -static heap_musl.c -o heap_musl_static.out +heap_musl_static.native.out: heap_musl.native.c + @echo "[+] Building '$@'" + ${MUSLCC} -g3 -O0 -static -o $@ $? -multiple_threads.out: multiple_threads.c - @echo "[+] Building multiple_threads.out" - ${CC} -g -O0 -o multiple_threads.out multiple_threads.c -pthread -lpthread +multiple_threads.native.out: multiple_threads.native.c + @echo "[+] Building '$@'" + ${CC} -g -O0 -o $@ $? -pthread -lpthread tls.x86-64.out: tls.x86-64.c - @echo "[+] Building tls.x86-64.c" + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86_64-linux-gnu \ - -o tls.x86-64.out tls.x86-64.c + -o $@ $? tls.i386.out: tls.i386.c - @echo "[+] Building tls.i386.c" + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86-linux-gnu \ - -o tls.i386.out tls.i386.c + -o $@ $? -issue_1565.out: issue_1565.c - @echo "[+] Building issue_1565.out" - ${CC} -g -O0 -o issue_1565.out issue_1565.c -pthread -lpthread +issue_1565.native.out: issue_1565.native.c + @echo "[+] Building '$@'" + ${CC} -g -O0 -o $@ $? -pthread -lpthread # TODO: Link against a specific GLIBC version >= 2.26 -initialized_heap_big.i386.out: initialized_heap.c - @echo "[+] Building initialized_heap_big.i386.out" +initialized_heap_big.i386.out: initialized_heap.native.c + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86-linux-gnu \ - -o initialized_heap_big.i386.out initialized_heap.c + -o $@ $? # TODO: Link against a specific GLIBC version. -initialized_heap.x86-64.out: initialized_heap.c - @echo "[+] Building initialized_heap.x86-64.out" +initialized_heap.x86-64.out: initialized_heap.native.c + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86_64-linux-gnu \ - -o initialized_heap.x86-64.out initialized_heap.c + -o $@ $? -onegadget.x86-64.out: onegadget.c - @echo "[+] Building onegadget.x86-64.out" +onegadget.x86-64.out: onegadget.native.c + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86_64-linux-gnu \ - -o onegadget.x86-64.out onegadget.c + -o $@ $? -onegadget.i386.out: onegadget.c - @echo "[+] Building onegadget.i386.out" +onegadget.i386.out: onegadget.native.c + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86-linux-gnu \ - -o onegadget.i386.out onegadget.c + -o $@ $? clean : @echo "[+] Cleaning stuff" @rm -f $(LINKED_C) $(LINKED_ASM) $(LINKED_GO) *.out *.o -linked_lists.out: linked-lists.c - @echo "[+] Building $<" - ${ZIGCC} -fpie -g -o $@ $< +linked_lists.native.out: linked-lists.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -fpie -g -o $@ $? -reference_bin_pie.out: reference-binary.c - @echo "[+] Building reference_bin_pie.out" - ${ZIGCC} -fpie -o reference_bin_pie.out reference-binary.c +reference_bin_pie.native.out: reference-binary.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -fpie -o $@ $? -reference_bin_nopie.out: reference-binary.c - @echo "[+] Building reference_bin_nopie.out" - ${ZIGCC} -fno-pie -o reference_bin_nopie.out reference-binary.c +reference_bin_nopie.native.out: reference-binary.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -fno-pie -o $@ $? -reference_bin_nopie.i386.out: reference-binary.c - @echo "[+] Building reference_bin_nopie.i386.out" - ${ZIGCC} -fno-pie -target x86-linux-gnu -o reference_bin_nopie.i386.out reference-binary.c +reference_bin_nopie.i386.out: reference-binary.native.c + @echo "[+] Building '$@'" + ${ZIGCC} -fno-pie -target x86-linux-gnu -o $@ $? -symbol_1600_and_752.out: symbol_1600_and_752.cpp - ${CXX} -O0 -ggdb -Wno-pmf-conversions symbol_1600_and_752.cpp -o symbol_1600_and_752.out +symbol_1600_and_752.native.out: symbol_1600_and_752.native.cpp + ${CXX} -O0 -ggdb -Wno-pmf-conversions -o $@ $? canary.x86-64.out: canary.x86-64.c - @echo "[+] Building canary.x86-64.out" + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86_64-linux-gnu \ - -o canary.x86-64.out canary.x86-64.c + -o $@ $? canary.i386.out: canary.i386.c - @echo "[+] Building canary.i386.out" + @echo "[+] Building '$@'" ${ZIGCC} \ ${CFLAGS} \ -target x86-linux-gnu \ - -o canary.i386.out canary.i386.c + -o $@ $? diff --git a/tests/binaries/host/mmap_gaps.c b/tests/binaries/host/mmap_gaps.native.c similarity index 100% rename from tests/binaries/host/mmap_gaps.c rename to tests/binaries/host/mmap_gaps.native.c diff --git a/tests/binaries/host/multiple_threads.c b/tests/binaries/host/multiple_threads.native.c similarity index 100% rename from tests/binaries/host/multiple_threads.c rename to tests/binaries/host/multiple_threads.native.c diff --git a/tests/binaries/host/nested_structs.c b/tests/binaries/host/nested_structs.native.c similarity index 100% rename from tests/binaries/host/nested_structs.c rename to tests/binaries/host/nested_structs.native.c diff --git a/tests/binaries/host/onegadget.c b/tests/binaries/host/onegadget.native.c similarity index 100% rename from tests/binaries/host/onegadget.c rename to tests/binaries/host/onegadget.native.c diff --git a/tests/binaries/host/reference-binary-net.c b/tests/binaries/host/reference-binary-net.native.c similarity index 100% rename from tests/binaries/host/reference-binary-net.c rename to tests/binaries/host/reference-binary-net.native.c diff --git a/tests/binaries/host/reference-binary.c b/tests/binaries/host/reference-binary.native.c similarity index 100% rename from tests/binaries/host/reference-binary.c rename to tests/binaries/host/reference-binary.native.c diff --git a/tests/binaries/host/search_memory.c b/tests/binaries/host/search_memory.native.c similarity index 100% rename from tests/binaries/host/search_memory.c rename to tests/binaries/host/search_memory.native.c diff --git a/tests/binaries/host/symbol_1600_and_752.cpp b/tests/binaries/host/symbol_1600_and_752.native.cpp similarity index 100% rename from tests/binaries/host/symbol_1600_and_752.cpp rename to tests/binaries/host/symbol_1600_and_752.native.cpp diff --git a/tests/binaries/host/tabstop.c b/tests/binaries/host/tabstop.native.c similarity index 100% rename from tests/binaries/host/tabstop.c rename to tests/binaries/host/tabstop.native.c diff --git a/tests/binaries/host/telescope_binary.c b/tests/binaries/host/telescope_binary.native.c similarity index 100% rename from tests/binaries/host/telescope_binary.c rename to tests/binaries/host/telescope_binary.native.c diff --git a/tests/binaries/host/use-fds.c b/tests/binaries/host/use-fds.native.c similarity index 100% rename from tests/binaries/host/use-fds.c rename to tests/binaries/host/use-fds.native.c diff --git a/tests/binaries/host/very_long_symbols.c b/tests/binaries/host/very_long_symbols.native.c similarity index 100% rename from tests/binaries/host/very_long_symbols.c rename to tests/binaries/host/very_long_symbols.native.c diff --git a/tests/host/gdb/pytests_launcher.py b/tests/host/gdb/pytests_launcher.py index a5ebdcc9b..6c2eabf91 100644 --- a/tests/host/gdb/pytests_launcher.py +++ b/tests/host/gdb/pytests_launcher.py @@ -26,6 +26,9 @@ class _GDBController(host.Controller): GDB hides the asynchronous heavy lifting from us, so this call is synchronous. """ + if not os.path.exists(binary_path): + pytest.skip(f"{os.path.basename(binary_path)} does not exist. Platform not supported.") + os.environ["PWNDBG_IN_TEST"] = "1" gdb.execute(f"file {binary_path}") gdb.execute("set exception-verbose on") diff --git a/tests/host/lldb/launch_guest.py b/tests/host/lldb/launch_guest.py index aeefda713..bf18181c3 100644 --- a/tests/host/lldb/launch_guest.py +++ b/tests/host/lldb/launch_guest.py @@ -11,6 +11,8 @@ from typing import Coroutine from typing import Dict from typing import List +import pytest + async def _run(ctrl: Any, outer: Callable[..., Coroutine[Any, Any, None]]) -> None: # We only import this here, as pwndbg-lldb is responsible for setting Pwndbg @@ -30,6 +32,9 @@ async def _run(ctrl: Any, outer: Callable[..., Coroutine[Any, Any, None]]) -> No async def launch( self, binary: Path, args: List[str] = [], env: Dict[str, str] = {} ) -> None: + if not os.path.exists(binary): + pytest.skip(f"{os.path.basename(binary)} does not exist. Platform not supported.") + await self.pc.execute("set context-reserve-lines never") await self.pc.execute(f"target create {binary}") env_args = " ".join((f"-E{k}={v}" for k, v in env.items())) diff --git a/tests/library/dbg/tests/heap/test_find_fake_fast.py b/tests/library/dbg/tests/heap/test_find_fake_fast.py index 9bcf81e80..618486278 100644 --- a/tests/library/dbg/tests/heap/test_find_fake_fast.py +++ b/tests/library/dbg/tests/heap/test_find_fake_fast.py @@ -7,7 +7,7 @@ from .. import get_binary from .. import launch_to from .. import pwndbg_test -HEAP_FIND_FAKE_FAST = get_binary("heap_find_fake_fast.out") +HEAP_FIND_FAKE_FAST = get_binary("heap_find_fake_fast.native.out") target_address = None diff --git a/tests/library/dbg/tests/heap/test_heap.py b/tests/library/dbg/tests/heap/test_heap.py index 2ac5ded8f..9f3a77a63 100644 --- a/tests/library/dbg/tests/heap/test_heap.py +++ b/tests/library/dbg/tests/heap/test_heap.py @@ -11,8 +11,8 @@ from .. import get_binary from .. import launch_to from .. import pwndbg_test -HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.out") -HEAP_MALLOC_CHUNK_DUMP = get_binary("heap_malloc_chunk_dump.out") +HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.native.out") +HEAP_MALLOC_CHUNK_DUMP = get_binary("heap_malloc_chunk_dump.native.out") def generate_expected_malloc_chunk_output(chunks: Dict[str, ...]) -> Dict[str, ...]: @@ -559,8 +559,8 @@ async def test_heuristic_fail_gracefully(ctrl: Controller, is_multi_threaded: bo ## # Jemalloc Tests ## -HEAP_JEMALLOC_EXTENT_INFO = get_binary("heap_jemalloc_extent_info.out") -HEAP_JEMALLOC_HEAP = get_binary("heap_jemalloc_heap.out") +HEAP_JEMALLOC_EXTENT_INFO = get_binary("heap_jemalloc_extent_info.native.out") +HEAP_JEMALLOC_HEAP = get_binary("heap_jemalloc_heap.native.out") re_match_valid_address = r"0x7ffff[0-9a-fA-F]{6,9}" diff --git a/tests/library/dbg/tests/heap/test_heap_bins.py b/tests/library/dbg/tests/heap/test_heap_bins.py index eb43878b4..d07ed15bb 100644 --- a/tests/library/dbg/tests/heap/test_heap_bins.py +++ b/tests/library/dbg/tests/heap/test_heap_bins.py @@ -5,7 +5,7 @@ from .. import get_binary from .. import launch_to from .. import pwndbg_test -BINARY = get_binary("heap_bins.out") +BINARY = get_binary("heap_bins.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/heap/test_vis_heap_chunks.py b/tests/library/dbg/tests/heap/test_vis_heap_chunks.py index 83431ff14..a93eeff53 100644 --- a/tests/library/dbg/tests/heap/test_vis_heap_chunks.py +++ b/tests/library/dbg/tests/heap/test_vis_heap_chunks.py @@ -5,7 +5,7 @@ from .. import get_binary from .. import launch_to from .. import pwndbg_test -HEAP_VIS = get_binary("heap_vis.out") +HEAP_VIS = get_binary("heap_vis.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_cache.py b/tests/library/dbg/tests/test_cache.py index 94925437c..fd51e807b 100644 --- a/tests/library/dbg/tests/test_cache.py +++ b/tests/library/dbg/tests/test_cache.py @@ -4,7 +4,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -BINARY = get_binary("reference-binary.out") +BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_callstack.py b/tests/library/dbg/tests/test_callstack.py index e565fdc20..de313cc95 100644 --- a/tests/library/dbg/tests/test_callstack.py +++ b/tests/library/dbg/tests/test_callstack.py @@ -5,7 +5,7 @@ from . import get_binary from . import launch_to from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_config.py b/tests/library/dbg/tests/test_command_config.py index 74503b9c0..1bbfcd4d6 100644 --- a/tests/library/dbg/tests/test_command_config.py +++ b/tests/library/dbg/tests/test_command_config.py @@ -5,7 +5,7 @@ import re from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_cyclic.py b/tests/library/dbg/tests/test_command_cyclic.py index b7e20a003..991c9c857 100644 --- a/tests/library/dbg/tests/test_command_cyclic.py +++ b/tests/library/dbg/tests/test_command_cyclic.py @@ -3,7 +3,7 @@ from __future__ import annotations from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_distance.py b/tests/library/dbg/tests/test_command_distance.py index e5885cac0..c3b9aceb4 100644 --- a/tests/library/dbg/tests/test_command_distance.py +++ b/tests/library/dbg/tests/test_command_distance.py @@ -4,7 +4,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_dt.py b/tests/library/dbg/tests/test_command_dt.py index 5c7a7a0b0..d00d781e1 100644 --- a/tests/library/dbg/tests/test_command_dt.py +++ b/tests/library/dbg/tests/test_command_dt.py @@ -7,7 +7,7 @@ from . import get_binary from . import launch_to from . import pwndbg_test -HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.out") +HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_errno.py b/tests/library/dbg/tests/test_command_errno.py index 4ccfa93b4..4d7762e43 100644 --- a/tests/library/dbg/tests/test_command_errno.py +++ b/tests/library/dbg/tests/test_command_errno.py @@ -6,7 +6,7 @@ from . import get_binary from . import pwndbg_test # We use the heap_vis binary as it enforces pthreads and so will have TLS on all distros -REFERENCE_BINARY = get_binary("heap_vis.out") +REFERENCE_BINARY = get_binary("heap_vis.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_flags.py b/tests/library/dbg/tests/test_command_flags.py index 1ec70e6e2..e16e10143 100644 --- a/tests/library/dbg/tests/test_command_flags.py +++ b/tests/library/dbg/tests/test_command_flags.py @@ -4,7 +4,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_libcinfo.py b/tests/library/dbg/tests/test_command_libcinfo.py index 54d1ab818..5e0e1cb3c 100644 --- a/tests/library/dbg/tests/test_command_libcinfo.py +++ b/tests/library/dbg/tests/test_command_libcinfo.py @@ -5,7 +5,7 @@ from . import break_at_sym from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_plist.py b/tests/library/dbg/tests/test_command_plist.py index 0fe923dfd..87569bc25 100644 --- a/tests/library/dbg/tests/test_command_plist.py +++ b/tests/library/dbg/tests/test_command_plist.py @@ -7,7 +7,7 @@ from . import get_binary from . import get_expr from . import pwndbg_test -LINKED_LISTS_BINARY = get_binary("linked-lists.out") +LINKED_LISTS_BINARY = get_binary("linked-lists.native.out") async def startup(ctrl: Controller): diff --git a/tests/library/dbg/tests/test_command_procinfo.py b/tests/library/dbg/tests/test_command_procinfo.py index 2ee527bb7..99fb0d0d5 100644 --- a/tests/library/dbg/tests/test_command_procinfo.py +++ b/tests/library/dbg/tests/test_command_procinfo.py @@ -11,7 +11,7 @@ from . import break_at_sym from . import get_binary from . import pwndbg_test -REFERENCE_BINARY_NET = get_binary("reference-binary-net.out") +REFERENCE_BINARY_NET = get_binary("reference-binary-net.native.out") class TCPServerThread(threading.Thread): diff --git a/tests/library/dbg/tests/test_command_search.py b/tests/library/dbg/tests/test_command_search.py index 16652ef4d..4f1e70441 100644 --- a/tests/library/dbg/tests/test_command_search.py +++ b/tests/library/dbg/tests/test_command_search.py @@ -7,7 +7,7 @@ from . import get_binary from . import launch_to from . import pwndbg_test -SEARCH_BINARY = get_binary("search_memory.out") +SEARCH_BINARY = get_binary("search_memory.native.out") SEARCH_PATTERN = 0xD00DBEEF SEARCH_PATTERN2 = 0xABCDEF1234567890 diff --git a/tests/library/dbg/tests/test_command_telescope.py b/tests/library/dbg/tests/test_command_telescope.py index 7caf844e2..3d04c61d5 100644 --- a/tests/library/dbg/tests/test_command_telescope.py +++ b/tests/library/dbg/tests/test_command_telescope.py @@ -8,7 +8,7 @@ from . import get_expr from . import launch_to from . import pwndbg_test -TELESCOPE_BINARY = get_binary("telescope_binary.out") +TELESCOPE_BINARY = get_binary("telescope_binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_command_xor.py b/tests/library/dbg/tests/test_command_xor.py index 3f90934dd..c03212578 100644 --- a/tests/library/dbg/tests/test_command_xor.py +++ b/tests/library/dbg/tests/test_command_xor.py @@ -4,7 +4,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_commands_dumpargs.py b/tests/library/dbg/tests/test_commands_dumpargs.py index b1c0ba345..62ec16f74 100644 --- a/tests/library/dbg/tests/test_commands_dumpargs.py +++ b/tests/library/dbg/tests/test_commands_dumpargs.py @@ -5,7 +5,7 @@ from . import break_at_sym from . import get_binary from . import pwndbg_test -MMAP_GAPS_BINARY = get_binary("mmap_gaps.out") +MMAP_GAPS_BINARY = get_binary("mmap_gaps.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_commands_elf.py b/tests/library/dbg/tests/test_commands_elf.py index 5252cadbc..80c8fdb09 100644 --- a/tests/library/dbg/tests/test_commands_elf.py +++ b/tests/library/dbg/tests/test_commands_elf.py @@ -9,8 +9,8 @@ from . import get_binary from . import pwndbg_test NO_SECTS_BINARY = get_binary("gosample.i386.out") -PIE_BINARY_WITH_PLT = "reference_bin_pie.out" -NOPIE_BINARY_WITH_PLT = "reference_bin_nopie.out" +PIE_BINARY_WITH_PLT = "reference_bin_pie.native.out" +NOPIE_BINARY_WITH_PLT = "reference_bin_nopie.native.out" NOPIE_I386_BINARY_WITH_PLT = "reference_bin_nopie.i386.out" diff --git a/tests/library/dbg/tests/test_commands_next.py b/tests/library/dbg/tests/test_commands_next.py index d4ba090e6..ffb6de697 100644 --- a/tests/library/dbg/tests/test_commands_next.py +++ b/tests/library/dbg/tests/test_commands_next.py @@ -8,8 +8,8 @@ from . import get_binary from . import launch_to from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") -CRASH_SIMPLE_BINARY = get_binary("crash_simple.out.hardcoded") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +CRASH_SIMPLE_BINARY = get_binary("crash_simple.native.out") NEXT_COMMANDS = ( "pc", diff --git a/tests/library/dbg/tests/test_context_commands.py b/tests/library/dbg/tests/test_context_commands.py index 0ee953593..85b1bac10 100644 --- a/tests/library/dbg/tests/test_context_commands.py +++ b/tests/library/dbg/tests/test_context_commands.py @@ -10,11 +10,11 @@ from . import get_binary from . import launch_to from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") -USE_FDS_BINARY = get_binary("use-fds.out") -TABSTOP_BINARY = get_binary("tabstop.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +USE_FDS_BINARY = get_binary("use-fds.native.out") +TABSTOP_BINARY = get_binary("tabstop.native.out") SYSCALLS_BINARY = get_binary("syscalls.x86-64.out") -MANGLING_BINARY = get_binary("symbol_1600_and_752.out") +MANGLING_BINARY = get_binary("symbol_1600_and_752.native.out") @pwndbg_test @@ -75,7 +75,7 @@ async def test_context_disasm_show_fd_filepath(ctrl: Controller) -> None: line_call_read, line_fd, line_buf, line_nbytes, *_rest = lines_after_call_read line_fd = line_fd.strip() - assert re.match(r"fd:\s+3 \([a-z/]*pwndbg/tests/binaries/host/use-fds.out\)", line_fd) + assert re.match(r"fd:\s+3 \([a-z/]*pwndbg/tests/binaries/host/use-fds.native.out\)", line_fd) line_buf = line_buf.strip() assert re.match(r"buf:\s+0x[0-9a-f]+ ◂— 0", line_buf) @@ -112,7 +112,7 @@ async def test_source_code_tabstop(ctrl: Controller) -> None: await ctrl.launch(TABSTOP_BINARY) # Run until line 6 - await ctrl.execute("b tabstop.c:6") + await ctrl.execute("b tabstop.native.c:6") await ctrl.cont() # Default context-code-tabstop = 8 diff --git a/tests/library/dbg/tests/test_go.py b/tests/library/dbg/tests/test_go.py index 4f2f7d8f7..a933a33fa 100644 --- a/tests/library/dbg/tests/test_go.py +++ b/tests/library/dbg/tests/test_go.py @@ -13,7 +13,7 @@ GOSAMPLE_X86 = get_binary("gosample.i386.out") async def helper_test_dump(ctrl: Controller, target: str) -> None: await ctrl.launch(target, env={"GOMAXPROCS": "1"}) - await ctrl.execute("b gosample.go:6") + await ctrl.execute("b gosample.native.go:6") await ctrl.cont() dump = await ctrl.execute_and_capture("go-dump any &x") diff --git a/tests/library/dbg/tests/test_hexdump.py b/tests/library/dbg/tests/test_hexdump.py index 0992c526a..7bfa0d9da 100644 --- a/tests/library/dbg/tests/test_hexdump.py +++ b/tests/library/dbg/tests/test_hexdump.py @@ -6,7 +6,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -BINARY = get_binary("reference-binary.out") +BINARY = get_binary("reference-binary.native.out") async def run_tests(ctrl: Controller, stack: int, use_big_endian: bool, expected: str) -> None: diff --git a/tests/library/dbg/tests/test_mallocng.py b/tests/library/dbg/tests/test_mallocng.py index b121a480e..9ed03f278 100644 --- a/tests/library/dbg/tests/test_mallocng.py +++ b/tests/library/dbg/tests/test_mallocng.py @@ -11,8 +11,8 @@ from . import get_binary from . import launch_to from . import pwndbg_test -HEAP_MALLOCNG_DYN = get_binary("heap_musl_dyn.out") -HEAP_MALLOCNG_STATIC = get_binary("heap_musl_static.out") +HEAP_MALLOCNG_DYN = get_binary("heap_musl_dyn.native.out") +HEAP_MALLOCNG_STATIC = get_binary("heap_musl_static.native.out") # Userland only re_addr = r"0x[0-9a-fA-F]{1,12}" diff --git a/tests/library/dbg/tests/test_memory.py b/tests/library/dbg/tests/test_memory.py index 3c249105d..5f8581254 100644 --- a/tests/library/dbg/tests/test_memory.py +++ b/tests/library/dbg/tests/test_memory.py @@ -5,8 +5,8 @@ from . import get_binary from . import launch_to from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") -NESTED_STRUCTS_BINARY = get_binary("nested_structs.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +NESTED_STRUCTS_BINARY = get_binary("nested_structs.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_mmap.py b/tests/library/dbg/tests/test_mmap.py index 06e1da1a0..c533e8105 100644 --- a/tests/library/dbg/tests/test_mmap.py +++ b/tests/library/dbg/tests/test_mmap.py @@ -4,7 +4,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -USE_FDS_BINARY = get_binary("use-fds.out") +USE_FDS_BINARY = get_binary("use-fds.native.out") @pwndbg_test @@ -65,7 +65,7 @@ async def test_mmap_executes_properly(ctrl: Controller) -> None: assert ptr == base_addr # Continue the program until just before close(2) is called. - await ctrl.execute("b use-fds.c:16") + await ctrl.execute("b use-fds.native.c:16") await ctrl.cont() # Retrieve the file descriptor number and map it to memory. diff --git a/tests/library/dbg/tests/test_mprotect.py b/tests/library/dbg/tests/test_mprotect.py index ac4536537..dcf05a5b9 100644 --- a/tests/library/dbg/tests/test_mprotect.py +++ b/tests/library/dbg/tests/test_mprotect.py @@ -4,7 +4,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -SMALL_BINARY = get_binary("crash_simple.out.hardcoded") +SMALL_BINARY = get_binary("crash_simple.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_symbol.py b/tests/library/dbg/tests/test_symbol.py index d66debec4..c1f0232fe 100644 --- a/tests/library/dbg/tests/test_symbol.py +++ b/tests/library/dbg/tests/test_symbol.py @@ -5,7 +5,7 @@ from . import break_at_sym from . import get_binary from . import pwndbg_test -MANGLING_BINARY = get_binary("symbol_1600_and_752.out") +MANGLING_BINARY = get_binary("symbol_1600_and_752.native.out") @pwndbg_test diff --git a/tests/library/dbg/tests/test_triggers.py b/tests/library/dbg/tests/test_triggers.py index 8b50e2781..d84980efc 100644 --- a/tests/library/dbg/tests/test_triggers.py +++ b/tests/library/dbg/tests/test_triggers.py @@ -7,7 +7,7 @@ from ....host import Controller from . import get_binary from . import pwndbg_test -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") async def set_param(ctrl: Controller, param_name: str, value: Any): diff --git a/tests/library/gdb/tests/heap/test_find_fake_fast.py b/tests/library/gdb/tests/heap/test_find_fake_fast.py index a2bce5c8e..94a06ebb1 100644 --- a/tests/library/gdb/tests/heap/test_find_fake_fast.py +++ b/tests/library/gdb/tests/heap/test_find_fake_fast.py @@ -12,7 +12,7 @@ import pwndbg.dbg from .. import get_binary -HEAP_FIND_FAKE_FAST = get_binary("heap_find_fake_fast.out") +HEAP_FIND_FAKE_FAST = get_binary("heap_find_fake_fast.native.out") target_address = None diff --git a/tests/library/gdb/tests/heap/test_heap.py b/tests/library/gdb/tests/heap/test_heap.py index 492995de5..9455eabb6 100644 --- a/tests/library/gdb/tests/heap/test_heap.py +++ b/tests/library/gdb/tests/heap/test_heap.py @@ -14,8 +14,8 @@ from pwndbg.aglib.heap.ptmalloc import SymbolUnresolvableError from .. import get_binary -HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.out") -HEAP_MALLOC_CHUNK_DUMP = get_binary("heap_malloc_chunk_dump.out") +HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.native.out") +HEAP_MALLOC_CHUNK_DUMP = get_binary("heap_malloc_chunk_dump.native.out") def generate_expected_malloc_chunk_output(chunks): @@ -510,8 +510,8 @@ def test_heuristic_fail_gracefully(start_binary, is_multi_threaded): ## # Jemalloc Tests ## -HEAP_JEMALLOC_EXTENT_INFO = get_binary("heap_jemalloc_extent_info.out") -HEAP_JEMALLOC_HEAP = get_binary("heap_jemalloc_heap.out") +HEAP_JEMALLOC_EXTENT_INFO = get_binary("heap_jemalloc_extent_info.native.out") +HEAP_JEMALLOC_HEAP = get_binary("heap_jemalloc_heap.native.out") # Relax address regex to accept different virtual address layouts (ASLR / jemalloc mappings). # Old pattern assumed addresses starting with 0x7ffff and a limited digit count which fails on some hosts. re_match_valid_address = r"0x[0-9a-fA-F]{6,16}" diff --git a/tests/library/gdb/tests/heap/test_heap_bins.py b/tests/library/gdb/tests/heap/test_heap_bins.py index d0ad08ca3..6d5d68f1a 100644 --- a/tests/library/gdb/tests/heap/test_heap_bins.py +++ b/tests/library/gdb/tests/heap/test_heap_bins.py @@ -12,7 +12,7 @@ from pwndbg.aglib.heap.ptmalloc import BinType from .. import get_binary -BINARY = get_binary("heap_bins.out") +BINARY = get_binary("heap_bins.native.out") def test_heap_bins(start_binary): diff --git a/tests/library/gdb/tests/heap/test_vis_heap_chunks.py b/tests/library/gdb/tests/heap/test_vis_heap_chunks.py index 0400c6f91..dd3f51dd1 100644 --- a/tests/library/gdb/tests/heap/test_vis_heap_chunks.py +++ b/tests/library/gdb/tests/heap/test_vis_heap_chunks.py @@ -8,7 +8,7 @@ import pwndbg.aglib.vmmap from .. import get_binary -HEAP_VIS = get_binary("heap_vis.out") +HEAP_VIS = get_binary("heap_vis.native.out") def test_vis_heap_chunk_command(start_binary): diff --git a/tests/library/gdb/tests/test_cache.py b/tests/library/gdb/tests/test_cache.py index b398adf92..a96a69fdf 100644 --- a/tests/library/gdb/tests/test_cache.py +++ b/tests/library/gdb/tests/test_cache.py @@ -6,7 +6,7 @@ from pwndbg.lib import cache from . import get_binary -BINARY = get_binary("reference-binary.out") +BINARY = get_binary("reference-binary.native.out") def test_cache_single_value(start_binary): diff --git a/tests/library/gdb/tests/test_callstack.py b/tests/library/gdb/tests/test_callstack.py index 5f56cc3ff..df0948ff1 100644 --- a/tests/library/gdb/tests/test_callstack.py +++ b/tests/library/gdb/tests/test_callstack.py @@ -7,7 +7,7 @@ import pwndbg.aglib.stack from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_callstack_readable(start_binary): diff --git a/tests/library/gdb/tests/test_command_cyclic.py b/tests/library/gdb/tests/test_command_cyclic.py index 9923af0b6..1d6c39ea2 100644 --- a/tests/library/gdb/tests/test_command_cyclic.py +++ b/tests/library/gdb/tests/test_command_cyclic.py @@ -9,7 +9,7 @@ import pwndbg.aglib.regs from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_command_cyclic_value(start_binary): diff --git a/tests/library/gdb/tests/test_command_distance.py b/tests/library/gdb/tests/test_command_distance.py index e072a79ad..200d35932 100644 --- a/tests/library/gdb/tests/test_command_distance.py +++ b/tests/library/gdb/tests/test_command_distance.py @@ -6,7 +6,7 @@ import pwndbg.aglib.regs from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_command_distance(start_binary): diff --git a/tests/library/gdb/tests/test_command_dt.py b/tests/library/gdb/tests/test_command_dt.py index 3eff3a42d..66582051a 100644 --- a/tests/library/gdb/tests/test_command_dt.py +++ b/tests/library/gdb/tests/test_command_dt.py @@ -6,7 +6,7 @@ import gdb from . import get_binary -HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.out") +HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.native.out") def test_command_dt_works_with_address(start_binary): diff --git a/tests/library/gdb/tests/test_command_errno.py b/tests/library/gdb/tests/test_command_errno.py index e5fc2d562..a92d04a79 100644 --- a/tests/library/gdb/tests/test_command_errno.py +++ b/tests/library/gdb/tests/test_command_errno.py @@ -5,7 +5,7 @@ import gdb from . import get_binary # We use the heap_vis binary as it enforces pthreads and so will have TLS on all distros -REFERENCE_BINARY = get_binary("heap_vis.out") +REFERENCE_BINARY = get_binary("heap_vis.native.out") def test_command_errno(start_binary): diff --git a/tests/library/gdb/tests/test_command_flags.py b/tests/library/gdb/tests/test_command_flags.py index 3cf17d949..b676bee7f 100644 --- a/tests/library/gdb/tests/test_command_flags.py +++ b/tests/library/gdb/tests/test_command_flags.py @@ -6,7 +6,7 @@ import pwndbg.aglib.regs from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_flags_command(start_binary): diff --git a/tests/library/gdb/tests/test_command_hijack_fd.py b/tests/library/gdb/tests/test_command_hijack_fd.py index e950c89a5..12bc2dea3 100644 --- a/tests/library/gdb/tests/test_command_hijack_fd.py +++ b/tests/library/gdb/tests/test_command_hijack_fd.py @@ -11,8 +11,8 @@ import pytest from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") -USE_FDS_BINARY = get_binary("use-fds.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +USE_FDS_BINARY = get_binary("use-fds.native.out") class TCPServerThread(threading.Thread): diff --git a/tests/library/gdb/tests/test_command_ignore.py b/tests/library/gdb/tests/test_command_ignore.py index e515c4227..e8e4c9ff8 100644 --- a/tests/library/gdb/tests/test_command_ignore.py +++ b/tests/library/gdb/tests/test_command_ignore.py @@ -6,7 +6,7 @@ import pwndbg.aglib.proc from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_command_ignore_no_breakpoint_set(): diff --git a/tests/library/gdb/tests/test_command_killthreads.py b/tests/library/gdb/tests/test_command_killthreads.py index 6365134ab..958767230 100644 --- a/tests/library/gdb/tests/test_command_killthreads.py +++ b/tests/library/gdb/tests/test_command_killthreads.py @@ -8,7 +8,7 @@ import pwndbg.dbg from . import get_binary -REFERENCE_BINARY_THREADS = get_binary("multiple_threads.out") +REFERENCE_BINARY_THREADS = get_binary("multiple_threads.native.out") def wait_until(predicate: callable, timeout: int = 10): diff --git a/tests/library/gdb/tests/test_command_libcinfo.py b/tests/library/gdb/tests/test_command_libcinfo.py index 4da831eeb..5f95608c3 100644 --- a/tests/library/gdb/tests/test_command_libcinfo.py +++ b/tests/library/gdb/tests/test_command_libcinfo.py @@ -4,7 +4,7 @@ import gdb from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_command_libcinfo(start_binary): diff --git a/tests/library/gdb/tests/test_command_plist.py b/tests/library/gdb/tests/test_command_plist.py index f5029e73b..37a7cd912 100644 --- a/tests/library/gdb/tests/test_command_plist.py +++ b/tests/library/gdb/tests/test_command_plist.py @@ -6,7 +6,7 @@ import gdb from . import get_binary -LINKED_LISTS_BINARY = get_binary("linked-lists.out") +LINKED_LISTS_BINARY = get_binary("linked-lists.native.out") def startup(start_binary) -> None: diff --git a/tests/library/gdb/tests/test_command_procinfo.py b/tests/library/gdb/tests/test_command_procinfo.py index d2dbe9aef..5cac45c3b 100644 --- a/tests/library/gdb/tests/test_command_procinfo.py +++ b/tests/library/gdb/tests/test_command_procinfo.py @@ -11,7 +11,7 @@ import pwndbg.aglib.proc from . import get_binary -REFERENCE_BINARY_NET = get_binary("reference-binary-net.out") +REFERENCE_BINARY_NET = get_binary("reference-binary-net.native.out") class TCPServerThread(threading.Thread): diff --git a/tests/library/gdb/tests/test_command_search.py b/tests/library/gdb/tests/test_command_search.py index f7dbb2d24..651a8e72b 100644 --- a/tests/library/gdb/tests/test_command_search.py +++ b/tests/library/gdb/tests/test_command_search.py @@ -6,7 +6,7 @@ import gdb from . import get_binary -SEARCH_BINARY = get_binary("search_memory.out") +SEARCH_BINARY = get_binary("search_memory.native.out") SEARCH_PATTERN = 0xD00DBEEF SEARCH_PATTERN2 = 0xABCDEF1234567890 diff --git a/tests/library/gdb/tests/test_command_telescope.py b/tests/library/gdb/tests/test_command_telescope.py index 104e6b636..07df27237 100644 --- a/tests/library/gdb/tests/test_command_telescope.py +++ b/tests/library/gdb/tests/test_command_telescope.py @@ -11,7 +11,7 @@ import pwndbg.aglib.vmmap from . import get_binary -TELESCOPE_BINARY = get_binary("telescope_binary.out") +TELESCOPE_BINARY = get_binary("telescope_binary.native.out") def test_command_telescope(start_binary): diff --git a/tests/library/gdb/tests/test_command_vmmap.py b/tests/library/gdb/tests/test_command_vmmap.py index 36433e3c3..eaf1b029b 100644 --- a/tests/library/gdb/tests/test_command_vmmap.py +++ b/tests/library/gdb/tests/test_command_vmmap.py @@ -9,9 +9,9 @@ import pwndbg.aglib.proc from . import get_binary -GAPS_MAP_BINARY = get_binary("mmap_gaps.out") -CRASH_SIMPLE_BINARY = get_binary("crash_simple.out.hardcoded") -BINARY_ISSUE_1565 = get_binary("issue_1565.out") +GAPS_MAP_BINARY = get_binary("mmap_gaps.native.out") +CRASH_SIMPLE_BINARY = get_binary("crash_simple.native.out") +BINARY_ISSUE_1565 = get_binary("issue_1565.native.out") def get_proc_maps(): diff --git a/tests/library/gdb/tests/test_command_xor.py b/tests/library/gdb/tests/test_command_xor.py index d68c1712f..77fdfc974 100644 --- a/tests/library/gdb/tests/test_command_xor.py +++ b/tests/library/gdb/tests/test_command_xor.py @@ -8,7 +8,7 @@ from pwndbg.commands.xor import memfrob from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_command_xor_with_gdb_execute(start_binary): diff --git a/tests/library/gdb/tests/test_commands.py b/tests/library/gdb/tests/test_commands.py index 98cd4d292..a3e476bed 100644 --- a/tests/library/gdb/tests/test_commands.py +++ b/tests/library/gdb/tests/test_commands.py @@ -9,7 +9,7 @@ from pwndbg.commands import command_names from . import get_binary -BINARY = get_binary("heap_bins.out") +BINARY = get_binary("heap_bins.native.out") # TODO: See if we can reduce the number of commands we need to skip disallowed_commands = { diff --git a/tests/library/gdb/tests/test_commands_dumpargs.py b/tests/library/gdb/tests/test_commands_dumpargs.py index e2dba4060..0478b08a0 100644 --- a/tests/library/gdb/tests/test_commands_dumpargs.py +++ b/tests/library/gdb/tests/test_commands_dumpargs.py @@ -4,7 +4,7 @@ import gdb from . import get_binary -MMAP_GAPS_BINARY = get_binary("mmap_gaps.out") +MMAP_GAPS_BINARY = get_binary("mmap_gaps.native.out") def test_dump_mmap_args(start_binary): diff --git a/tests/library/gdb/tests/test_commands_elf.py b/tests/library/gdb/tests/test_commands_elf.py index 275df3a2f..3f4c30a99 100644 --- a/tests/library/gdb/tests/test_commands_elf.py +++ b/tests/library/gdb/tests/test_commands_elf.py @@ -9,8 +9,8 @@ import pytest from . import get_binary NO_SECTS_BINARY = get_binary("gosample.i386.out") -PIE_BINARY_WITH_PLT = "reference_bin_pie.out" -NOPIE_BINARY_WITH_PLT = "reference_bin_nopie.out" +PIE_BINARY_WITH_PLT = "reference_bin_pie.native.out" +NOPIE_BINARY_WITH_PLT = "reference_bin_nopie.native.out" NOPIE_I386_BINARY_WITH_PLT = "reference_bin_nopie.i386.out" diff --git a/tests/library/gdb/tests/test_commands_next.py b/tests/library/gdb/tests/test_commands_next.py index b0b1407f2..52d213df8 100644 --- a/tests/library/gdb/tests/test_commands_next.py +++ b/tests/library/gdb/tests/test_commands_next.py @@ -9,8 +9,8 @@ import pwndbg.aglib.vmmap from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") -CRASH_SIMPLE_BINARY = get_binary("crash_simple.out.hardcoded") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +CRASH_SIMPLE_BINARY = get_binary("crash_simple.native.out") NEXT_COMMANDS = ( "pc", diff --git a/tests/library/gdb/tests/test_context_commands.py b/tests/library/gdb/tests/test_context_commands.py index 32a3b01fe..f57ff66a1 100644 --- a/tests/library/gdb/tests/test_context_commands.py +++ b/tests/library/gdb/tests/test_context_commands.py @@ -13,11 +13,11 @@ import pwndbg.commands.context from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") -USE_FDS_BINARY = get_binary("use-fds.out") -TABSTOP_BINARY = get_binary("tabstop.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +USE_FDS_BINARY = get_binary("use-fds.native.out") +TABSTOP_BINARY = get_binary("tabstop.native.out") SYSCALLS_BINARY = get_binary("syscalls.x86-64.out") -MANGLING_BINARY = get_binary("symbol_1600_and_752.out") +MANGLING_BINARY = get_binary("symbol_1600_and_752.native.out") def test_context_disasm_show_fd_filepath(start_binary): @@ -71,7 +71,7 @@ def test_context_disasm_show_fd_filepath(start_binary): line_call_read, line_fd, line_buf, line_nbytes, *_rest = lines_after_call_read line_fd = line_fd.strip() - assert re.match(r"fd:\s+3 \([a-z/]*pwndbg/tests/binaries/host/use-fds.out\)", line_fd) + assert re.match(r"fd:\s+3 \([a-z/]*pwndbg/tests/binaries/host/use-fds.native.out\)", line_fd) line_buf = line_buf.strip() assert re.match(r"buf:\s+0x[0-9a-f]+ ◂— 0", line_buf) @@ -104,7 +104,7 @@ def test_source_code_tabstop(start_binary): start_binary(TABSTOP_BINARY) # Run until line 6 - gdb.execute("break tabstop.c:6") + gdb.execute("break tabstop.native.c:6") gdb.execute("continue") # Default context-code-tabstop = 8 diff --git a/tests/library/gdb/tests/test_cymbol.py b/tests/library/gdb/tests/test_cymbol.py index 315628261..46fdbab11 100644 --- a/tests/library/gdb/tests/test_cymbol.py +++ b/tests/library/gdb/tests/test_cymbol.py @@ -10,7 +10,7 @@ if pwndbg.dbg.is_gdblib_available(): from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") # Might be useful for future expansion of the test case diff --git a/tests/library/gdb/tests/test_function_base.py b/tests/library/gdb/tests/test_function_base.py index ade92e99f..6e4628211 100644 --- a/tests/library/gdb/tests/test_function_base.py +++ b/tests/library/gdb/tests/test_function_base.py @@ -4,7 +4,7 @@ import gdb from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") def test_function_base(start_binary): diff --git a/tests/library/gdb/tests/test_glibc.py b/tests/library/gdb/tests/test_glibc.py index 4c4d6358e..06bd2fc38 100644 --- a/tests/library/gdb/tests/test_glibc.py +++ b/tests/library/gdb/tests/test_glibc.py @@ -12,7 +12,7 @@ import pwndbg.glibc from . import get_binary # We used the same binary as heap tests since it will use libc, and many functions are mainly for debugging the heap -HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.out") +HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.native.out") @pytest.mark.parametrize( diff --git a/tests/library/gdb/tests/test_go.py b/tests/library/gdb/tests/test_go.py index 9bf4ec2dd..a43a1c534 100644 --- a/tests/library/gdb/tests/test_go.py +++ b/tests/library/gdb/tests/test_go.py @@ -33,7 +33,7 @@ def test_typeinfo_go_x86(): def helper_test_dump(start_binary, filename): gdb.execute("set environment GOMAXPROCS=1") start_binary(filename) - gdb.execute("break gosample.go:6", to_string=True) + gdb.execute("break gosample.native.go:6", to_string=True) gdb.execute("continue") dump = gdb.execute("go-dump any &x", to_string=True) diff --git a/tests/library/gdb/tests/test_hexdump.py b/tests/library/gdb/tests/test_hexdump.py index bb0c4d3a5..b21c6de47 100644 --- a/tests/library/gdb/tests/test_hexdump.py +++ b/tests/library/gdb/tests/test_hexdump.py @@ -11,7 +11,7 @@ import pwndbg.aglib.vmmap from . import get_binary -BINARY = get_binary("reference-binary.out") +BINARY = get_binary("reference-binary.native.out") def run_tests(stack, use_big_endian, expected): diff --git a/tests/library/gdb/tests/test_loads.py b/tests/library/gdb/tests/test_loads.py index 9920a10b4..43a41a41a 100644 --- a/tests/library/gdb/tests/test_loads.py +++ b/tests/library/gdb/tests/test_loads.py @@ -14,7 +14,7 @@ HELLO = [ " Type help function to see them.", ] -BINARY = get_binary("div_zero.out") +BINARY = get_binary("div_zero.native.out") CORE = "/tmp/pwndbg-tests-div-zero-core" diff --git a/tests/library/gdb/tests/test_memory.py b/tests/library/gdb/tests/test_memory.py index 5d0f52212..0f3a9a203 100644 --- a/tests/library/gdb/tests/test_memory.py +++ b/tests/library/gdb/tests/test_memory.py @@ -9,8 +9,8 @@ import pwndbg.dbg from . import get_binary -REFERENCE_BINARY = get_binary("reference-binary.out") -NESTED_STRUCTS_BINARY = get_binary("nested_structs.out") +REFERENCE_BINARY = get_binary("reference-binary.native.out") +NESTED_STRUCTS_BINARY = get_binary("nested_structs.native.out") def test_memory_read_write(start_binary): diff --git a/tests/library/gdb/tests/test_mmap.py b/tests/library/gdb/tests/test_mmap.py index 1ae36fda7..34f363953 100644 --- a/tests/library/gdb/tests/test_mmap.py +++ b/tests/library/gdb/tests/test_mmap.py @@ -9,7 +9,7 @@ import pwndbg.lib.memory from . import get_binary -USE_FDS_BINARY = get_binary("use-fds.out") +USE_FDS_BINARY = get_binary("use-fds.native.out") def test_mmap_executes_properly(start_binary): @@ -64,7 +64,7 @@ def test_mmap_executes_properly(start_binary): assert ptr == base_addr # Continue the program until just before close(2) is called. - gdb.execute("break use-fds.c:16") + gdb.execute("break use-fds.native.c:16") gdb.execute("continue") # Retrieve the file descriptor number and map it to memory. diff --git a/tests/library/gdb/tests/test_mprotect.py b/tests/library/gdb/tests/test_mprotect.py index c0f0b08a4..78530f57d 100644 --- a/tests/library/gdb/tests/test_mprotect.py +++ b/tests/library/gdb/tests/test_mprotect.py @@ -7,7 +7,7 @@ import pwndbg.aglib.vmmap from . import get_binary -SMALL_BINARY = get_binary("crash_simple.out.hardcoded") +SMALL_BINARY = get_binary("crash_simple.native.out") def test_mprotect_executes_properly(start_binary): diff --git a/tests/library/gdb/tests/test_prompt_recolor.py b/tests/library/gdb/tests/test_prompt_recolor.py index 037665200..51e22bed0 100644 --- a/tests/library/gdb/tests/test_prompt_recolor.py +++ b/tests/library/gdb/tests/test_prompt_recolor.py @@ -6,7 +6,7 @@ import pwndbg.color.message from . import get_binary -BINARY = get_binary("reference-binary.out") +BINARY = get_binary("reference-binary.native.out") def prepare_prompt(is_proc_alive): diff --git a/tests/library/gdb/tests/test_symbol.py b/tests/library/gdb/tests/test_symbol.py index 50b09bc61..ab3e3bc2e 100644 --- a/tests/library/gdb/tests/test_symbol.py +++ b/tests/library/gdb/tests/test_symbol.py @@ -6,7 +6,7 @@ import pwndbg.dbg from . import get_binary -MANGLING_BINARY = get_binary("symbol_1600_and_752.out") +MANGLING_BINARY = get_binary("symbol_1600_and_752.native.out") def test_symbol_get(start_binary):