Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 18 Jun 2013, 23:05
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
crazy GLIBC hack... surely not a good idea...
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2199
Location: UK

PostPosted: Wed 30 Nov 2011, 11:50    Post_subject:  crazy GLIBC hack... surely not a good idea...
Sub_title: but maybe one for techno??
 

I would like to run some stuff that was compiled in Lupu/Lucid or whatever uses libc 2.11

I'm using a wary based Puppy, which is on libc 2.10, so the command:
Code:
strings /lib/libc.so.6 | grep GLIBC
produces this:

Code:
GLIBC_2.0
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.1.3
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.2.2
GLIBC_2.2.3
GLIBC_2.2.4
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_PRIVATE


What would happen if I followed Technos example of hacking Flash9 to pretend to be Flash 10, and added GLIBC_2.11 into the binary...? Or maybe replaced an older string (such as GLIBC_2.10) with GLIBC_2.11?? Is it possible? I know it's crazy, but am curious - there's a few tiny cli bins I wanna try out...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Edited_time_total
Back to top
View user's profile Send_private_message 
big_bass


Joined: 13 Aug 2007
Posts: 1736

PostPosted: Wed 30 Nov 2011, 12:40    Post_subject:  

Hey sc0ttman
Quote:

I would like to run some stuff that was compiled in Lupu/Lucid or whatever uses libc 2.11

I'm using a wary based Puppy, which is on libc 2.10, so the command:


this is the reason when we use linux (any thing pertaining to linux) I am not talking about only puppy this is a general statement for all distros

we must have the source code
so that it simply can be recompiled
against your version of installed programs

hacking compiled binaries is a bad practice
the only reason someone would do that is if the
binary wasn't open source to start with

whatever the app you need ask for the source code
or a link to the source code then if it wont compile on your box
help the dev with your feedback
so he/she can get it working on more machines

now after saying all that and you want to experiment only
http://www.murga-linux.com/puppy/viewtopic.php?t=71223&start=23



Joe

_________________
slackware 14
Back to top
View user's profile Send_private_message 
Dave_G


Joined: 21 Jul 2011
Posts: 459

PostPosted: Wed 30 Nov 2011, 15:26    Post_subject:  

Hey sc0ttman,

Go for it, nothing wrong with firing up the ol' hex editor.
One of two things are going to happen:

1) The app expects a function or variable type in the "new" lib which is not in the old one which you just renamed and will crash, oh well at least
you will know.

2) It will work.
Sometimes the dev just cleans up the code and ups the version number
but the lib is functionally the same as the older one.

Oh and by the way, in case you haven't done this kind of thing before,
when hex editing an executable keep the new strings the same length
as the old ones or you will trash the whole thing.

Dave.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 3845

PostPosted: Thu 01 Dec 2011, 00:22    Post_subject:  

I used to have an object file that I could preload with ldpreload that had stubs of these pseudo functions. I usually just make it a void function or if it needs to be an int function, just return 0. It was handy to have around for just these sorts of things without having to track down and compile a bunch of packages.
_________________
Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2199
Location: UK

PostPosted: Thu 01 Dec 2011, 07:49    Post_subject:  

Thanks for the replies guys, bigbass - I know its a dumb thing to do, but thats just me...

I've been 'off my face' on various medications the past 3 days, literally not knowing if yesterday morning was today or not, where I was 5 hours ago, and so on... But then the GLIBC hacking idea came to me, so I thought I would ask! Smile

Dave G, I was thinking today as well... I cannot replace anything with GLIBC_2.11, except GLIBC_2.10, which is the real one, so that would probably break everything...

And Techno, I wish that info wasn't SO far above my head (I'm on lots of pills for a bad neck in the 1st place lol)..

But anyway, thanks for the replies, I thought I would ask - and was basically waiting for amigo to come and tell me to stop being an idiot. Wink

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send_private_message 
big_bass


Joined: 13 Aug 2007
Posts: 1736

PostPosted: Sat 03 Dec 2011, 12:32    Post_subject:  

Quote:
Thanks for the replies guys, bigbass - I know its a dumb thing to do, but thats just me...

I've been 'off my face' on various medications the past 3 days, literally not knowing if yesterday morning was today or not, where I was 5 hours ago, and so on... But then the GLIBC hacking idea came to me, so I thought I would ask! Smile


its fine to experiment have fun ,enjoy and post your results

note that even my dog barks at me when I do something "strange"
although my dog would never growl at me or bite me Very Happy

