Modify Binary Without Causing Segmentation Fault

262 views Asked by At

I am new to patching binaries, but I would really like to get a package working on my system. I am trying to modify a binary package to fix an old link. The binary is trying to find the symbol _ZN4Glib23spawn_command_line_syncERKSsPSsS2_Pi however the glibmm library was changed and so trying to run this program fails with a symbol lookup error. Looking through the glibmm library I found what appears to be the new symbol _ZN4Glib23spawn_command_line_syncERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS5_S8_Pi. I tried then modifying the binary by replacing the old symbol string with the new one (using vim -- perhaps this is an issue); however, this causes a segmentation fault. I found that as long as I keep the symbol the same size then this does not occur.

How can I change this symbol in the binary without causing a segmentation fault?

I also have no idea if this will fix the problem or cause a whole bunch more problems so any more help is appreciated.

0

There are 0 answers