2008年9月21日 星期日

Hack simpleui.rc in Eee PC

這幾天遇到一些bug,一直在想要找出某一個按鍵對應到哪一支程式,此時常需要用很暴力的方法,就是
1. 按Ctrl + Alt + Del觀察那個是打開的程式
2. 在shell上打top,拖拉視窗,觀察那個是打開的程式

但是這樣對整個系統的瞭解太弱了,所以我做了下面的步驟,來破解一下Eee PC的simpleui.rc

# 1. We open /opt/xandros/share/AsusLauncher/simpleui.rc

# 2. This is head of simple ui


# 3. Define the background of simple ui


# 4. This is top tabs, we called simplecat (It may be abbreviated from "Simple categories")
# It also define a lot of languages

Internet
Internet
...


# 5. Folder definition. Ex. Science folder in Learn category

Science
Ciências
...


# 6. This is the mapping between applications and icons. (parcel stand for ??)
# This icon is in the Internet/WebMail and execute /opt/xandros/bin/p701-gmail.sh

Gmail
Gmail
...



# 7. This is messenger, but what is pidgin.desktop?

Messenger
Mensageiro Instantâneo
...


# 8. We found the shortcut place by tracing many shortcut tags
# Here store lot of shortcuts
/usr/share/applications/

# 9. pidgin.desktop has detail application information. When we execute pidgin, it will launch application "pidgin" directly.
# cat /usr/share/applications/pidgin.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Pidgin Instant Messenger
GenericName=Instant Messenger
Comment=Send instant messages over multiple protocols
Comment[af]=Stuur kitsboodskappe oor veelvoudige protokolle
...
Comment[zh_TW]=透過多種通訊協定發送即時訊息
Exec=pidgin
Icon=pidgin
StartupNotify=true
Terminal=false
Type=Application
Categories=Network;InstantMessaging;

# 10. This is different from others? We can't find this shortcut?

Documents
Documentos
...


# 11. We found the secrets in simpleui.rc, There are many same "documents_hi.png" in it.
# That also means the old shortcut still in here, but only correct one will be executed.
asus-1559960460:/opt/xandros/share/AsusLauncher> grep 'documents_hi' ./simpleui.rc
777:
1366:
3453:
3832:
4003:

# 12. Let's hack simpleui.rc
# First of all, we write a hello world in /root
asus-1559960460:/root> cat ./hello.sh
#!/bin/sh
echo "Hello World!!"
asus-1559960460:/root>

# 13. We add the following code in /opt/xandros/share/AsusLauncher/simpleui.rc
# It will create a top tab, a folder, and a button

Hack Me


Hack Me Folder


Hello


# 14. Restart AsusLauncher, but nothing happened!! What's wrong!!
>ps aux | grep Asus
104:root 10165 28.0 0.7 26156 15424 pts/2 S 17:30 0:01 /opt/xandros/bin/AsusLauncher
110:root 10230 0.0 0.0 2852 712 pts/2 S+ 17:30 0:00 grep --color -n Asus
> kill 10165
> /opt/xandros/bin/AsusLauncher &

# 15. Find where is simpleui.rc in AsusLauncher by "strings"
# Ok, we find the clue in /var/lib/Asuslauncher/simpleui.rc
asus-1559960460:/opt/xandros/bin> strings AsusLauncher | grep simple
947:%1/simpleui.rc
961:simplecat
980:/var/lib/AsusLauncher/simpleui.rc
981:Failed to load customized simpleui.rc.
982:Failed to open customized simpleui.rc.
983:Failed to load system simpleui.rc.
984:Failed to open system simpleui.rc.

# 16. Remodified /var/lib/Asuslauncher/simpleui.rc again
# OK, succeess!
As figure



Notations:
1. The all desktop figures are in /opt/xandros/share/AsusLauncher/
2. But the real simpleui.rc is in /var/lib/Asuslauncher/simpleui.rc

沒有留言: