harrim4n
2017-11-28 14:17:43 UTC
Hi all,
I'm trying to compile John as a shared object to use in python bindings
for a project I'm working on. I'm using the latest version from
https://github.com/magnumripper/JohnTheRipper/tree/bleeding-jumbo.
However I'm running into some issues doing so, namely the x86-64.S file.
As this file is assembly, I can't simply recompile it with -fPIC.
This causes the following error when trying to create a "libjohn.so" file:
/usr/bin/ld: x86-64.o: relocation R_X86_64_PC32 against symbol
`nt_buffer8x' can not be used when making a shared object; recompile
with -fPIC
However, to me, the assembly already looks to be position independent.
This is also indicated by the comment on line 1769:
/* ...converted to use %rip-relative addressing, still public domain */
Does anyone have pointers as to how I could either modify the assembly
to be PI or any other way I could create python bindings for John?
I am aware that I could rebuild the python interpreter and use static
linking, however I would like to avoid this option because of obvious
maintainability issues. I also tried simply using a statically built lib
in the setup.py file, but then I get
ImportError: /usr/lib/python2.7/site-packages/pyJohn.so: undefined
symbol: fmt_nsec3
Thanks!
harrim4n
I'm trying to compile John as a shared object to use in python bindings
for a project I'm working on. I'm using the latest version from
https://github.com/magnumripper/JohnTheRipper/tree/bleeding-jumbo.
However I'm running into some issues doing so, namely the x86-64.S file.
As this file is assembly, I can't simply recompile it with -fPIC.
This causes the following error when trying to create a "libjohn.so" file:
/usr/bin/ld: x86-64.o: relocation R_X86_64_PC32 against symbol
`nt_buffer8x' can not be used when making a shared object; recompile
with -fPIC
However, to me, the assembly already looks to be position independent.
This is also indicated by the comment on line 1769:
/* ...converted to use %rip-relative addressing, still public domain */
Does anyone have pointers as to how I could either modify the assembly
to be PI or any other way I could create python bindings for John?
I am aware that I could rebuild the python interpreter and use static
linking, however I would like to avoid this option because of obvious
maintainability issues. I also tried simply using a statically built lib
in the setup.py file, but then I get
ImportError: /usr/lib/python2.7/site-packages/pyJohn.so: undefined
symbol: fmt_nsec3
Thanks!
harrim4n