Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation with g++ 4.4 on 64bit #1

Open
chaoflow opened this issue Mar 9, 2010 · 4 comments
Open

compilation with g++ 4.4 on 64bit #1

chaoflow opened this issue Mar 9, 2010 · 4 comments

Comments

@chaoflow
Copy link
Contributor

chaoflow commented Mar 9, 2010

Compilation fails for 64bit with g++ 4.4.3. The g++ 4.4.3 part, I fixed with 3 includes in my "fork". However, as far as I can tell the 64bit make bigger trouble (see below). Any chance you could fix that? Any pointers what needs be done?

% make
g++ -g -W -Wall -pipe -O2 -c -o injcode.o injcode.cc
g++ -g -W -Wall -pipe -O2 -c -o inject.o inject.cc
g++ -g -W -Wall -pipe -O2 -c -o retty.o retty.cc
retty.cc:31: warning: unused parameter ‘x’
retty.cc: In constructor ‘Retty::Retty(Inject&)’:
retty.cc:252: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int’
retty.cc:287: warning: dereferencing type-punned pointer will break strict-aliasing rules
retty.cc:295: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘size_t’
g++ -g -W -Wall -pipe -O2 -c -o testmodule.o testmodule.cc
g++ -g -W -Wall -pipe -O2 -c -o closemodule.o closemodule.cc
closemodule.cc: In constructor ‘CloseModule::CloseModule(Inject&)’:
closemodule.cc:38: warning: dereferencing type-punned pointer will break strict-aliasing rules
g++ -g -W -Wall -pipe -O2 -c -o dup2module.o dup2module.cc
dup2module.cc: In constructor ‘Dup2Module::Dup2Module(Inject&)’:
dup2module.cc:68: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -c -o shellcode-test-linux-ia32.o shellcode-test-linux-ia32.S
cc -c -o shellcode-close-linux-ia32.o shellcode-close-linux-ia32.S
cc -c -o shellcode-dup2-linux-ia32.o shellcode-dup2-linux-ia32.S
cc -c -o shellcode-retty-linux-ia32.o shellcode-retty-linux-ia32.S
g++ -g -W -Wall -pipe -O2 -o injcode injcode.o inject.o retty.o testmodule.o closemodule.o dup2module.o shellcode-test-linux-ia32.o shellcode-close-linux-ia32.o shellcode-dup2-linux-ia32.o shellcode-retty-linux-ia32.o -lutil
retty.o: In function Retty': /home/cfl/dev/injcode/retty.cc:289: undefined reference toshellcodeRettyChild'
/home/cfl/dev/injcode/retty.cc:293: undefined reference to shellcodeRettyEnd' /home/cfl/dev/injcode/retty.cc:289: undefined reference toshellcodeRetty'
/home/cfl/dev/injcode/retty.cc:293: undefined reference to shellcodeRetty' /home/cfl/dev/injcode/retty.cc:297: undefined reference toshellcodeRetty'
/home/cfl/dev/injcode/retty.cc:289: undefined reference to shellcodeRettyChild' /home/cfl/dev/injcode/retty.cc:293: undefined reference toshellcodeRettyEnd'
/home/cfl/dev/injcode/retty.cc:289: undefined reference to shellcodeRetty' /home/cfl/dev/injcode/retty.cc:293: undefined reference toshellcodeRetty'
/home/cfl/dev/injcode/retty.cc:297: undefined reference to shellcodeRetty' testmodule.o: In functionTestModule':
/home/cfl/dev/injcode/testmodule.cc:25: undefined reference to shellcodeTestEnd' /home/cfl/dev/injcode/testmodule.cc:25: undefined reference toshellcodeTest'
/home/cfl/dev/injcode/testmodule.cc:25: undefined reference to shellcodeTest' /home/cfl/dev/injcode/testmodule.cc:25: undefined reference toshellcodeTestEnd'
/home/cfl/dev/injcode/testmodule.cc:25: undefined reference to shellcodeTest' /home/cfl/dev/injcode/testmodule.cc:25: undefined reference toshellcodeTest'
closemodule.o: In function CloseModule': /home/cfl/dev/injcode/closemodule.cc:43: undefined reference toshellcodeCloseEnd'
/home/cfl/dev/injcode/closemodule.cc:43: undefined reference to shellcodeClose' /home/cfl/dev/injcode/closemodule.cc:43: undefined reference toshellcodeClose'
/home/cfl/dev/injcode/closemodule.cc:43: undefined reference to shellcodeCloseEnd' /home/cfl/dev/injcode/closemodule.cc:43: undefined reference toshellcodeClose'
/home/cfl/dev/injcode/closemodule.cc:43: undefined reference to shellcodeClose' dup2module.o: In functionDup2Module':
/home/cfl/dev/injcode/dup2module.cc:103: undefined reference to shellcodeDup2End' /home/cfl/dev/injcode/dup2module.cc:103: undefined reference toshellcodeDup2'
/home/cfl/dev/injcode/dup2module.cc:103: undefined reference to shellcodeDup2' /home/cfl/dev/injcode/dup2module.cc:103: undefined reference toshellcodeDup2End'
/home/cfl/dev/injcode/dup2module.cc:103: undefined reference to shellcodeDup2' /home/cfl/dev/injcode/dup2module.cc:103: undefined reference toshellcodeDup2'
collect2: ld returned 1 exit status
make: *** [injcode] Error 1

@chaoflow
Copy link
Contributor Author

chaoflow commented Mar 9, 2010

% g++ -v

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.4.3 (GCC)

@ThomasHabets
Copy link
Owner

64bit payload not written yet. Only works with 32bit at the moment.

@mesuutt
Copy link

mesuutt commented Apr 16, 2014

I want to use injcode too but I am using 64bit :(

@MInner
Copy link

MInner commented Sep 27, 2021

Too bad, I also wanted to run it on 64 bit system. Could you please mention it in README?

ThomasHabets added a commit that referenced this issue Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants