2014/08/19

簡繁轉換 iconv, cconv, opencc,

這篇文章整理並比較了幾個簡繁轉換的工具
我拿來試了下 xml 檔的轉換,iconv 確實一直存在著字元集問題,使用 cconv 就沒有這個問題,語法範例如下:
for i in *xml; do echo $i; cconv -f UTF8-TW -t UTF8-CN -o out/$i $i; done
可以很簡單的將 utf8 的繁體轉換成 utf8 的簡體

等效的 iconv 大致如下:

for i in *xml; do echo $i; iconv -f utf8 -t big5 $i | iconv -f big5 -t gb2312 | iconv -f gb2312 -t utf8 -o out/${i}; done

iconv 除了不直接外,還無法轉換 BOM xml file, 有些字元也會出錯

可惜的是,我不會使用 opencc....不知道怎麼從繁體轉成簡體

2014/08/04

ubuntu 如何重新啟動 usb?

我的筆電怪怪的,有時開機后,一開始還可以用 usb, 例如 usb mouse, 可是開完機不久它就失效了,重新拔插也沒有用

老實講我不知道是什麼原因造成的,但是底下的方法可以讓它重新啟動:

for u in uhci_hcd xhci_hcd; do
  for i in $( ls /sys/bus/pci/drivers/$u/ | grep : ); do
    echo -n "unbind $u... ";echo $i | sudo tee /sys/bus/pci/drivers/$u/unbind;
    echo -n "bind.. $u... ";echo $i | sudo tee /sys/bus/pci/drivers/$u/bind;
  done

done

同樣道理,如果想重新啟動其他裝置也可以比照辦理。
其他相關的指令如:
lspci
lsusb
lshw

2014/05/19

ubuntu ffmpeg 不見了,替代方案?

太久沒用了,竟然突然找不到  ffmpeg, 連套件都沒了。
其實啊,用  avconv, 算是完整的替代方案,語法基本差不多,而且更簡潔,例如,不必再指定格式。
譬如原來的語法 ffmpeg -i $1 -ss $2 -t $3 -f image2 $4
現在只需要 avconv -i $1 -ss $2 -t $3 $4
甚至,可以直接從 m4v 切割一段,直接輸出成 mp3
avconv -i $1 -ss $2 -t $3 $4.mp3

其他我就不多說了喔,好用啊!

2014/04/16

android-x86 調整 data.img 大小

預設是 512M, 說真的是小了點,若要大一點的話,當然在安裝時請不要用預設的 512, 可以改用 8192 之類的

但是若已經安裝好的話呢?是有 windows 工具,這邊要講的是 ubuntu 下的工具, 怎樣不破壞原來的資料讓它變大呢?

三個動作:
# 先修復檔案系統的錯誤
$ e2fsck -fyc /media/wade/DATA/data.img

# 因為原來有 512M, 加上 7.5G, 也就是 7680 * 1M 就會變成 8G
$ dd if=/dev/zero of=/media/wade/DATA/data.img oflag=append conv=notrunc bs=1M count=7680

# 再來就是 resize...
$ resize2fs /media/wade/DATA/data.img

2014/04/09

ubuntu 更新後,選單/工具列 不見了

可以試試底下三種方法(擇一):
一、
  $ sudo dpkg-reconfigure unity
  $ sudo dpkg --configure -a

二、
  $ dconf reset -f /org/compiz/
  $ unity --reset-icons &disown

三、
  $ sudo apt-get install compizconfig-settings-manager 
  $ export DISPLAY=:0
  $ ccsm


install adobe air on ubuntu 64

請參考這兒 http://www.tkalin.com/blog_posts/installing-adobe-air-and-elance-tracker-on-ubuntu-13-10-saucy-salamander-64-bit

$ sudo apt-get install libxt6:i386 libnspr4-0d:i386 libgtk2.0-0:i386 libstdc++6:i386 libnss3-1d:i386 lib32nss-mdns libxml2:i386 libxslt1.1:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386    

sudo apt-get install libgnome-keyring0:i386

$ sudo ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0

$ sudo ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0

接下來就是去 adobe 下載來安裝,就不寫了

2014/03/21

哇,好快

新北市因為某些原因,不肯付錢給微軟,因此採購電腦時,不再使用微軟,而是採用 ezGO, 並要求學校開課教授 ezGO, 我想,這也算是我身邊發生的第一起微軟敗退案。當然,我知道很多熱心人士致力推廣自由軟體,至少,浪潮已經湧到我身邊來了。

言歸正傳,小羊小肯早就知道多重開機,早就知道 ubuntu, 也聽我念了很多次微軟怎樣怎樣不好,現在終於正式要學 ezGO 了,剛開學那陣子非常興奮,我就做了隨身碟開機給他們,結果一直到昨天,小羊才正式跟老師提,老師還真的說「你可以用隨身碟開機」,我都很懷疑他這個美術老師兼課的電腦老師到底懂不懂隨身碟開機啊!

其實,小羊小肯愛上 ezGO 是因為,上面有一個賽車遊戲,剛開學那週就看到了,隔週終於在課堂上玩,回家就很努力要玩,也因此更加遵守媽媽的約定,總之就是變更乖了。因為之前都是用媽媽的筆電,就算隨身碟開機很慢,但是他們沒感覺,原因就是跟學校比起來快多了。我在猜,學校的新電腦不應該比我家的慢,想必是學校是因為怕每次上課前要還原電腦麻煩,採用雲端安裝的方式吧,我猜。剛剛上網體驗了下,果然雲端啊!

小羊小肯在上了幾次課後,老是抱怨學校的開機很慢,平常在家,都是哥哥先拿我的筆電開機去玩, 話說這款賽車遊戲叫 supertuxkart, 我的 ubuntu 當然也可以安裝,但是他們喜歡用自己的帳號,喜歡用 ezGO, 所以才有先前的幾篇文章。總之,我的筆電現在可以讓他們用自己的隨身碟開機,也可以用我電腦裡的 ezGO iso 開機,也燒了光碟給他們光碟開機,當然也有 ezGO 硬碟版本的開機,花樣百出。昨天,小肯終於第一次用我的電腦「關機」,結果他發出驚嘆的口氣說,『哇,關機好快喔』。

話說,這款 supertuxkart 支援搖桿,我還特地去買了兩支,不知道這樣可不可以取代 WII? 想必還是差很遠吧,但是至少目前他們是真的玩的超開心的啊!

2014/03/14

淺談虛擬機、多重開機、多重編譯環境

好像上一篇也是相關文章?
最近需要 windows, ubuntu, 各種版本的 ubuntu, ezGO....
之前我是做在一支 8G usb disk 中含有 ubuntu, GeeXboX, tiny linux,....
最近因為需要 windows, 所以用虛擬機,譬如用 vmware player for ubuntu, 或是 virtualbox....
後來又需要 ezGO, 這個超肥的 kubuntu
工作上又需要舊版的 ubuntu 來保證編譯 各種晶片的 Android, (TI, MTK, BCM...),這個有的輕易就整合在同一個開發環境中,有的沒辦法

所以啦,也是以虛擬機的方式存在。當然,我的筆電算是相當高檔就是了。
還有一種方法,就是切割多個硬碟分割區,只是不見得有辦法做到這一點,或是拿 usb 3.0 的外接 usb disk, 只是這樣的速度怎麼也快不起來,效能或許也不輸虛擬機,但是虛擬機的好處是可以多個工作環境同時存在。

有一個非常古老的方法,叫做 chroot / debootstrap ....這邊不多說,有興趣的可以上網查。
chroot 不會像虛擬機那樣占用虛擬機的資源,環境也可以自行切開,相當好用。而且硬碟空間也少非常非常多。這邊只提醒一下:
在 chroot 之前,我是這樣下命令:
cd $CHROOT_DIR
for i in dev proc srv sys tmp dev/pts ; do echo $i;sudo mount --bind /$i $i; done
chroot . /bin/bash

