Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 33 guests online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow [newbie] re-compiling GPL on Linux
EH-Net
May 24, 2013, 09:15:10 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [newbie] re-compiling GPL on Linux  (Read 11394 times)
0 Members and 1 Guest are viewing this topic.
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« on: July 21, 2009, 01:59:48 AM »

i wanted to re-compile some GPL code of a router's Firmware in order to run some executables Linux.
The codes have been published by the producer himselfs!

what 'm mostly interested in is the executable "rgbin":
can you have a look and tell me whether the sourcecode is actually complete ?
besides, some external files, which are linked with included in the "rgbin" makefile, seem to be empty...?


the "rgbin"-related codes can be found this archive: http://ftp://ftp.dlink.co.uk/GPL/DI-524_E1_GPL.tgz
at these paths:

di524\userland\target\usr\sbin\rgbin
di524\progs.priv\rgbin\Makefile
di524\progs.priv\rgbin\rgbin

thanks a lot for your help!
Regards.
Logged
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #1 on: July 23, 2009, 08:43:36 AM »

anybody can help ?
Logged
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #2 on: August 04, 2009, 02:39:08 AM »

sorry...i need your help,
'cause i guess the codes don't have just to be compiled (makefile9,
but also re-compiled onto x86 (since the firmware's codes weere designed for MIPS processors)...

anyone can help ?
thanks
Logged
Ketchup
Hero Member
*****
Offline Offline

Posts: 1021



View Profile
« Reply #3 on: August 04, 2009, 01:48:55 PM »

Mark77, I think that anytime you have to rewrite something for a different processor architecture, it's quite an undertaking.   I think that you are in for a bit of work on this one.   You or someone else would have to go through all of the code.
Logged

~~~~~~~~~~~~~~
Ketchup
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #4 on: August 04, 2009, 02:41:57 PM »

actually i'd need just the executable called "rgbin"...
could it be done ?
i wouldn't know how to make it  Huh

another source link:
http://ftp://ftp.dlink.se/Products/di-products/di-524/drivers_firmware/di524.source.tgz
Logged
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #5 on: August 10, 2009, 01:18:33 PM »

ok, the source codes seem to be nested, so they have to be compiled entirely

after some struggle, i tried a compiling on Ubuntu (there's a tolchain provided for different archtecture...)
but when i run some tools, i get errors and no good output

for instance, if you give this commnand:
Code:
rgdb -D config.bin
(rgdb is an alias of rgbin, as far as i can see)
you get this message
Quote
bash: ./rgdb: cannot execute binary file

...what's wrong with it?
« Last Edit: August 10, 2009, 01:23:26 PM by mark77 » Logged
Ketchup
Hero Member
*****
Offline Offline

Posts: 1021



View Profile
« Reply #6 on: August 10, 2009, 02:20:54 PM »

I am not sure which toolchain you are using, but it's likely generating a binary file that is meant to run on a different architecture.   
Logged

~~~~~~~~~~~~~~
Ketchup
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #7 on: August 10, 2009, 04:31:53 PM »

hi!

actually, if you take a look at those files in the GPL
http://ftp://ftp.dlink.co.uk/GPL/DI-524_E1_GPL.tgz
they seem to me like these they show no source, on the contrary they look like the binary image (maybe) of the original firmware tool, which was cmpiled onto MIPS:

.\di524\userland\target\usr\sbin\rgbin
.\di524\progs.priv\rgbin\rgbin
.\di524\progs.priv\rgbin\Makefile

.\di524\userland\target\usr\sbin\rgdb
.\di524\tools\alpha\rgdb\rgdb
.\di524\tools\alpha\rgdb\Makefile

am i wrong?
« Last Edit: August 10, 2009, 04:33:48 PM by mark77 » Logged
Ketchup
Hero Member
*****
Offline Offline

Posts: 1021



View Profile
« Reply #8 on: August 10, 2009, 06:18:11 PM »

It looks like a binary file to me.   Does D-Link have a developer forum or another resource you can ask?   Much of this code is going to be specific to their equipment. 
Logged

~~~~~~~~~~~~~~
Ketchup
mark77
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #9 on: August 12, 2009, 06:55:06 AM »

yes, i already asked more than one D-Link support...but they answer telling they released the GPL but don't give support about that.

if you have some time left, may you try what i did and tell me if you have different results?

i used Ubuntu..i don't know if it depends on it...?

otherwise, i can only guess an alternative:
running the compiled  on a MIPS architecture's emulation, like this ?
http://www.qemu.org/
http://sourceforge.net/projects/aqemu/
...but i never did that, i wouldn't know how to deal with it
« Last Edit: August 12, 2009, 06:57:35 AM by mark77 » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.072 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.