Skip to content

Commit ba50f84

Browse files
committed
More i386 and -m32 fixes for compiling meterpreter
This should be the last change necessary to compile a 32-bit meterpreter from a 64-bit build host. See rapid7#6268
1 parent bced98a commit ba50f84

File tree

2 files changed

+3
-3
lines changed
  • external/source/meterpreter/source

2 files changed

+3
-3
lines changed

external/source/meterpreter/source/bionic/libc/out/x86/make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for i in $BAD_FILES ; do
1111
rm flood/$i >/dev/null
1212
done
1313

14-
gcc -Wl,--hash-style=sysv -nostdinc -nostdlib -shared -o libbionic.so flood/*.o -lgcc
14+
gcc -Wl,--hash-style=sysv -nostdinc -nostdlib -shared -o libbionic.so flood/*.o -lgcc -march=i386 -m32
1515

1616
[ ! -f libc.so ] && ln -s ${PWD}/libbionic.so libc.so
1717

external/source/meterpreter/source/server/rtld/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ msflinker: $(OBJ)
1717
strip msflinker
1818

1919
msflinker.bin: msflinker elf2bin.c
20-
gcc -o elf2bin elf2bin.c
20+
gcc -march=i386 -m32 -o elf2bin elf2bin.c
2121
./elf2bin msflinker msflinker.bin
2222

2323
libc.h: ../../bionic/compiled/libc.so
@@ -51,7 +51,7 @@ libpcap.h: ../../bionic/compiled/libpcap.so
5151
metsrv_rtld.o: libc.h libm.h libcrypto.h libssl.h libmetsrv_main.h libsupport.h libpcap.h
5252

5353
rtldtest: rtldtest.c msflinker
54-
gcc -o rtldtest rtldtest.c -DEP=`objdump -f msflinker | grep start | awk '{ print $$3 }'`
54+
gcc -march=i386 -m32 -o rtldtest rtldtest.c -DEP=`objdump -f msflinker | grep start | awk '{ print $$3 }'`
5555

5656
.s.o:
5757
gcc $(CFLAGS) -c $<

0 commit comments

Comments
 (0)