and friends dont let friends drive drunk Very Happy

I hope you are feeling better
life is already to short to be sick for any cause

Joe

_________________
slackware 14
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 1776

PostPosted: Sun 04 Dec 2011, 05:09    Post_subject:  

Did I hear my name?? The best way to do what you want is to install the needed library in an out-of-the-way location. Then, use a script wrapper to set LD_LIBRARY_PATH to point to the library before exec-ing the binary which needs that library. This avoids borking your system by arbitrarily replacing glibc. You need to understand that nearly everything on your system uses glibc, so replacing it without recompiling everything against the new version is very risky. Many programs will continue to work normally, but there will nearly always be some which do not -often in subtle ways which may not be immediately obvious. You can always use the new version for other programs as well -just use a wrapper for each program you want to use that version.

Sorry to hear about your neck -if you are taking NSAID's like ibuprofen, etc, try to find a way to not take them for long as they will ruin your kidneys. I've just found out the hard way by having a kidney fail (leading to super-high blood pressure). One of the better ways to deal with the neck pains is by taking tricyclic anti-depressants -particularly nortryptilin. I have 6 bad disks in my neck, chest and lumbar regions and a seventh already removed, so I have a *little* experience with the subject...
Back to top
View user's profile Send_private_message 
Dave_G


Joined: 21 Jul 2011
Posts: 459

PostPosted: Sun 04 Dec 2011, 06:10    Post_subject:  

amigo wrote:
Quote:

The best way to do what you want is to install the needed library in an
out-of-the-way location. Then, use a script wrapper to set
LD_LIBRARY_PATH to point to the library


Sounds very interesting and extremely useful.
Wanna post more details ? I'm very interested.

Thanks,
Dave.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 3845

PostPosted: Thu 08 Dec 2011, 06:52    Post_subject:  

if the working library was in /usr/share/myapp

Code:
LD_LIBRARY_PATH=/usr/share/myapp:$LD_LIBRARY_PATH && /usr/share/myapp/myapp

_________________
Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Dave_G


Joined: 21 Jul 2011
Posts: 459

PostPosted: Mon 19 Dec 2011, 14:43    Post_subject:  

Thanks technosaurus
Back to top
View user's profile Send_private_message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2199
Location: UK

PostPosted: Tue 20 Dec 2011, 07:24    Post_subject:  

technosaurus wrote:
if the working library was in /usr/share/myapp

Code:
LD_LIBRARY_PATH=/usr/share/myapp:$LD_LIBRARY_PATH && /usr/share/myapp/myapp

How could we make sure a program uses 2.11 if needed, without writing wrappers for it in advance? Could we 'catch' the glibc errors and then re-run with the new LD_LIBRARY_PATH?? Or is that impossible?

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send_private_message 
Makoto


Joined: 03 Sep 2009
Posts: 1406
Location: Out wandering... maybe.

PostPosted: Tue 20 Dec 2011, 07:46    Post_subject:  

Okay, now you've got my attention as well. Smile I've been way too paranoid to attempt mucking with the versions of glib/c in my setup... which sc0ttman knows. Embarassed

sc0ttman: Hope you're feeling better, for whatever reason you were taking the medications.

_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send_private_message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2199
Location: UK

PostPosted: Tue 20 Dec 2011, 08:48    Post_subject:  

Makoto wrote:
Okay, now you've got my attention as well. Smile I've been way too paranoid to attempt mucking with the versions of glib/c in my setup... which sc0ttman knows. Embarassed

To clever, some might say!

Quote:
sc0ttman: Hope you're feeling better, for whatever reason you were taking the medications.
Quote:
Sorry to hear about your neck

Forgot to say "Thank you"... I'm better now, just need to find a (good) gym after Xmas - mine closed down!! Sad

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send_private_message 
Makoto


Joined: 03 Sep 2009
Posts: 1406
Location: Out wandering... maybe.

PostPosted: Tue 20 Dec 2011, 11:07    Post_subject:  

Yes, but I meant the more technical doctor's explanation, though (not that I'm asking you to mention what it was). Embarassed You did say it was serious enough that you had to take various medications.

sc0ttman wrote:
Forgot to say "Thank you"... I'm better now, just need to find a (good) gym after Xmas - mine closed down!! Sad


I wouldn't know what to look for in a good gym, anyway. Embarassed Most of the ones I've seen didn't seem all that great, to begin with...

_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0806s ][ Queries: 11 (0.0118s) ][ GZIP on ]