不用的時候,重開機是個方法,不然就是反過來 umount
當然,若要非 debian/ubuntu 的系統,還是得虛擬機或多重開機囉!

2014/03/04

各種虛擬機的檔案轉換


轉自 http://blog.sleeplessbeastie.eu/2012/04/29/virtualbox-convert-raw-image-to-vdi-and-otherwise/


VirtualBox - convert RAW image to VDI and otherwise


VirtualBox command-line interface (VBoxManage) provides an easy way to convert raw disk image to the VDI/VMDK format and otherwise.
Let's assume that we have raw image of the sdb device:
$ sudo dd if=/dev/sdb of=./sdb.raw
To use it with VirtualBox we need to convert it to the VDI format:
$ VBoxManage convertdd sdb.raw sdb.vdi --format VDI
To use it with VMware we need to convert it to the VMDK format:
$ VBoxManage convertdd sdb.raw sdb.vmdk --format VMDK
Convert between VDI/VMDK formats:
$ VBoxManage clonehd sdb.vdi sdb.vmdk --format VMDK
$ VBoxManage clonehd sdb.vmdk sdb.vdi --format VDI
Convert to the RAW image:
$ VBoxManage clonehd sdb.vdi sdb.raw --format RAW
Alternative solution to get back raw image after applying modifications is to use qemu-img command from qemu package:
$ qemu-img convert -f vmdk sdb.vmdk -O raw sdb.raw
Now we can write image to the device:
$ sudo dd if=./sdb.raw of=/dev/sdb

2013/10/18

backup newer files

在編譯 browser, kernel, 或 android 時,會產生非常多的輸出,如果要把這些輸出檔備份下來,一個最簡單的方法是 tar --newer REF_DATE_OR_FILE -cf  BACKUP.tar
也就是建立一個參考的日期或檔案,然後找出比它新的將之 tar 起來

另外,若想得到這個清單,當然也可以在 tar 完後再用 tar -t 來取得。不過若不想建立 tar 檔時怎麼處理?底下是一個 shell-script,

