My website, blog and portfolio…

Archive for May, 2009

Neat utility for linux…

by admin on May.25, 2009, under Computers

Today after reading a bit of my assembler book from Peter Norton I googled and found a neat little utility for Linux. objdump, objdump as the manual page says, “displays information from object files”. But this neat tool does more then that, it will also dump the asm of almost any file. Just try it on a binary:

$ objdump -D ./eschalon_book_1_demo

./eschalon_book_1_demo:     file format elf32-i386
Disassembly of section .interp:

08048134 <.interp>:
8048134:    2f                       das
8048135:    6c                       insb   (%dx),%es:(%edi)
8048136:    69 62 2f 6c 64 2d 6c     imul   $0x6c2d646c,0x2f(%edx),%esp
804813d:    69 6e 75 78 2e 73 6f     imul   $0x6f732e78,0×75(%esi),%ebp
8048144:    2e 32 00                 xor    %cs:(%eax),%al

Disassembly of section .note.ABI-tag:

08048148 <.note.ABI-tag>:
8048148:    04 00                    add    $0×0,%al
804814a:    00 00                    add    %al,(%eax)
804814c:    10 00                    adc    %al,(%eax)
804814e:    00 00                    add    %al,(%eax)
8048150:    01 00                    add    %eax,(%eax)
8048152:    00 00                    add    %al,(%eax)
8048154:    47                       inc    %edi

I only used eschalon because it’s a fun game. Don’t worry, there isn’t much here to reconstruct any bit of the game, besides this is the demo which can be found on basilisk’s website.

Next I’m going to try my hand at assembly on linux, if not in a DOS emulator. I hear dosemu is a well respected emulator.

Leave a Comment :, , , , more...

Google Android rooting

by admin on May.21, 2009, under Computers

So here it is. Alan and I figured out howto root the Android and he’s written a guide. You can find the guide at his FSU CS website or you can see the mirror which I made on my own website.

This hack works with the T-Mobile phones. You can see my other Android articles to figure out howto get a develpment environment setup.

Leave a Comment :, , more...

Android development environment setup

by admin on May.17, 2009, under Computers

With the help of a friend and co-worker I’ve been able to setup a Google Android development Environment on my old linux laptop. I wanted to make an environment that is portable and can be moved from computer to computer with as little change between system. To do this we had to make sure that everything ran under a single user environment and that root was not needed other than for the initial setup.

The first step was to get a java runtime and SDK installed in a local user account onto my laptop without using apt (since this as a ubuntu laptop). I downloaded the java jdk1.6.0_13 from sun’s website. I selected the Java SE standard edition since I’m not doing any enterprise development.

Installation was easy, just give the binary execute permissions and run it.

chmod u+x jdk-6u13-linux-i586.bin
./jdk-6u13-linux-i586.bin
mv jdk1.6.0_13 ~/

I agreed to the really long terms by typing “yes” and the binary extracted the jdk into the current directory. Once the jdk was extracted I movied it into the root of my home directory (~).

The jvm needs to be in the path environment variable so that eclipse and other applications can see the runtime. So I edited my .bashrc and added the following lines at the bottom:

export JAVA_HOME=/home/fefe/jdk1.6.0_13
export PATH=$PATH:$JAVA_HOME/bin

Once placed into the .bashrc I restarted the terminal so that it would take on the new environment variables. (/home/fefe is my home directory, replace this with your home directory,~).

The second thing I needed was the google Android SDK. I downloaded version 1.5 of the SDK from the Andriod Developers website. I then unzipped the SDK into my home directory (~) since everything in this setup is meant to be ran from a single user. Once unzipped I checked to see if  “adb” the Google Android Debugger is working.

cd ~/android-sdk-linux_x86-1.5_r1/tools
./adb

Adb spits out a rather lengthy output when no parameters are passed, I didn’t paste them here because it would make the article longer then needed.

Once ADB is installed and working this too needs to be placed into the path environment variable. The procedure is the same as above, here are the lines that I replaced the previous lines with in the .bashrc file.

export JAVA_HOME=/home/fefe/jdk1.6.0_13
export PATH=$PATH:/home/fefe/android-sdk-linux_x86-1.5_r1/tools:$JAVA_HOME/bin

Don’t forget to change the /home/fefe portion to your /home/login (~) and restart the terminal or the environment variables wont work. You can test these environment variables by changing to the root of your home directory and typing “adb” (for andriod development kit) and “java” for the java runtime (jdk).

Next eclipse was downlaoded and installed. I grabbed the java-ganymede-SR2-linux-gtk build from eclipse’s website. Then I extracted the tar gzip to my home directory (~).

Since this particular version of eclipse requires a java jdk to run I was unable to run eclipse without first creating a script to change the path environment variables to point to the java jdk and the android sdk. Here’s what my script looks like:

#!/bin/bash
export JAVA_HOME=/home/fefe/jdk1.6.0_13
export PATH=$PATH:/home/fefe/android-sdk-linux_x86-1.5_r1/tools:$JAVA_HOME/bin
~/eclipse/eclipse

Don’t forget to chmod u+x on this script so that it will run.

Once the JDK, Android SDK and Eclipse were setup, the next step I needed to do was to get the eclipse google android plugin working. This part was sort of a pain since google’s website was down and there didn’t seem to be a single mirror of the plugin anywhere on the internet. I had to wait a day before I could actually finish this part. (if you have this problem comment here and I’ll happily send you the plugin I used).

To setup the plugin, I opened eclipse by running the script created above. When eclipse opens click Help->Software Updates. This opens the software updates dialog. In the dialog I clicked “Add site” and pasted “http://dl-ssl.google.com/android/eclipse/” into the dialog, without the quotes and clicked OK. The dialog refreshed and the link showed up in the pane with other links. I click on the arrow to the left of the link and eclipse fetched the repository information from google’s website. (If this part fails I can provide you with the plugin if you comment)

I placed a check mark next to everything in the google repository and clicked the “Install” button on the right. This took a while and I had to restart eclipse, but once it finished I had a working development environment for the google android phone!

In the next Android article I’ll setup a simple “HelloWorld” application, run it in the andriod virtual machine and then push it to my phone.

Leave a Comment :, , more...

T-Mobile, Google Android and crazyness

by admin on May.17, 2009, under Computers, Daily

This Friday I couldn’t help myself. My friend and co-worker Alan purchased an unlocked Developer Google Android phone. This phone has a free open development kit and it runs Linux! So I went by BestBuy just to look around in the store and I ended up purchasing an Android with a 2 year T-Mobile contract.

The first thing I did before I even got it home was look for a way to get root. After much googleing I found a root hack. The root hack required me to hit the home key, press enter twice, type “telnetd” and then press enter again. This runs a telnet daemon in the background. Once I did this I grabbed a special telnet client someone hacked up and got root. I installed busybox and started wgetting all kinds of updates and patches.

I texted Alan and he was so excited that he asked me to come over. So today I went over to his house and spent half the day trying to get his phone to load the latest firmware while also trying to get a development environment setup on my Linux laptop.

Neither ended up succeeding very well. We were unable to get Alan’s phone updated, no matter what firmware we tried the phone either crashed (and we had to reset it) or the phone said there was an invalid signature. Then while trying to get a development environment onto my phone Google’s Android Eclipse plugin website went down and was down the whole time I was at Alan’s house.

Unfortunately, it’s late, so I’m going to get some sleep and perhapse I’ll do a follow up article on this, or I’ll edit this article and add more information. Today was a long day and there’s still yet more to be learned about the Android phone that I now carry in my pocket.

Leave a Comment :, , more...

Mozilla Development part 2

by admin on May.14, 2009, under Computers, Daily

This is a multi-part article, see part 1

In the previous article I setup a working development environment on Windows. In this article I’ll setup my environment get a copy of Mozilla Firefox compiled and running from Mercurial. Mercurial is Mozilla’s CVS and comes with the (already installed) Mozilla Build package.

After testing that hg is working:

$ hg

Mercurial Distributed SCM

basic commands:

add        add the specified files on the next commit
annotate   show changeset information per file line
clone      make a copy of an existing repository
commit     commit the specified files or all outstanding changes
diff       diff repository (or selected files)
export     dump the header and diffs for one or more changesets
init       create a new repository in the given directory
log        show revision history of entire repository or files
merge      merge working directory with another revision
parents    show the parents of the working dir or revision
pull       pull changes from the specified source
push       push changes to the specified destination
remove     remove the specified files on the next commit
serve      export the repository via HTTP
status     show changed files in the working directory
update     update working directory

use “hg help” for the full list of commands or “hg -v” for details

I checked out Mozilla Firefox 3.5 into the c:/191src directory (as recommended by the wiki):

hg clone http://hg.mozilla.org/releases/mozilla-1.9.1/ c:/191src

This step took quite sometime (as the wiki mentioned) so I stepped away, grabbed a drink and did a few things around the house before returning to the computer.

Next I created my .mozconfig file and placed it into c:/191src. This file tells configure and make what options should be used to build mozilla. The descriptions for each item in this file are rather long, so I’ll link to the page describing how to make it. Here’s the one that I build for my project:

# kg4cjv’s mozilla config version .1
ac_add_options –enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser

This config does not contain any debug information, the  Configuring Build Options wiki article explains how to setup this file properly for building a debug browser.

After the config is made building is required. So I ran the following command:

make -f client.mk build

Make was trucking along doing its thing when it hit an error:

configure: error: System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.
*** Fix above errors and then restart with “make -f client.mk build”
make[1]: *** [configure] Error 1
make[1]: Leaving directory `/c/191src’
make: *** [/c/191src/Makefile] Error 2

So of course I hit the website provided above and found out that this library is only included with the professional version of the Microsoft Visual C++, which I don’t have. ATL is only used for a small portion of the code and can be disabled, so I modified my config file to not include this portion of the code:

# kg4cjv’s mozilla config version .1
ac_add_options –enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options –disable-xpconnect-idispatch
ac_add_options –disable-activex
ac_add_options –disable-activex-scripting
ac_add_options –disable-accessibility

Make tucked along after this for quite sometime and finally after about an hour of waiting it’s time to make the installer:

make -C browser/installer installer

Now it’s ready to be installed and ran from  dist/install/sea/firefox-3.5b5pre.en-US.win32.installer.exe!!

Leave a Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!