Skip to content

Commit

Permalink
remove the hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Kyle committed May 1, 2024
1 parent d670a10 commit 385b8b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ endif
then \
$(CC) $(CFLAGS) $(DIR_CFLAGS_$(@D)) $^ -o $@ $(LDLIBS); \
else \
$(CC) $(CFLAGS) $(DIR_CFLAGS_$(@D)) $^ -o $@ $(LDLIBS) -Xlinker -rpath=$$(realpath glibc-all-in-one/libs/$$version*) -Xlinker -I$$(realpath glibc-all-in-one/libs/$$version*/ld-linux-x86-64.so.2) -Xlinker $$(realpath glibc-all-in-one/libs/$$version*/libc.so.6) -Xlinker $$(realpath glibc-all-in-one/libs/$$version*/libdl.so.2) -include ./utils/wrapper.h -Wl,--wrap=__libc_start_main -Wl,--wrap=dlsym; \
$(CC) $(CFLAGS) $(DIR_CFLAGS_$(@D)) $^ -o $@ $(LDLIBS) -Xlinker -rpath=$$(echo glibc-all-in-one/libs/$$version*) -Xlinker -I$$(echo glibc-all-in-one/libs/$$version*/ld-linux-x86-64.so.2) -Xlinker $$(echo glibc-all-in-one/libs/$$version*/libc.so.6) -Xlinker $$(echo glibc-all-in-one/libs/$$version*/libdl.so.2); \
fi

all: $(BINS)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Notice that this will link the binaries with your system libc. If you want to pl
You will encounter symbol versioning issues (see [this](https://github.com/shellphish/how2heap/issues/169)) if you try to `LD_PRELOAD` libcs to a binary that's compiled on your host machine.
We have two ways to bypass it.

### Method 1: use linker magic (Experimental)
This one uses some linker magic to tell the compiler that it needs to link with a libc that may not be the latest.
### Method 1: link against older libc
This one tells linker to link the target binary with the target libc.
```shell
git clone https://github.com/shellphish/how2heap
cd how2heap
Expand Down
29 changes: 0 additions & 29 deletions utils/wrapper.h

This file was deleted.

0 comments on commit 385b8b3

Please sign in to comment.