Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: patching a binary file

  1. #1
    Join Date
    Sep 2008
    Posts
    2,997

    Default patching a binary file

    one of the kde applications I use has a small bug that has been fixed upstream but still hasn't gotten a new build, I know the proper thing to do would be to build from source but as the fix is extremely simple I thought I'd just patch the binary with a hex editor
    I'm asking for ideas and suggestions on how to patch a binary file
    the app is kdeconnect-kde
    https://software.opensuse.org/package/kdeconnect-kde
    the patch is
    https://quickgit.kde.org/?p=kdeconne...c5c91cb699690b
    or simply replacing
    "HostKeyAlgorithms=+ssh-dss" with "HostKeyAlgorithms=ssh-dss"; just removing the extra +
    I think Okteta should be able to do it, any ideas?

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,117

    Default Re: patching a binary file

    Is that a string used somewhere in the program or is it a C statement?

    To me it looks like a C statement. And compiling it means creating codes for the CPU like:
    LOAD contents of HostKeyAlgorithms
    ADD contents of ssh-dss
    STORE into HostKeyAlgorithms
    vs.
    LOAD contents of ssh-dss
    STORE into HostKeyAlgorithms
    But then of course the binary values for those commands. Not easey to find in a binary executable.
    Henk van Velden

  3. #3
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: patching a binary file

    I do believe it's a command passed to an external application sshfs
    I found the string in
    \usr\lib64\qt5\plugins\kdeconnect\kdeconnect_sftp.so
    as
    HostKeyAlgorithms=+ssh-dss
    48 6f 73 74 4b 65 79 41 6c 67 6f 72 69 74 68 6d 73 3d 2b 73 73 68 2d 64 73 73 20
    I just don't know what to put instead of the + (2b) maybe space (20) as (00) is a .

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,796
    Blog Entries
    15

    Default Re: patching a binary file

    Quote Originally Posted by I_A View Post
    I do believe it's a command passed to an external application sshfs
    I found the string in
    \usr\lib64\qt5\plugins\kdeconnect\kdeconnect_sftp.so
    as
    HostKeyAlgorithms=+ssh-dss
    48 6f 73 74 4b 65 79 41 6c 67 6f 72 69 74 68 6d 73 3d 2b 73 73 68 2d 64 73 73 20
    I just don't know what to put instead of the + (2b) maybe space (20) as (00) is a .
    Hi
    Just branch the package on OBS, patch, fix and submit so everyone can enjoy?
    https://build.opensuse.org/package/s...kdeconnect-kde
    [Maybe wolfi323 can do it for you?]
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: patching a binary file

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Just branch the package on OBS, patch, fix and submit so everyone can enjoy?
    https://build.opensuse.org/package/s...kdeconnect-kde
    [Maybe wolfi323 can do it for you?]
    I did ask for an updated build here
    https://bugzilla.opensuse.org/show_bug.cgi?id=954106
    I got no response,
    I don't know how to use OBS I'm not a programmer but I do like to thinker.
    Any way I can confirm that binary patching that file works, now dolphin can browse/edit files on my droid, if somebody wants it I can upload the patched file but a new build would be a better idea, if wolfi or another maintainer sees this a new build would be cool.

    edit
    I tried creating an OBS account but it said my email was already in use can I use my opensuse.org logon there?

  6. #6
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: patching a binary file

    I tried retrieving my credentials from OBS it's the same as the forums but they don't work there?
    edit it's the same username/password but it requires a 2nd logon
    I'll ask for an updated build from
    https://build.opensuse.org/package/s...kdeconnect-kde

  7. #7
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: patching a binary file

    I couldn't find a way to make a build request so I submitted a bug and asked for an updated build
    https://bugzilla.opensuse.org/show_bug.cgi?id=961554

  8. #8

    Default Re: patching a binary file

    Quote Originally Posted by I_A View Post
    if wolfi or another maintainer sees this a new build would be cool.
    I am not a maintainer of the KDE:Unstable:Extra repo, so I cannot trigger a rebuild (which would automatically fetch the latest sources from git) there.

    I do have the latest version in my repo though. AFAIK you'd need to install plasma5-session-envscript from my repo, than it should work also on an otherwise standard Leap system (i.e. you don't have to install all the packages from my repo).
    Last edited by wolfi323; 13-Jan-2016 at 15:47.

  9. #9
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: patching a binary file

    Quote Originally Posted by wolfi323 View Post
    I am not a maintainer of the KDE:Unstable:Extra repo, so I cannot trigger a rebuild (which would automatically fetch the latest sources from git) there.

    I do have the latest version in my repo though. AFAIK you'd need to install plasma5-session-envscript from my repo, than it should work also on an otherwise standard Leap system (i.e. you don't have to install all the packages from my repo).
    I was planning on switching to your repo again (I used it on 13.2), this is just another good reason to do so.
    tanks wolfi

  10. #10

    Default Re: patching a binary file

    PS: the fix has been submitted for the stable version in KDE:Extra now too, see http://bugzilla.opensuse.org/show_bug.cgi?id=961554
    It hasn't been accepted yet though.

    Sorry, I haven't noticed that KDE:Extra has been switched to the KF5 version already, or that such a version had already been released yet.

    I'll switch my package to follow the stable package instead of unstable git snapshots then as well, and add the KDE4 version to my repo...
    Last edited by wolfi323; 14-Jan-2016 at 05:27.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •