Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Alex Zbyslaw

Jim Stapleton wrote:


I don't know how to find out, except that the app is the Crossover
Office demo installer. I'd like to try to find a way to trick it into
running in the linux compatability mode of FreeBSD if I can.


So is there source code?  Or is it some dumb binary rpm?

You could try running it under ktrace, then look at the output of kdump 
(assuming that works for linux apps), but the output will be *long* so 
you will have to edit out a judicious part which leads up to the Linux 
string being printed, and it might not help.  But, it might, for 
example, look to see if some file exists (/etc/redhat-release or something).


Darrin Chandler wrote:


In addition, consider respecting the wishes of
the developer(s) and not using it.   If they have any sort of free
license then you can always release a portable fork.



Respect a license?  Yes, probably.  Respect the wishes?  Fat chance.  That way 
lies doom...

--Alex



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Jim Stapleton

OK, that was easier than expected. These blobs appeared around
everything linux, but don't look horribly useful. I'll check later
to see if I can find anything else. is there anything I should be
looking for aside from linux?

$ wc -l kdumped
  11413 kdumped



 7851 rm   RET   fcntl 0
 7851 rm   CALL  fstatfs(0x4,0xbfbfe670)
 7851 rm   RET   fstatfs 0
 7851 rm   CALL  fstat(0x4,0xbfbfe850)
 7851 rm   RET   fstat 0
 7851 rm   CALL  fchdir(0x4)
 7851 rm   RET   fchdir 0
 7851 rm   CALL  getdirentries(0x4,0x8051000,0x1000,0x8050014)
 7851 rm   RET   getdirentries 512/0x200
 7851 rm   CALL  lstat(0x804f2a8,0x804f248)
 7851 rm   NAMI  perl
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804f3a8,0x804f348)
 7851 rm   NAMI  cxupgrade
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804f4a8,0x804f448)
 7851 rm   NAMI  tcl
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804f5a8,0x804f548)
 7851 rm   NAMI  nsplugin-linux.so
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804f6a8,0x804f648)
 7851 rm   NAMI  nsplugin-linux64.so
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804f7a8,0x804f748)
 7851 rm   NAMI  xml
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804fea8,0x804fe48)
 7851 rm   NAMI  libxml2.so.2.6.19
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x804ffa8,0x804ff48)
 7851 rm   NAMI  libxml2.so.2
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x80520a8,0x8052048)
 7851 rm   NAMI  libxml2.so
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x80521a8,0x8052148)
 7851 rm   NAMI  libxslt.so.1.1.14
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x80522a8,0x8052248)
 7851 rm   NAMI  libxslt.so.1
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x80523a8,0x8052348)
 7851 rm   NAMI  libxslt.so
 7851 rm   RET   lstat 0
 7851 rm   CALL  lstat(0x80524a8,0x8052448)


 7851 rm   CALL  unlink(0x80530a8)
 7851 rm   NAMI  libimg1.2.so
 7851 rm   RET   unlink 0
 7851 rm   CALL  unlink(0x80531a8)
 7851 rm   NAMI  libTktable2.8.so
 7851 rm   RET   unlink 0
 7851 rm   CALL  open(0x2813fcd0,0,0)
 7851 rm   NAMI  ..
 7851 rm   RET   open 4
 7851 rm   CALL  fstat(0x4,0xbfbfe8c0)
 7851 rm   RET   fstat 0
 7851 rm   CALL  fchdir(0x4)
 7851 rm   RET   fchdir 0
 7851 rm   CALL  close(0x4)
 7851 rm   RET   close 0
 7851 rm   CALL  rmdir(0x804f4a8)
 7851 rm   NAMI  tcl
 7851 rm   RET   rmdir 0
 7851 rm   CALL  unlink(0x804f5a8)
 7851 rm   NAMI  nsplugin-linux.so
 7851 rm   RET   unlink 0
 7851 rm   CALL  unlink(0x804f6a8)
 7851 rm   NAMI  nsplugin-linux64.so
 7851 rm   RET   unlink 0
 7851 rm   CALL  stat(0x804f7a8,0xbfbfe850)
 7851 rm   NAMI  xml
 7851 rm   RET   stat 0
 7851 rm   CALL  open(0x804f7a8,0x4,0x1)
 7851 rm   NAMI  xml
 7851 rm   RET   open 4
 7851 rm   CALL  fstat(0x4,0xbfbfe850)
 7851 rm   RET   fstat 0
 7851 rm   CALL  fcntl(0x4,0x2,0x1)
 7851 rm   RET   fcntl 0
 7851 rm   CALL  fstatfs(0x4,0xbfbfe670)
 7851 rm   RET   fstatfs 0
 7851 rm   CALL  fstat(0x4,0xbfbfe850)
 7851 rm   RET   fstat 0
 7851 rm   CALL  fchdir(0x4)
 7851 rm   RET   fchdir 0
 7851 rm   CALL  getdirentries(0x4,0x8051000,0x1000,0x8050014)
 7851 rm   RET   getdirentries 512/0x200
 7851 rm   CALL  lstat(0x8052da8,0x8052d48)
 7851 rm   NAMI  perl
 7851 rm   RET   lstat 0
 7851 rm   CALL  getdirentries(0x4,0x8051000,0x1000,0x8050014)


 7851 rm   RET   rmdir 0
 7851 rm   CALL  unlink(0x804f3a8)
 7851 rm   NAMI  setup.glade
 7851 rm   RET   unlink 0
 7851 rm   CALL  stat(0x804f4a8,0xbfbfe850)
 7851 rm   NAMI  bin
 7851 rm   RET   stat 0
 7851 rm   CALL  open(0x804f4a8,0x4,0x1)
 7851 rm   NAMI  bin
 7851 rm   RET   open 4
 7851 rm   CALL  fstat(0x4,0xbfbfe850)
 7851 rm   RET   fstat 0
 7851 rm   CALL  fcntl(0x4,0x2,0x1)
 7851 rm   RET   fcntl 0
 7851 rm   CALL  fstatfs(0x4,0xbfbfe670)
 7851 rm   RET   fstatfs 0
 7851 rm   CALL  fstat(0x4,0xbfbfe850)
 7851 rm   RET   fstat 0
 7851 rm   CALL  fchdir(0x4)
 7851 rm   RET   fchdir 0
 7851 rm   CALL  getdirentries(0x4,0x8051000,0x1000,0x8050014)
 7851 rm   RET   getdirentries 512/0x200
 7851 rm   CALL  lstat(0x804f2a8,0x804f248)
 7851 rm   NAMI  Linux
 7851 rm   RET   lstat 0
 7851 rm   CALL  getdirentries(0x4,0x8051000,0x1000,0x8050014)
 7851 rm   RET   getdirentries 0
 7851 rm   CALL  lseek(0x4,0,0,0,0)
 7851 rm   RET   lseek 0
 7851 rm   CALL  close(0x4)
 7851 rm   RET   close 0
 7851 rm   CALL  stat(0x804f2a8,0xbfbfe850)
 7851 rm   NAMI  Linux
 7851 rm   RET   stat 0
 7851 rm   CALL  open(0x804f2a8,0x4,0x1)
 7851 rm   NAMI  Linux
 7851 rm   RET   open 4
 7851 rm   CALL  

Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Jim Stapleton

Ahh, it is, in fact, a binary sh.

The binary compatability looks pretty thourough, and it seems most of
the details in the compatability section for most apps seem to involve
making them check for BSD instead of linux, and ensuring they run in
compatability mode,

I'll run ktrace tonight. thanks.

I really want to proove to these people that the port will not be a
$60k effor, more like a $20 effort.

On 6/19/06, Alex Zbyslaw [EMAIL PROTECTED] wrote:

Jim Stapleton wrote:

 I don't know how to find out, except that the app is the Crossover
 Office demo installer. I'd like to try to find a way to trick it into
 running in the linux compatability mode of FreeBSD if I can.

So is there source code?  Or is it some dumb binary rpm?

You could try running it under ktrace, then look at the output of kdump
(assuming that works for linux apps), but the output will be *long* so
you will have to edit out a judicious part which leads up to the Linux
string being printed, and it might not help.  But, it might, for
example, look to see if some file exists (/etc/redhat-release or something).

Darrin Chandler wrote:

In addition, consider respecting the wishes of
the developer(s) and not using it.   If they have any sort of free
license then you can always release a portable fork.


Respect a license?  Yes, probably.  Respect the wishes?  Fat chance.  That way 
lies doom...

--Alex





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Alex Zbyslaw

Jim Stapleton wrote:


OK, that was easier than expected. These blobs appeared around
everything linux, but don't look horribly useful. I'll check later
to see if I can find anything else. is there anything I should be
looking for aside from linux?


What you want to find is the error message you got about Only runs on 
Linux.  I was assuming this is just a single binary, but if there is 
lots of stuff including sh scripts and stuff then a grep for some part 
of the string in all the files might point you in the right direction.  
I think Linux was all caps so a case-sensitive grep (i.e. not -i) for 
Linux should do the trick.  If in doubt try to find the earliest word in 
the error string since ktrace will chop off long strings.  (Sorry, lost 
your original post already and can't exactly remember the string).



I really want to proove to these people that the port will not be a
$60k effor, more like a $20 effort. 


Better not tell you my hourly rate then ;-)

--Alex



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Jim Stapleton

found it; uname -a, I fixed that line, now I just need to figure out
how to get the appropriate libs (glibc) into my compat dir... it isn't
in any of the linux compat ports.

-Jim Stapleton

On 6/19/06, Alex Zbyslaw [EMAIL PROTECTED] wrote:

Jim Stapleton wrote:

 OK, that was easier than expected. These blobs appeared around
 everything linux, but don't look horribly useful. I'll check later
 to see if I can find anything else. is there anything I should be
 looking for aside from linux?

What you want to find is the error message you got about Only runs on
Linux.  I was assuming this is just a single binary, but if there is
lots of stuff including sh scripts and stuff then a grep for some part
of the string in all the files might point you in the right direction.
I think Linux was all caps so a case-sensitive grep (i.e. not -i) for
Linux should do the trick.  If in doubt try to find the earliest word in
the error string since ktrace will chop off long strings.  (Sorry, lost
your original post already and can't exactly remember the string).

 I really want to proove to these people that the port will not be a
 $60k effor, more like a $20 effort.

Better not tell you my hourly rate then ;-)

--Alex





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Alex Zbyslaw

Jim Stapleton wrote:


found it; uname -a, I fixed that line, now I just need to figure out
how to get the appropriate libs (glibc) into my compat dir... it isn't
in any of the linux compat ports.


Good stuff.

The glibc you have might just do fine.  Just make a symlink from the one 
you want to the one you have and try!  There's an FC4 linux in the 
ports, IIRC which is as recent as any Linux I have to administer; I have 
trouble believing you'd need a newer one otherwise the app won't even 
run on most Linux machines :-)  Or maybe your app has an RPM for an 
older linux you could try.


--Alex


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Jim Stapleton

The problem is I don't already have one, though there is a reply to my
other post that I'll be looking at in a few minutes, maybe something
will be there. I updated the locate db, and tried to locate glibc,
but I only found documentation, and a few bin (not lib) compat files
that look like they are meant to upgrade something, but creat no
glibc. What I was considering was linking my libc.so.6 file (no g)
to a glibc file in compat.

-Jim Stapleton


Good stuff.

The glibc you have might just do fine.  Just make a symlink from the one
you want to the one you have and try!  There's an FC4 linux in the
ports, IIRC which is as recent as any Linux I have to administer; I have
trouble believing you'd need a newer one otherwise the app won't even
run on most Linux machines :-)  Or maybe your app has an RPM for an
older linux you could try.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-19 Thread Alex Zbyslaw

Alex wrote:



The glibc you have might just do fine.  Just make a symlink from the one
you want to the one you have and try!


Jim Stapleton wrote:


The problem is I don't already have one, though there is a reply to my
other post that I'll be looking at in a few minutes, maybe something
will be there. I updated the locate db, and tried to locate glibc,
but I only found documentation, and a few bin (not lib) compat files
that look like they are meant to upgrade something, but creat no
glibc. What I was considering was linking my libc.so.6 file (no g)
to a glibc file in compat.

glibc is the name of the package (gnu libc) but the actual library is 
called libc.so.?, at least on the Linux machine I just looked at.  Are 
you sure the app is looking for glibc?  Trying to link the 
compat/linux/lib/libc - glibc is worth a try (just don't link to the 
FreebSD libc), but I don't think it's right.  Generally, all libraries 
have to start with lib or the linker doesn't know how to find them.


--Alex




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-18 Thread Alex Zbyslaw

Jim Stapleton wrote:


Basically, I have an application that doesn't want to run in FreeBSD,
though it may still run given the compatability layer. I was wondering
if there was some way to make the OS respond when it ran the
application, that it was linux and not BSD.
i.e.



$ ./some_app
Sorry, we only deal with Linux people, go away!

$ sysctl.pretend.register /home/me/some_app generic-i386-linux
$ ./some_app
Hello world!



That really rather depends on *how* the app is asking.  If you can tell 
us that, we can almost certainly tell you how to fool it.


Of course, if you have the source code, it should be easy as you can 
just comment out the test and recompile.


Mind you, if the app is as short-sighted and bloody-minded as its 
developers, maybe you should just look for an alternative.


--Alex


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-18 Thread Jim Stapleton

I don't know how to find out, except that the app is the Crossover
Office demo installer. I'd like to try to find a way to trick it into
running in the linux compatability mode of FreeBSD if I can.

On 6/18/06, Alex Zbyslaw [EMAIL PROTECTED] wrote:

Jim Stapleton wrote:

 Basically, I have an application that doesn't want to run in FreeBSD,
 though it may still run given the compatability layer. I was wondering
 if there was some way to make the OS respond when it ran the
 application, that it was linux and not BSD.
 i.e.


 
 $ ./some_app
 Sorry, we only deal with Linux people, go away!

 $ sysctl.pretend.register /home/me/some_app generic-i386-linux
 $ ./some_app
 Hello world!
 

That really rather depends on *how* the app is asking.  If you can tell
us that, we can almost certainly tell you how to fool it.

Of course, if you have the source code, it should be easy as you can
just comment out the test and recompile.

Mind you, if the app is as short-sighted and bloody-minded as its
developers, maybe you should just look for an alternative.

--Alex




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-18 Thread Darrin Chandler
On Sun, Jun 18, 2006 at 10:13:03PM +0100, Alex Zbyslaw wrote:
 That really rather depends on *how* the app is asking.  If you can tell 
 us that, we can almost certainly tell you how to fool it.
 
 Of course, if you have the source code, it should be easy as you can 
 just comment out the test and recompile.
 
 Mind you, if the app is as short-sighted and bloody-minded as its 
 developers, maybe you should just look for an alternative.

I agree with the above. In addition, consider respecting the wishes of
the developer(s) and not using it. If they have any sort of free
license then you can always release a portable fork.

-- 
Darrin Chandler|  Phoenix BSD Users Group
[EMAIL PROTECTED]   |  http://bsd.phoenix.az.us/
http://www.stilyagin.com/  |
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: smoke and mirrors - any way to trick an app into thinking I'm running linux?

2006-06-18 Thread Bill Moran
Jim Stapleton [EMAIL PROTECTED] wrote:

 Basically, I have an application that doesn't want to run in FreeBSD,
 though it may still run given the compatability layer. I was wondering
 if there was some way to make the OS respond when it ran the
 application, that it was linux and not BSD.

Have a read of the man page for brandelf and see if that helps you.

-- 
Bill Moran

I lay down for a while, and I woke up on the ocean,
floating on my back, and staring at the grey.
It was completely still, 'cept for the pounding of my heart,
was bring me back to life, from three strange days.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]