Skip to content

Commit

Permalink
fix complete setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Kyle committed Apr 24, 2024
1 parent 8e4af70 commit 4970ae7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ cd how2heap

# the next command will prepare the target binary so it runs with
# the expected libc version
make
./glibc_run.sh 2.30 ./malloc_playground -d -p

# now you can play with the binary with glibc-2.30
Expand Down
14 changes: 7 additions & 7 deletions glibc_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ function prep_in_docker () {
echo "building the how2heap_docker image!"
docker build -t how2heap_docker .

docker run --rm -it -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make clean >/dev/null
docker run --rm -it -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make >/dev/null
docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make clean >/dev/null
docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make >/dev/null
}

GLIBC_VERSION=$1
Expand Down Expand Up @@ -196,16 +196,16 @@ if [ -z "$(ls -A $OUTPUT_DIR)" ]; then
fi
target_interpreter="$OUTPUT_DIR/$(ls $OUTPUT_DIR | grep ld)"

if [[ $GLIBC_MAJOR != $SYSTEM_GLIBC_MAJOR ]] || [[ $GLIBC_MINOR != $SYSTEM_GLIBC_MINOR ]]; then
set_interpreter $target_interpreter
set_rpath
fi

if [ "$DOCKER" == 'X' ];
then
prep_in_docker $GLIBC_VERSION
fi

if [[ $GLIBC_MAJOR != $SYSTEM_GLIBC_MAJOR ]] || [[ $GLIBC_MINOR != $SYSTEM_GLIBC_MINOR ]]; then
set_interpreter $target_interpreter
set_rpath
fi

if [ "$GDB" == 'X' ];
then
if [[ $GLIBC_VERSION != $SYSTEM_GLIBC_VERSION ]]; then
Expand Down

0 comments on commit 4970ae7

Please sign in to comment.