Skip to content

Commit c6631d0

Browse files
committed
update readme
1 parent 0324877 commit c6631d0

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

README.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,28 @@ Try to inline the whole technique in a single `.c` -- it's a lot easier to learn
6161
```shell
6262
git clone https://github.com/shellphish/how2heap
6363
cd how2heap
64-
make clean all
65-
./glibc_run.sh 2.30 ./malloc_playground -u -r
64+
make clean base
65+
./malloc_playground
6666
```
67-
Notice that it does not work if you compile the target binary (`malloc_playground`) using glibc >= 2.34 and try to run it on glibc < 2.34 because of glibc's symbol versioning. For details, please refer to [this](https://github.com/shellphish/how2heap/issues/169).
67+
Notice that this will link the binaries with your system libc. If you want to play with other libc versions. Please refer to `Complete Setup`.
6868

6969
## Complete Setup
7070

71-
This uses Docker-based approach to prepare the needed environment
71+
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.
72+
We have two ways to bypass it.
73+
74+
### Method 1: use linker magic (Experimental)
75+
This one uses some linker magic to tell the compiler that it needs to link with a libc that may not be the latest.
76+
```shell
77+
git clone https://github.com/shellphish/how2heap
78+
cd how2heap
79+
H2H_USE_SYSTEM_LIBC=N make v2.23
80+
```
81+
This will link all the binaries against corresponding libcs. What's better is that it comes with debug symbols. Now you can play with any libc versions on your host machine.
82+
In this example, it will compile all glibc-2.23 binaries and link them with libc-2.23. You can change the number to play with other libc versions.
83+
84+
### Method 2: use docker
85+
This uses Docker-based approach to complie binaries inside an old ubuntu container so it is runnable with the target libc version.
7286

7387
```shell
7488
git clone https://github.com/shellphish/how2heap

0 commit comments

Comments
 (0)