$ cat list-file-timestamp
#!/bin/bash
EXE=$0
EXE=${EXE##*/}
DIR=$1
[ "x$DIR" = "x" ] && DIR='.'
[ ! -d $DIR ] && DIR='.'
FORMAT=$2
[ -f BUILD-DATE ] && BUILD_DATE=BUILD-DATE
[ "x$BUILD_DATE" = "x" ] && [ -f checkenv.log ] && BUILD_DATE=checkenv.log
[ "x$BUILD_DATE" = "x" ] && [ -f ./out/target/product/pandora_g2_check-dep.log ] && BUILD_DATE=./out/target/product/pandora_g2_check-dep.log
[ "x$FORMAT" = "x" ] && FORMAT='+'
OUT=/tmp/${EXE}.lst

echo "EXE=$EXE, OUTPUT=$OUT, DIR=$DIR FORMAT=$FORMAT"
find $DIR -type f -newer $BUILD_DATE -printf "%T${FORMAT} %p\n" | sort -n -r > $OUT

用法也相當簡單:
$ list-file-timestamp
$ list-file-timestamp out
$ list-file-timestamp out @

第二個範例是指定目錄,預設是 $PWD,也就是 .
第三個是指定輸出的日期 format, 請 man find 來查,在 -printf format 項下,預設是 +

用 tar 的缺點當然就是耗時耗磁碟

可是如果已經透過上面的 list-file-timestamp 建立檔案清單了,該怎樣將它備份呢?最簡單的想法是:
$ tar cf BACKUP.tar `cat LIST_FILE`
通常會因檔案太多,無法使用上面的命令,這時候可以考慮用 xargs
$ cat LIST_FILE | xargs tar uf BACKUP.tar

不過,老實講, tar 相當慢,還可以用下面的方法:
$ cat LIST_FILE | xargs -I % cp --parents % ../BACK_DIR
上面 xargs -I % 是用來指定傳給 xargs 的參數,因為預設這個參數會加在命令的最後
而 cp --parents 則是保留目錄結構

2013/10/17

縮小 vmware ubuntu vmdk 虛擬磁碟影像檔 shink

有二個步驟,先是開啟 Guest OS, 將它的剩餘磁碟空間清乾淨,這樣才有辦法壓縮
$ cat /dev/zero > zero.fill; sync; sleep 1; sync; rm -f zero.fill

可以看到普通使用者也可以進行,當然這是因為系統沒有設定 QUOTA, 建議可以保險點用 sudo 來進行,例如:
$ sudo cat /dev/zero > zero.fill; sync; sleep 1; sync; sudo rm -f zero.fill

再來就是在 HOST OS 中將它壓縮,一般網路上查到的作法分兩步,第一個就是「磁碟重整」,再來才是壓縮。但是經過實驗,可以合併成一步:

C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager -r D:\my.vmdk -t 0 D:\my-vmdk-shrink.vmdk

2013/09/18

ubuntu amd64 編譯 x86.deb for kernel

照理,編譯 kernel 有很多方法,這篇值得參考

但是,若需要編譯給別種架構的 CPU 的話,又想要編譯出 debian pkg 的話怎麼辦?

在編譯時有個 KBUILD_DEBARCH 選項可以用,範例如下:
make KBUILD_DEBARCH=i386 deb-pkg
當然,文件中有說明,請參見 Documentation/kbuild/kbuild.txt

2013/09/11

tar backup

tar 非常好用,很顯然的,因為太好用,常常都不知道怎麼用!怪哉。

寫過 daily update backup file 每日更新備份檔
事實上要備份還有更多工具,我也沒有想要函蓋全部的企圖,這邊只是寫下我比較愛用的方式

LOCAL MACHINE

Copy A/ ==> B/
$ cd A; tar cf - . --exclude=.git | (cd B/ && tar xBf -)

REMOTE MACHINE

Copy A/ ==> M:B/
$ cd A; tar cf - . --exclude=.git | rsh M 'cd B/ && tar xBf -'

替代的有如 scp....

tar 的好處可以過濾掉某些不要的檔,如範例中的 .git
也可以只備份較新的檔,例如

tar --newer-mtime="`date -r REF-FILE`" cf - --exclude=.git | (cd B/ && tar xBF -)


2013/09/04

顯示隱藏裝置

唉,離不開 Windows...

話說,我的 skype 在 win8 中一直無法使用,今天突然好了~~~

不知道是否有人想要把『隱藏的裝置』刪掉的需求?譬如,某些廠商提供的工具,竟然限定 COM port 只能在 1-6....可是在插拔過程中,我的 COM Port 都跑到不知道多少去了,總之,絕不在1-6!!!!

那怎麼辦咧?一個辦法是拿程式來改,另一個是把沒插在電腦上的,也就是被隱藏起來的裝置移除~~請見 http://support.microsoft.com/kb/315539

剪貼一下上面網址的內容:

如果要解決這個問題,並在您按一下 [顯示隱藏裝置] 時顯示相關裝置:
  1. 按一下 [開始],依序指向 [程式集] 及 [附屬應用程式],再按一下 [命令提示字元]
  2. 在命令提示字元中輸入下列命令,然後按下 ENTER:
    set devmgr_show_nonpresent_devices=1
  3. 在命令提示字元中輸入下列命令,然後按下 ENTER:
    start devmgmt.msc
  4. 疑難排解「裝置管理員」中的裝置和驅動程式。

    注意:請先在裝置管理員的 [檢視] 功能表上按一下 [顯示隱藏裝置],以顯示未連線至電腦的裝置。
  5. 完成疑難排解後,關閉「裝置管理員」。
  6. 在命令提示字元中輸入 exit

    請注意,關閉命令提示字元視窗時,Window 會清除您在步驟 2 中所設定的 devmgr_show_nonpresent_devices=1 變數,避免隱藏連線的裝置在您按一下 [顯示隱藏裝置] 時顯現。

把影片轉成 DVD

老實說,我家算很落後,影片只有DVD Player, 其他格式很難在我家流通
小羊用 M$ Movie Maker 做出來的影片,他也會燒在光碟片中,可是就很難享受它的內容
這邊介紹兩個:
一個叫  格式工廠, 參考介紹如下
http://www.azofreeware.com/2008/10/formatfactory-155.html

一個叫 DVD Styler, 參考介紹如下
http://www.azofreeware.com/2010/02/dvdstyler-1801.html

2013/09/03

把開機光碟做在 usb disk 中 boot from usb

久沒用就忘了,還是寫下來的好

如果你想把某一片開機光碟放在隨身碟中,你會怎麼做?
有個簡單的工具: http://sourceforge.net/projects/unetbootin/files/latest/download
要教學步驟嗎?請見這兒 

2013/08/13

ubuntu CPU loading 狀態列不見了

標題怪怪的啊,在 ubuntu 11.04 之後,因為換風格,無法加入 CPU LOADING, 其實加法如下:
1. 安裝 indicator-multiload
2. 叫出來

因為有人都做好影片了,直接觀看吧

http://www.youtube.com/watch?v=C8vMoSilwQo

2013/08/12

如何防止 visual studio 產生超大檔 .sdf

有兩個想法,一個是關閉 database, 一個是將它設在系統資料夾

前者見 http://stackoverflow.com/questions/8635219/how-to-prevent-visual-studio-2010-adding-large-sql-file-to-my-project-in-c

後者見 http://stackoverflow.com/questions/7706984/visual-studio-2010-c-project-remove-sdf-file

建議是用後者,這樣的話在原始碼目錄不會見到它,卻又可以在 visual studio 中使用它的好處

2013/07/24

windows 修改 registry 的方法

程式化的方法就不說了,命令列的方式可以如下:

cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
或是匯入的
Cmd /c reg import c:\test.reg
當然,也可以用檔案總管來執行 .reg 檔

2013/07/22

windows undocumented secret 不傳之秘

請參考這兒....話說,怎麼會跑回來看這種秘技?常常灌了不知道什麼東西,讓瀏覽器動作怪怪的,也許在底下可以找到原因!

1. 當使用者登入系統時,在這個機碼(key)下的的程式或Script會被自動執行起來:
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\
HKLM\Software\Microsoft\Windows\CurrentVersion\Run\
HKCU\Software\Microsoft\Windows\CurrentVersion\Run\
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce\
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce\Setup\
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx\
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices\ 
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce\
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\load\
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\run
HKLM\Software\Policies\Microsoft\Windows\System\Scripts\
HKCU\Software\Policies\Microsoft\Windows\System\Scripts

參考:
How to Modify the List of Programs that Run When You Start Windows XP (http://support.microsoft.com/kb/314488).
A definition of the Run keys in the Windows XP registry (http://support.microsoft.com/kb/314866/EN-US/).
INFO: Run, RunOnce, RunServices, RunServicesOnce and Startup (http://support.microsoft.com/kb/179365/EN-US/).
Definition of the RunOnce Keys in the Registry (http://support.microsoft.com/kb/137367).
Description of the RunOnceEx Registry Key (http://support.microsoft.com/kb/310593/EN-US/).
Programs Automatically Start When User Logs on to Windows (http://support.microsoft.com/kb/147369).
Script Policy Is Not Run When a Slow Link Is Detected (http://support.microsoft.com/default.aspx?scid=kb;en-us;328991).
To assign user logoff scripts (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/gptext_logoffscripts.mspx?mfr=true).

2. 當IE啟動時,在這個機碼下的元件(in-process COM components)每次都會被IE載入,這就是在IE上看到的工具列:
HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\

參考:
How to disable third-party tool bands and Browser Helper Objects (http://support.microsoft.com/default.aspx?scid=kb;en-us;298931).
Browser Helper Objects: The Browser the Way You Want It (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebgen/html/bho.asp).

3. 預設值為'"%1" %*'(沒有單引號)。有些惡意程式會把它修改為'"FileName "%1" %*',當執行可執行檔(.exe)時,檔案"FileName"也會被執行起來:
HKLM\Software\Classes\exefile\shell\open\command\
HKEY_CLASSES_ROOT\vbsfile\shell\open\command\ (差別在於它是Visual Basic Script檔(.vbs))
HKEY_CLASSES_ROOT\vbefile\shell\open\command\ (差別在於它是編碼過的Visual Basic Script檔(.vbe))
HKEY_CLASSES_ROOT\jsfile\shell\open\command\ (差別在於它是JavaScript檔(.js))
HKEY_CLASSES_ROOT\jsefile\shell\open\command\ (差別在於它是編碼過的JavaScript檔(.jse))
HKEY_CLASSES_ROOT\wshfile\shell\open\command\ (差別在於它是Windows Scripting Host檔(.wsh))
HKEY_CLASSES_ROOT\wsffile\shell\open\command\ (差別在於它是Windows Scripting File檔(.wsf))
HKEY_CLASSES_ROOT\comfile\shell\open\command\ (差別在於它是COM檔(.com))
HKEY_CLASSES_ROOT\batfile\shell\open\command\ (差別在於它是批次檔(.bat))
HKEY_CLASSES_ROOT\scrfile\shell\open\command\ (差別在於它是螢幕保護檔(.scr))
HKEY_CLASSES_ROOT\piffile\shell\open\command\ (差別在於它是Portable Interchange Format檔(.bat))

參考:
You Are Unable to Start a Program with an .exe File Extension (http://support.microsoft.com/default.aspx?scid=kb;en-us;310585).
You receive an error message when you try to start a program that has an .exe file name extension (http://support.microsoft.com/kb/837334/en-us).

4. 每次啟動CMD.exe時,在這個機碼下的命令會被執行:
HKLM\Software\Microsoft\Command Processor\AutoRun\
HKCU\Software\Microsoft\Command Processor\AutoRun\

參考:
WORM_SWEN.A (http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=WORM%5FSWEN%2EA&VSect=T)
Cmd (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true).
AutoRun (http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/942.asp).

5. 在這機碼下的CLSID會對應到HKLM\Software\Classes\CLSID\{GUID}\InProcServer。每當IE啟動時,它們會被IE載入:
HKLM\Software\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad\
HKCU\Software\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad\

參考:
TROJ_YABE.H (http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ_YABE.H&VSect=Sn).
Download.Ject Payload Detection and Removal Tool (http://support.microsoft.com/default.aspx?scid=kb;en-us;873018).

6. 可以自訂不同的使用者介面:
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\Shell\

參考:
Shell (http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/93488.asp).

7. 包含被允許的Shell Extensions表列:
HKLM\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved\

8. 當使用者登入系統時,在這個機碼裡的DLLs會被Windows-based應用程式載入(DLL Injection的一種方法):
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs

參考:
Working with the AppInit_DLLs registry value (http://support.microsoft.com/default.aspx?scid=kb;en-us;197571).

9. 當Windows NT會執行標準的GINA DLL(MSGina.d)。當GinaDLL機碼存在時,在這機碼下面的DLL會被Winlogon在載入:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\GinaDLL\

參考:
Windows NT loads and executes the standard Microsoft GINA DLL (MSGina.dll). If the GinaDLL key value is present, it must contain the name of a GINA DLL, which Winlogon will load and use.
Loading and Running a GINA DLL (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/loading_and_running_a_gina_dll.asp).

10. 這個機碼可以更改原來的SHell(explorer.exe)且在這機碼下的執行檔會被Userinit.exe啟動:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell

參考:
Shells Other Than Explorer.exe Replaced on Installation or Upgrade (http://support.microsoft.com/default.aspx?scid=kb;en-us;228309).

11. 在這機碼下的程式會在System Mode被啟動:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\System

參考:
System (http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/58543.asp).

12. 可以定義系統所使用的工作管理員:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\TaskMan

參考:
TaskMan (http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/58543.asp).

13. 當使用者登入系統時,在這機碼下的程式會被Winlogon執行。預設是Userinit.exe:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\UserInit

14. 在這機碼下的DLLs會接收和處理由Winlogon產生的事件(event):
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\

參考:
Winlogon Notification Packages (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/registry_entries.asp).

15. 當系統啟動時,在這個機碼裡的程式會被執行:
HKLM\System\CurrentControlSet\Control\Session Manager\BootExecute

參考:
BootExecute (http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/46697.asp).

16. 在這機碼下的服務,大部份會以LocalSystem的權限啟動:
HKLM\System\CurrentControlSet\Services\

17. 微軟使用這個機碼來設定已經安裝的視窗元件(Windows component):
HKLM\Software\Microsoft\Active Setup\Installed Components\

參考:
TROJ_SMALL.AZX (http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ%5FSMALL%2EAZX&VSect=T).
Backdoor.Plux (http://securityresponse.symantec.com/avcenter/venc/data/backdoor.plux.html).
Monitoring of the Active Setup Registry Key (http://www.greatis.com/webhelp/regrunhelp.htm#regrun___detailed_instructions/start_control/active_setup_registry_key.htm).

18. 這個機碼記錄現行使用者(Current User)的啟動目錄(「開始」功能表=>程式集=>啟動,亦即,%USERPROFILE%\「開始」功能表\程式集\啟動):
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Startup
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Startup (如果上一列機碼不存在,它會用這個機碼)

HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\User Shell Folders\Common Startup (這個機碼記錄所有使用者的啟動目錄(「開始」功能表=>程式集=>啟動,亦即,%ALLUSERSPROFILE%\「開始」功能表\程式集\啟動))
HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Startup (如果上一列機碼不存在,它會用這個機碼)

19. 在這機碼下的子機碼記載每個程式的路徑和完整的執行路徑名稱:
HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\

20. 這是用來檢查應用程式的問題,但惡意程式會利用它,以達到執行的目的:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\

參考:
Inside 'Image File Execution Options' debugging (http://blogs.msdn.com/greggm/archive/2005/02/21/377663.aspx).
How to Enable Kerberos Debugging in Windows 2000 (http://support.microsoft.com/default.aspx?scid=kb;en-us;892894;http://support.microsoft.com/default.aspx?scid=kb;en-us;216052).

21. 在這機碼下COM Objects會記錄執行的命令。預設值是shell32.dll:
HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellExecuteHooks\

參考:
Logging the Shell Activity (http://www.codeguru.com/Cpp/COM-Tech/shell/article.php/c4515/#more).
Windows Core (http://www.greatis.com/webhelp/regrun___detailed_instructions/start_control/windows_core.htm).
Creating a shell extension with C# (http://www.codeproject.com/csharp/dateparser.asp).

  * Folder Autostart Locations



1. %USERPROFILE%\「開始」功能表\程式集\啟動
2. %ALLUSERSPROFILE%\「開始」功能表\程式集\啟動
3. %SystemRoot\Tasks (排程工作的目錄)

  * File AutoStart Locations



1. %SystemDrive%\explorer.exe:EXPLORER.EXE是Windows的檔案總管程式,正常位置是在%SystemRoot %目錄內。某些人會使用的一個技巧,就是在C:\目錄底下產生一個同樣取名為explorer.exe。當Windows在開機時,並未指定 explorer.exe應該在哪個目錄底下,所以,開機時會從根目錄開始尋找該檔案來執行。

2. %SystemDrive%\autoexec.bat

參考:
http://en.wikipedia.org/wiki/AUTOEXEC.BAT

3. %SystemDrive%\config.sys

參考:
http://en.wikipedia.org/wiki/CONFIG.SYS

4. wininit.ini: 是Windows在開機時用來預先載入某些應用程式的方法。
舉例說明:

shell=explorer.exe virusfile.exe

5. winstart.bat

6. win.ini: 是載入系統設定,例如驅動程式、桌布畫面等等。
舉例說明:

load=virusfile.exe
run=virusfile.exe

7. hosts

參考:
http://en.wikipedia.org/wiki/Hosts