¤j³°ªº¤Q¦h»õ¤H¤f²£¥ÍªºÀɮ׼ƶq¡A¤é¯q¼W¦h¡C¦³®É¥²¶·¤U¸ü¬°¼Æ²³¦hªºÀɮסAÆ[¨ä¤º®e¦h¬°Â²Åé¦r¡A´N³sÀɮצWºÙ¡A¤]³£¬O²Åé¦r¡CÁöµM¤p¤ì°¸¤]¬Ý±oÀ´¡A¦ý²¦³º¤£¦p¥¿Åé¦r¨Ó±o¿Ëªñ¡C¦]¦¹¤ß¤¤¦³¤@ªÑ½Ä°Ê¡A·Q§â³o¨Ç§t¦³Â²Åé¦rªºÀɦW¡A³£Âà´«¦¨¥¿Åé¦r¡C¤]³\¦³¤H·|°Ý¡A¬°¦ó¤£¤]¶¶¹D§âÀɮפº®e¤]§ï¦¨¥¿Åé¦r©O¡H³o¬O¦]¬°¡A¨C¤@ºØÀɮ׮榡³£¤£ºÉ¬Û¦P¡A©Ò¥HÃø«×¤Ó°ª¡A¤p¤ì°¸¶È¾Ì¤@¤H¤§¤O¡AÃø¥H°µ¨ì¡C©³¤U¡A¥u±Ôz§â§t¦³Â²Åé¦rªºÀɦW§ï¦¨¥¿Åé¦rªº¹Lµ{¡C
¬d¾\ºô»Úºô¸ô¤Wªº¸ê®Æ¡A¦h¬°§â²Åé¦r¶K¦bºô¶¤Wªº½s¿è®Ø¡AµM«áÂà´«¦¨¥¿Åé¦r¡A¦A¶K¦^줺®e¤W¡A´N¯à§âì¨ÓªºÂ²Åé¦r¨ú¥N¬°¥¿Åé¦r¡C¤]³\¤p¤ì°¸©t®¹è»D¡A¤S©Î³\·j´M¯à¤O®t¡AÁ`¬O¬d¤£¨ì¯à§âÀɮצWºÙ¤¤ªºÂ²Åé¦r¡A§ï¦¨¥¿Åé¦r¡F§ó¬d¤£¨ì¯à¤@¦¸¤j¶qÂà´«ªºµ{¦¡¡C©ó¬O¤ßùØ·Q¡A¤£¦p¦Û¤v¼g¤@Ó§a¡C
¤p¤ì°¸¬d¤Fºô¸ô¡Aµo²{¥¿Åé¦r¦@¦³¼Æ¸U¦r¡A²Åé¦r¤]¦³¼Æ¦ÊÓ¡A·íµMµLªk¤@Ó¦r¤@Ó¦r¦C¥X¨Ó¡A§ó¹N½×°µ¹ïÀ³ªí¡C©¯¦n¤p¤ì°¸¬d¨ì¡A¦b¥Á°ê¤@¦Ê¦~¦Ü¤@¦Ê¹s¥|¦~¶¡¡A±Ð¨|³¡°µ¤F±`¥Îµü»y½Õ¬d¡A¨Ã¥B¦³¤F³ø§i¨Ã¤½½Ñ©ó¥@¡A¦b±`¥Î°ê»yµü»y³ø§iùØ¡A¥i¥H¨£¨ì³o¨Çµ²ªG¡C¹ï¤p¤ì°¸¦³¥Îªº¬O¦b¡m¤@¹s¹s¦Ü¤@¹s¥|¦~±`¥Î»yµü½Õ¬d³ø§i®Ñ¡n¡]¤¤¡^¡A¨ä¤¤ªºªþ¿ý¤Q¤K¡Cªþ¿ý¤Q¤K¡A¨ä¹ê¬O¥Á°ê¤@¦Ê¹s¥|¦~ªº¦rÀWÁ`ªí¡A¤U¸ü«áÀɦW¬O¡uªþ¿ý18_¥Á°ê104¡v¡A¦ü¥GµL±q§PÂ_n¥Îþ¤@ºØ³nÅé¶}±Ò¡C©¯¦n¤p¤ì°¸¦b¸Óºô¶¥ª°¼¡Aµo²{¦³¨âÓ¼ÐÅÒ¶¡A¹Ï¤ù»P¤å¥ó¡AÂI¿ï¤å¥ó¡Aµo²{¦³¡uªþ¿ý18_¥Á°ê104 ¦~±`¥Î»yµü½Õ¬d»y®Æ²Îp¤ÀªR¦rÀWªí.xls¡vªº¦r¼Ë¡C©ó¬O¥Î¡uExcel¡v¶}±Ò¡A³ºµMŪ¨ú¦¨¥\¤F¡CŪ¨ú¤§«á¡A¦@¦³¤»ÓÄæ¦ì¡A¨Ì§Ç¬O¡u¦rÀW¶¶§Ç¡v¡B¡u¦r¡v¡B¡u¦rÀW¡v¡B¡u²Ö¿n¦rÀW¡v¡B¡u«e¤@¦Ê¦W°ªÀW¦r²Ö¿n¦Ê¤À¤ñ¡v¡B¡uÁ`¦r¼Æ²Ö¿n¦Ê¤À¤ñ¡v¡C
¡uªþ¿ý18_¥Á°ê104¡vÀɮתº«Ø¥ß¹Lµ{¬O±q¦~«×ºZ¾P®Ñ¤ÎÂø»x¡B¤¤j³ø¯È¡B±Ð¬ì®Ñ¡B¤H®ð³¡¸¨®æ¡B½Í¸Ü©Ê¸`¥Øªº¦r¹õ¡A¦@¦³¤@¦Ê¤E¤Q¸U¦r¡CµM«á¤ÀªR³o¨Ç¦r¥X²{¦¸¼Æ¡A¥Ñ³Ì±`¥X²{ªº¡uªº¡v¶}©l©¹¤U±Æ¡A¨ì³Ì¤Ö¥X²{ªº¦r¬°¤î¡A»s§@¦¨¤@±i¦³ 5289 Ó¦rªºªí®æ¡C³oºØ¨Ì·Ó¥X²{¦rªºÀW²v¦h¹è¡A±Æ¦¨ªºªí®æºÙ¬°¡u¦rÀWÁ`ªí¡v¡C¹ï©ó¤p¤ì°¸n»s§@ªºµ{¦¡¦Ó¨¥¡A¥u»Ýn²Ä¤GÄæ§Y¥i¡C·Q¹³¤@¤U¡A°²¦pn§â²Åé¦rÂà´«¦¨¥¿Åé¦r¡A¥²©wn¦³¤@±i³o¨âºØ¦rªº¹ï·Óªí¡A¬dªí®É¥ý¥Ñ²Ä¤@µ§¸ê®Æ¬d©¹¤U¬d¡Aª½¨ì§ä¨ìnÂà´«ªºÂ²Åé¦r¡A¦A¬d¾\¹ïÀ³ªº¥¿Åé¦r§Y¥i¡C¬°¤FÅýµ{¦¡¯à«Ü¦³®Ä²vªº¬dªí¡A¶V±`¥X²{ªº¦r¡A´NÀ³¸Ó©ñ¦b¶V«e±¡A³o¤]´N¬On¨Ï¥Î¦rÀWÁ`ªíªºì¦]¡C©³¤U¡A¤p¤ì°¸´yz±q¡uªþ¿ý18_¥Á°ê104¡v¶}©l¡A¦p¦ó»s§@¥¿Åé¦r»P²Åé¦r¹ï·Óªíªº¨BÆJ¡G
¨ì¦¹¬°¤î¡A¤p¤ì°¸¤w¦³¨âÓÀɮסA¡uftc.txt¡v»P¡ufsc.txt¡v¡A¥¦Ì´N¬O¥¿Åé¦r»P²Åé¦rªº¹ï·Óªí¡A¦Ó¥B¬O«ö·Ó¥X²{ÀW²v±Æ¦Cªº¹ï·Óªí¡C³o¨âÓÀɮסA¨C¤@Àɮצ³ 5289 Ó¦r¡A¨ä½s½X½d³ò³£¬O 4837h¡ã0ff5eh ( µù¤@)¡C©ó¬O¤p¤ì°¸¤ß¤¤¹¿©B¤F¡A¦]¬°·Ó²z¨Ó»¡¡A±`¥Î¤¤¤å¦rªº¸U°ê½X¡A¤£½×¬O¥¿Åé¦r©Î²Åé¦r¡A³£½s¦b 4e00h¡ã9fa5h ªº½d³ò¤º¡A¦Ó¥B©M¤é¤å¡BÁú¤å§Îª¬¤@¼Ë©Îµy²§ªºªí·N¤å¦r¡A³£²Î¤@½s½X¦b³oÓ½d³ò¤º¡AºÙ¬°¡u¤¤¤éÁú²Î¤@ªí·N¤å¦r¡v( CJK Unified Ideographs )¡A«ç·|¶]¨ì 4837h¡ã0ff5eh ©O¡H¸g¹L¥J²Ó®Ö¹ï¡]¨ä¹ê¬O¼g¤FÓµ{¦¡Àˬd¡^¡A¤~ª¾¹D¸U°ê½X 4837h ¬O°ª¡u䠷¡vªº¡u䠷¡v¡F¦Ó 0ff5eh «h¬O¡u¡ã¡v¦r¡C¤ß·Q³o¨âÓ¦r¥¿Åé¦r»P²Åé¦r¬O¬Û¦Pªº¡A¦]¦¹§â³o¨â¦r§R°£¤F¡C³o¼Ëªº¸Ü¡A¡uftc.txt¡v»P¡ufsc.txt¡v¨C¤@Àɮצ³ 5287 Ó¦r¡F¡uftc.txt¡vªº½d³ò¬O 4e00h¡ã9fa2h¡A²Åé¦r½d³ò¬O 4e00h¡ã9f9fh¡C¦p¦¹¤@¨Ó¡A·j´M½d³ò¸û¤p¡A¸û¦³®Ä²v¡C
¦³¤F³o¨âÓÀɮפ§«á¡A¤p¤ì°¸¥´ºâ¶i¤@¨B§â³o¨âÓÀɮתº¨CÓ¦r¡A¥H¸U°ê½Xªº½s½X¤è¦¡¡A§Y UTF-16¡A¼g¤J²Õ¦X»y¨¥ì©l½Xùر¡C³o¨âÓÀɮסA¨C¤@Àɮצ³ 5287 Ó¦r¡C¤p¤ì°¸¬O·Q§â³o¨âÓÀÉ®×»s§@¦¨¤@±i«Ü¤jªº¹ï·Óªí¡A©ñ¦b¸ê®Æ¬qùØ¡A¹³©³¤Uªº¼Ë¤l¡G
.CONST TCH DW 7684h,662fh,4e00h,4e0dh,6709h,5728h,4ebah,6211h,9019h,4e86h,4ee5h,5927h,500bh,6703h,70bah,4f86h ............................................................................................... SCH DW 7684h,662fh,4e00h,4e0dh,6709h,5728h,4ebah,6211h,8fd9h,4e86h,4ee5h,5927h,4e2ah,4f1ah,4e3ah,6765h ...............................................................................................
¤W± TCH ¬O¥¿Å餤¤åªº·N«ä¡A¥ç§Y Traditional Chinese ¤§·N¡A¦Ó SCH ´N¬O²Å餤¤å¡ASimplified Chinese ªº·N«ä¡CTCH ©Ò©w¸q¸ê®Æªº²Ä¤@Ó¦r²Õ 7684h¡A¬O¡uªº¡vªº¸U°ê½X¡A¦Ó SCH ©Ò©w¸qªº²Ä¤@Ó¦r¤]¬O 7684h¡A¤]¬O²Åé¦rªº¡uªº¡v¡A¥¿¡B²Åé¦r¬Û¦P¡C¡uªº¡v¬O¤¤¤å¦r¤¤³Ì±`¥Îªº¦r¡A¦]¦¹±Æ¦b²Ä¤@¦ì¡C¦P¼Ëªº¡A²Ä¤GÓ±`¥Îªº¦r¬O¡u¬O¡v¡A¨ä¥¿Åé¦r»P²Åé¦rªº¦r½X³£¬O 662fh¡C±q¤W±ªº¹Ï¤Î¸ê®Æ¬qªº³¡¥÷¸ê®Æ¨Ó¬Ý¡A¥i¥H¦³¨âÂIµ²½×¡G
©³¤Uªºµ{¦¡¡Ach_to_asm_dw.asm¡A¬O¥Î¨Ó§â ftc.txt ©M fsc.txt Âà´«¦¨ TCH »P SCH ¦r¦ê¡C³o¼Ë´N¦³¤F¹ï·Óªí¡C
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
25 26 27 28
29 30 31 32
33 34 35 36
37 38 39 40
41 42 43 44
45 46 47 48
49 50 51 52
53 54 55 56
57 58 59 60
61 62 63 64
65 66 67 68
69 70 71 72
73 74 75 76
77 78 79 80
81 82 83 84
85 86 87 88
89 90 91 92
93 94 95 96
97 98 99 100
101 102 103 104
105 106 107 108
109 110 111 112
113 114 115 116
117 118 119 120
121 122 123 124
125 126 127 128
129 130 131 132
133 134 135 136
137 138 139 140
141 |
;§â¥¿Åé¦r»P²Åé¦rªº¦rÀWÁ`ªí¡]ÀɦW¤À§O¬O¡uftc.txt¡v»P¡ufsc.txt¡v¡^¡AÂà´«¦¨²Õ¦X»y¨¥ªº¡uDW¡v±Ôz
OPTION CASEMAP:NONE
.586
.MODEL FLAT,STDCALL
__UNICODE__ EQU 1 ;¤ä´©UNICODE
INCLUDE WINDOWS.INC
INCLUDE KERNEL32.INC
INCLUDE USER32.INC
INCLUDELIB KERNEL32.LIB
INCLUDELIB USER32.LIB
;*************************************************************************************************************
.CONST
szTradCh DW 66h,74h,63h,2eh,74h,78h,74h,0h ;ftc.txt
szSimpCh DW 66h,73h,63h,2eh,74h,78h,74h,0h ;fsc.txt
szAsm DW 83,67,72,95,65,78,68,95,84,67,72,95,84,66,76,46,73,78,67,0 ;SCH_AND_TCH_TBL.INC
sMsg00 DW 6210h,529fh,5efah,7acbh,53h,43h,48h,5fh,41h,4eh,44h,5fh,54h ;¦¨¥\«Ø¥ßSCH_AND_T
DW 43h,48h,5fh,54h,42h,4ch,2eh,49h,4eh,43h,3002h ;CH_TBL.INC¡C
sMsg01 DW 958bh,555fh,66h,74h,63h,2eh,74h,78h,74h,5931h,6557h,3002h ;¶}±Òftc.txt¥¢±Ñ¡C
sMsg02 DW 958bh,555fh,66h,73h,63h,2eh,74h,78h,74h,5931h,6557h,3002h ;¶}±Òfsc.txt¥¢±Ñ¡C
sTrCh DB "TCH DW "
sSiCh DB "SCH DW "
sDW DB " DW "
szHexFmt DB "%xh",0
;*************************************************************************************************************
.DATA?
hOutput HANDLE ? ;¼Ð·Ç¿é¥X¸Ë¸m¥N½X
hFileTrad HFILE ? ;¥¿Åé¦r¦rÀWªíªºÀÉ®×¥N½X
hFileSimp HFILE ? ;²Åé¦r¦rÀWªíªºÀÉ®×¥N½X
hFileAsm HFILE ? ;²Õ¦X»y¨¥ì©l½X¡A¥Î¨Ó¦s©ñ¥¿Åé¦r»P²Åé¦rªº¹ï·Óªí
hMemText HGLOBAL ? ;
hMemAsm HGLOBAL ? ;
TradFileSize DD ? ;¥¿Åé¦rÀɮתø«×
SimpFileSize DD ?
;*************************************************************************************************************
.CODE
;-------------------------------------------------------------------------------------------------------------
;word_to_asm_dw°Æµ{¦¡·|§âpSour©Ò«ü¦r¦ê¡AÅܦ¨²Õ¦X»y¨¥©w¸q¦r²Õªº¤º®e¡C¨Ò¦p¡uªº¡vªº¸U°ê½X¬O7684h¡Aword_to_asm_dw
;´N·|§â¡uªº¡vÅܦ¨¡uDW 7684h¡v¡Cword_to_asm_dw¤£³B²zBOM¡A§Y¹J¨ì0feffh¡A´N¸õ¹L¤£³B²z¡C
;¿é¤J¡GpSour¡Ð¨Ó·½¦r¦ê¡A¨CÓ¦r¦û¤@¦r²Õ
;¡@¡@¡@pTarg¡Ð¦s¤JÂà´««áªº¥Øªº¦ì§}
;¡@¡@¡@pStrName¡Ð¥Î¨Ó«ü©w¦r¦ê¦WºÙ
;¡@¡@¡@nLen¡ÐpSour©Ò«ü¦r¦êªø«×¡A¥H¦ì¤¸²Õ¬°³æ¦ì
;¿é¥X¡GEAX¡Ð¦bpTarg©Ò«ü¦ì§}¤¤¡A¼g¤J¦h¤Ö¦ì¤¸²Õ
word_to_asm_dw PROC USES esi edi ebx pSour:DWORD,pTarg:DWORD,pStrName:DWORD,nLen:DWORD
LOCAL datum:DWORD ;¦bASMÀÉùØ¡A¨C¦æ¤w¸g³B²z¨ì²Ä´Xµ§¸ê®Æ¤F
LOCAL last_address:DWORD ;pSour©Ò«ü¦r¦ê³Ì«á¦ì§}
LOCAL temp_area[16]:BYTE
mov ebx,pSour
mov edi,pTarg
mov last_address,ebx
.IF WORD PTR [ebx]==0feffh
add ebx,2
.ENDIF
mov eax,nLen
add last_address,eax
mov esi,pStrName
jmp move_str
new_line: mov esi,OFFSET sDW
move_str: mov ecx,SIZEOF sDW
rep movsb
mov datum,ecx
xor eax,eax
next_data: mov ax,[ebx]
INVOKE wsprintfA,ADDR temp_area,OFFSET szHexFmt,eax
add ebx,2
mov ecx,eax
lea esi,temp_area
cmp BYTE PTR [esi],"a"
jb arabic_number
mov al,"0"
stosb
arabic_number: rep movsb
cmp ebx,last_address
jae finish
inc datum
cmp datum,10h
je line_feed
mov al,","
stosb
jmp next_data
line_feed: mov ax,0a0dh
stosw
jmp new_line
finish: mov ax,0a0dh
stosw
mov ecx,edi
sub ecx,pTarg
ret
word_to_asm_dw ENDP
;-------------------------------------------------------------------------------------------------------------
;¥ýŪ¨ú¡uftc.txt¡vªº¤º®e¡A¦s¤JhMemTextùØ¡A¦AÂà´«¦¨¡uDW¡v¡A³Ì«á§âÂà´««áªº¯Â¤å¦r¦s¤JhMemAsmùØ
;¦AŪ¨ú¡ufsc.txt¡vªº¤º®e¡A¦s¤JhMemTextùØ¡A¦AÂà´«¦¨¡uDW¡v¡A³Ì«á§âÂà´««áªº¯Â¤å¦r¦s©ó¤W±°O¾ÐÅé°Ï¶ô¤§«á
main PROC
LOCAL BytesDeal:DWORD
INVOKE GetStdHandle,STD_OUTPUT_HANDLE ;¨ú±o¼Ð·Ç¿é¥X¸Ë¸m¥N½X
mov hOutput,eax
;¶}±Ò¥¿Åé¦rÀWªíªºÀɮסA¨ÃŪ¨úÀɮשҦ³¤º®e¡A¦s¤JhMemText°O¾ÐÅé°Ï¶ôùØ¡AµM«áÃö³¬¸ÓÀÉ®×
INVOKE CreateFile,OFFSET szTradCh,GENERIC_READ,1,0,3,FILE_ATTRIBUTE_NORMAL,0
.IF eax==INVALID_HANDLE_VALUE
mov edx,OFFSET sMsg01
open_error: INVOKE WriteConsole,hOutput,edx,SIZEOF sMsg01/2,ADDR BytesDeal,0
mov eax,1
jmp exit
.ENDIF
mov hFileTrad,eax
INVOKE GetFileSize,hFileTrad,0
mov TradFileSize,eax
add eax,800h
and eax,0fffffff0h
INVOKE GlobalAlloc,GPTR,eax
mov hMemText,eax
INVOKE ReadFile,hFileTrad,hMemText,TradFileSize,ADDR BytesDeal,0
INVOKE CloseHandle,hFileTrad
;«Ø¥ßSCH_AND_TCH_TBL.INCÀɮסA³oÓÀÉ®×¥]©M¨âÓªø¦r¦ê¡ATCH»PSCH¡A¤À§O¥Nªí¥¿Åé¦r»P²Åé¦rªº¦rÀWªí¡A§¡¥H¸U°ê½X
;½s½X¡C
INVOKE CreateFile,OFFSET szAsm,GENERIC_READ or GENERIC_WRITE,1,0,CREATE_ALWAYS,80h,0
mov hFileAsm,eax
;¦³5287Ó¥¿Åé¦r¡A¨C16Ó¦r¬°¤@¦æ¡A¦³331¦æ¡F¨C¦æ120Ӧ줸²Õ¡An39720Ӧ줸²Õ¡F¦ý39720¤£¯à³Q16¾ã°£¡A¬G¨ú39728
INVOKE GlobalAlloc,GPTR,39728
mov hMemAsm,eax
INVOKE word_to_asm_dw,hMemText,hMemAsm,OFFSET sTrCh,TradFileSize
INVOKE WriteFile,hFileAsm,hMemAsm,ecx,ADDR BytesDeal,0
;¶}±Ò²Åé¦rÀWªíªºÀɮסA¨ÃŪ¨úÀɮשҦ³¤º®e¡A¦s¤JhMemText°O¾ÐÅé°Ï¶ôùØ¡AµM«áÃö³¬¸ÓÀÉ®×
INVOKE CreateFile,OFFSET szSimpCh,GENERIC_READ,1,0,3,FILE_ATTRIBUTE_NORMAL,0
cmp eax,INVALID_HANDLE_VALUE
mov edx,OFFSET sMsg02
je open_error
mov hFileSimp,eax
INVOKE GetFileSize,hFileSimp,0
mov SimpFileSize,eax
INVOKE ReadFile,hFileSimp,hMemText,SimpFileSize,ADDR BytesDeal,0
INVOKE CloseHandle,hFileSimp
INVOKE word_to_asm_dw,hMemText,hMemAsm,OFFSET sSiCh,SimpFileSize
INVOKE WriteFile,hFileAsm,hMemAsm,ecx,ADDR BytesDeal,0
INVOKE CloseHandle,hFileAsm
INVOKE WriteConsole,hOutput,OFFSET sMsg00,(OFFSET sMsg01-OFFSET sMsg00)/2,ADDR BytesDeal,0
sub eax,eax
exit: INVOKE ExitProcess,eax
main ENDP
;*************************************************************************************************************
END main |
²ÕĶ ch_to_asm_dw.asm ªº¤èªk¬O¡A¥ý¶}±Ò¡u©R¥O´£¥Ü¦r¤¸¡v¡AµM«á¿é¤J¤U¦C«ü¥O¡A¤]´N¬O¶À¦â¦r¡C
C:\Users\wanker>SET INCLUDE=C:\masm32\INCLUDE;%INCLUDE% [Enter] C:\Users\wanker>SET LIB=C:\masm32\LIB;%LIB% [Enter] C:\Users\wanker>SET PATH=C:\masm32\BIN;%PATH% [Enter] C:\Users\wanker>SET ML=/coff /link /SUBSYSTEM:CONSOLE [Enter] ¡÷³oùؤj¤p¼g¬O¤£¦Pªº¡An¤p¤ß C:\Users\wanker>E: [Enter] E:\>CD \HomePage\SOURCE\Win32\FN2TC [Enter] ¡÷¤Á´«¨ì ch_to_asm_dw.asm ©Ò¦b¥Ø¿ý E:\HomePage\SOURCE\Win32\FN2TC>ml ch_to_asm_dw.asm [Enter] Microsoft (R) Macro Assembler Version 6.15.8803 Copyright (C) Microsoft Corp 1981-2000. All rights reserved. Assembling: ch_to_asm_dw.asm ************* UNICODE Build ************* Microsoft (R) Incremental Linker Version 5.12.8078 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /SUBSYSTEM:CONSOLE "ch_to_asm_dw.obj" "/OUT:ch_to_asm_dw.exe" E:\HomePage\SOURCE\Win32\FN2TC>ch_to_asm_dw [Enter] ¦¨¥\«Ø¥ßSCH_AND_TCH_TBL.INC¡C E:\HomePage\SOURCE\Win32\FN2TC>
¦Ü¦¹¡A¤w¸g«Ø¥ß¦n¥¿Åé¦r»P²Åé¦rªº¹ï·Óªí¤F¡A¤U¤@¸`¡A·|§â³o±i¹ï·Óªí¡A¥[¤J¨ì²Åé¦rÀɦWÅÜ¥¿Åé¦rÀɦWªºµ{¦¡¤¤¡C¦b¡uch_to_asm_dw.asm¡vµ{¦¡½X¤¤¡Aȱonª`·Nªº¬O²Ä 64¦æªº©I¥s wsprintfA API¡Cª`·N¨ì¡uch_to_asm_dw.asm¡v¬O¤ä´©¸U°ê½Xªºµ{¦¡¡A¨ä·N«ä¬O¡uch_to_asm_dw.asm¡v¿é¥X¦Ü¿Ã¹õ¡A¿é¤JÀɮצWºÙ¡A³£¬O±µ¦¬©ÎÄÀ¥X¸U°ê½X½s½Xªº¦r¤¸¡C¦ý¬O¿é¥Xªº¡uSCH_AND_TCH_TBL.INC¡v¤º®e¡A«o¥²¶·n¯à¬° ml.exe ²ÕĶ¾¹±µ¨üªº ANSI ½s½Xªº¦r¤¸¡A©Ò¥H¥²¶·¥Î©I¥s wsprintfA API¡A¤£¥i©I¥s wsprintW¡C
¦³¤F¥¿Åé¦r»P²Åé¦rªº¹ï·Óªí«á¡A´N¥i¥H¶}©lµÛ¤â¼¶¼g§â²Åé¦rªºÀɦW¡AÂà´«¦¨¥¿Åé¦rÀɦWªºµ{¦¡¤F¡A¤p¤ì°¸ºÙ¦¹µ{¦¡¬° FN2TC.ASM ( FileName To Traditional Chinese )¡C¥ý¬Ý°õ¦æµe±¡A¦A¨Ó»¡»¡ FN2TC ªº¨Ï¥Î¤èªk¡A³Ì«á¤p¤ì°¸·|¦C¥Xì©l½X¨Ã¸Ñ»¡¡C
FN2TC ¬O±±¨î¥xµ{¦¡¡A¥²¶·¦b¡u©R¥O´£¥Ü¦r¤¸¡v¤U°õ¦æ¡A±z¥i¥HÂI¿ï¡u¶}©l¡v¡÷¡uªþÄÝÀ³¥Îµ{¦¡¡v¡÷¡u©R¥O´£¥Ü¦r¤¸¡v¡A´N¯à¶}±Ò¡u©R¥O´£¥Ü¦r¤¸¡v¡AµM«á¤Á´«¨ì FN2TC ©Ò¦bªº¤l¥Ø¿ý¡A¦A¿é¤J¤U±«ü¥O¡G
FN2TC [-C] [driver:][path][\filename]
FN2TC ³Ì¦h¥i¥H±µ¨âӰѼơA¦pªG¶W¹L¡A´N·|©¿²¤¶W¹Lªº°Ñ¼Æ¡A¦Ó¤£·|¥X¿ù¡Aµ{¦¡¤]¯à¥¿±`°õ¦æ¡C²Ä¤@ӰѼƬO¡u-C¡v¡A¨â®Ç¥[¤W¤@¹ï¤¤¬A©·¡A¥Nªí³oӰѼƥi¥H¬Ù²¤¡A¹ê»Ú¤W¦b©R¥O´£¥Ü¦C¿é¤J«ü¥O®É¡A¤£¥i¿é¤J¤¤¬A©·¡C³oӰѼƤ£°Ï§O¤j¤p¼g¡A©Ò¥H¥Î¡u-c¡v¤]¥i¥H¡C¦pªG¨Ï¥ÎªÌ¦³¿é¤J¡u-C¡v°Ñ¼Æ¡A¥Nªí FN2TC ·|¦b¿Ã¹õ¤W¦C¥X§t²Åé¦rªºìÀɦW¡A¨Ã¸ß°Ý¨Ï¥ÎªÌ½T©w¬O§_§ï¦W¡C¿é¤J¡uY¡vÁä¥Nªí½T©wn§ï¦W¡F¿é¤J¡uN¡vÁä¥Nªí¤£§ï¦W¡C¦pªG¬Ù²¤¡u-C¡v°Ñ¼Æ¡AFN2TC ¤£·|µo¥X¸ß°Ý¡Aª½±µ§ï¦W¡C
²Ä¤GӰѼƬO¡udriver:path\filename¡v¡A¬OÅý¨Ï¥ÎªÌ¿é¤Jn§ï¦Wªº¸ô®|©Î¬OÀɮסC²Ä¤GӰѼƤ]¥[¤F¤¤¬A©·¡A¥Nªí¥i¥H¬Ù²¤¡A¦pªG¡u-C¡v»P¡udriver:path\filename¡v¨âӰѼƳ£¬Ù²¤®É¡AFN2TC ·|¦L¥X¨Ï¥Î¤èªk¡C¦ý¤£¯à¶È¿é¤J²Ä¤@ӰѼơA¦Ó¬Ù²¤²Ä¤GӰѼơA¦pªG³o¼Ë¡AFN2TC ·|¦L¥X¡u¥¼¿é¤JÀɦW¡vªº¿ù»~°T®§¡C²Ä¤GӰѼƤ¤ªº driver: ¥NªíºÏºÐ¾÷¦WºÙ¡Fpath ¥Nªí¸ô®|¡Ffilename ¥NªíÀɮצWºÙ¡C[driver:][path][\filename] ªº¼gªk¡A¬O¥H«e DOS ®É¥N¹ïÀɮתº¼gªk¡Cdriver:path\filename¡A¥i¯à¦³©³¤U¤TºØ±¡§Î¡G
ºÏºÐ¾÷¦W¡Bµ´¹ï¸ô®|¡BÀɦW¥þ³£ªí¥Ü¥X¨Ó¡C¥Î¡udriver:path\filename¡v¤è¦¡ªí¥ÜÀɮ׮ɡA¥u¦³³Ì«á¤@¶µ¥i¥H§t¦³¸U¥Î¦r¤¸ ( ¸U¥Î¦r¤¸¬O«ü¡u*¡v©Î¡u?¡v)¡A«e±ªº³£¤£¯à§t¸U¥Î¦r¤¸¡C¦³Ãö¥Ø¿ý¡B¸ô®|¡BÀɮסA¥H¤Îµ´¹ï¸ô®|¡B¬Û¹ï¸ô®|¤Î¸U¥Î¦r¤¸ªº»¡©ú¡A½Ð°Ñ¾\µù¤@¡C¬Ý©³¤Uªº¤TÓ¨Ò¤l¡A¨Ã°Ñ¦Ò¥k¹Ï¤¤¡A¤p¤ì°¸©Ò¨Ï¥Î¹q¸£ªº¡uE:¡vºÏºÐ¾÷³¡¤À¾ðª¬¥Ø¿ý¡G
FN2TC E:\HomePage\SOURCE\Ê^¨|.txt ¡÷§â E:\HomePage\SOURCE\Ê^¨|.txt §ï¦W¦¨¥¿Åé¦r¡uE:\HomePage\SOURCE\Åé¨|.txt¡v FN2TC E:\HomePage\SOURCE\FN*.* ¡÷§â E:\HomePage\SOURCE\ ¥Ø¿ý¤ºªº©Ò¦³¥H FN ¶}ÀYªºÀɮפΤl¥Ø¿ý³£§ï¦W¦¨¥¿Åé¦r FN2TC E:\HomePage\SOURCE ¡÷§â E:\HomePage\SOURCE\ ¥Ø¿ý¤ºªº©Ò¦³ÀɮפΤl¥Ø¿ý³£§ï¦W¦¨¥¿Åé¦r¡A¬Û·í©ó¡uFN2TC E:\HomePage\SOURCE\*.*¡v
¹³¤W±¤TÓ¨Ò¤l¡A³£¬O¥Ñ¡uºÏºÐ¾÷¦W¡v¤Uªº®Ú¥Ø¿ý¶}©l¡A©¹¤U«ü©w¤@¼h¤@¼hªº¤l¥Ø¿ý¡Aª½¨ìÀɦW¬°¤îªº¤è¦¡¡AºÙ¬°¡uµ´¹ï¸ô®|¡v¡C³oºØ¤è¦¡¡A¯à§¹¾ãªºªí¥ÜÀɦW¡A²Ä¤@Ó¨Ò¤l´N¬O³oºØ±¡§Î¡Cµ´¹ï¸ô®|¤]¯à·f°t§t¦³¸U¥Î¦r¤¸ªºÀɦW¡A²Ä¤GÓ¨Ò¤l´N¬O³oºØ±¡§Î¡C¸û¯S§Oªº¬O²Ä¤TºØ±¡§Î¡A¦b²Ä¤TÓ¨Ò¤lùØ¡AFN2TC ·|Àˬd¡uSOURCE¡v¬O¥Ø¿ýÁÙ¬OÀɮסA¦pªG¬O¥Ø¿ý¡A¨º»ò´N¬Û·í©ó¿é¤J¡uFN2TC E:\HomePage\SOURCE\*.*¡v¡A¥ç§Y§â¡uE:\HomePage\SOURCE¡v¥Ø¿ýùتº©Ò¦³ÀɮסA³£§ï¦¨¥¿Åé¦r¡F¦pªG¬OÀɮסA¦]¬°¡uSOURCE¡v¤£§t²Åé¦r¡A¦]¦¹µL§@¥Î¡C¨Æ¹ê¤W¡AFN2TC ·|Àˬd³Ì«á¤@¶µ¬OÀÉ®×ÁÙ¬O¥Ø¿ý¡A¦pªG¬OÀɮסA´N±N¦¹Àɮק令¥¿Åé¦r¡F¦pªG¬O¥Ø¿ý¡A´N§â¦¹¥Ø¿ý¤Uªº©Ò¦³Àɮק令¥¿Åé¦r¡C²Ä¤@ºØ±¡§Î¤¤ªº¡uÊ^¨|.txt¡v¤]¯à·í¦¨¤l¥Ø¿ý¡A¦pªG¯uªº¬O¤l¥Ø¿ý¡AFN2TC ¤]¯à§â¡uE:\HomePage\SOURCE\Ê^¨|.txt¡v¤l¥Ø¿ý¤Uªº©Ò¦³ÀɮצW§ï¦¨¥¿Åé¦r¡A»P¡uE:\HomePage\SOURCE\Ê^¨|.txt\*.*¡v¬O¤@¼Ëªº·N«ä¡A´N¦p¦P²Ä¤TºØ±¡§Î¡C´«¥y¸Ü»¡¡A¦pªG¨Ï¥ÎªÌ¿é¤Jªº²Ä¤GӰѼƬO¡uµ´¹ï¸ô®|¤ÎÀɦW¡v¡AÀɦW¦pªG¬Ù²¤¡A´N¬On³B²z¸Ó¸ô®|¤Uªº©Ò¦³ÀɦW¡C
¬Û¹ï¸ô®|¤ÎÀɦW¡C±q¬YӺϺЪº²{¦b¥Ø¿ý¶}©l¡A©¹¤W¼h©Î¤U¼hªº¤l¥Ø¿ý¡A¤@¼h¤@¼hªº«ü¦V¬YÓÀɮסA³oºØªí¥ÜÀɮתº¤è¦¡¡AºÙ¬°¬Û¹ï¸ô®|¡C¨Ò¦p¡A¥ý¦b¡u©R¥O´£¥Ü¦r¤¸¡v¤U¿é¤J¡uCD E:\HomePage\SOURCE¡v¡A¨º»ò¨t²Î´N·|§â¡uE:¡vºÏºÐ¾÷²{¦bªº¥Ø¿ýµø¬°¡uE:\HomePage\SOURCE¡v¡C±µ¤U¨Ó¿é¤J¡uFN2TC E:Win32¡v¡A³o¼Ëªº¸Ü¡AFN2TC ´N·|§â¡uE:\HomePage\SOURCE\Win32¡v¥Ø¿ý¤ºªº©Ò¦³ÀɮפΤl¥Ø¿ý³£§ï¦W¦¨¥¿Åé¦r¡C¹³¡uE:Win32¡v³oºØ¸ô®|´N¥s°µ¬Û¹ï¸ô®|¡C
«e±ªº¨Ò¤l¡A¬O¥Ñ²{¦b©Ò¦b¥Ø¿ý©¹¤U¼h¤l¥Ø¿ýªº¤è¦V©µ¦ù¡A¨º¬O§_¥i¥Hªí¥Ü¦V¤W¼h¤l¥Ø¿ý©O¡H¥i¥Hªº¡C¥²¶·¥Î¡u..¡v¡A¡u..¡v´N¥Nªí¤W¤@¼hªº¥Ø¿ý¡C¨Ò¦p¡A¡uE:¡vºÏºÐ¾÷²{¦b¥Ø¿ý¬O¡uE:\HomePage\SOURCE¡v¡C¨Ï¥ÎªÌ¿é¤J¡uFN2TC E:..¡v¡A¨º»ò FN2TC ´N·|³B²z¡uE:\HomePage\¡v¤l¥Ø¿ýùتºÀɮסC
¥u¿é¤JºÏºÐ¾÷¦WºÙ¡C³oºØ±¡§Î¡AFN2TC ´N·|¨ì¸ÓºÏºÐ¾÷¥Ø«eªº¥Ø¿ý¥h¡A§ä¨ì§t¦³Â²Åé¦rªºÀɦW¡A§ï¦¨¥¿Åé¦r¡C¨Ò¦p¡A¡uE:¡vºÏºÐ¾÷²{¦b¥Ø¿ý¬O¡uE:\HomePage\SOURCE¡v¡A¦Ó¨Ï¥ÎªÌ¿é¤J¡uFN2TC E:¡v¡AFN2TC ´N·|§â¡uE:\HomePage\SOURCE¡v¥Ø¿ý¤º§t¦³Â²Åé¦rªºÀɦW©Î¤l¥Ø¿ý¦W¡A§ï¦¨¥¿Åé¦r¡C¥t¤@Ó¨Ò¤l¡A¹³¤W¹Ï¤¤¡A¿é¤J¡uCD D:\TEST¡v¡A¤Á´«¡uD:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¬°¡uD:\TEST¡v¡CµM«á¿é¤J¡uFN2TC D:¡v¡A´N¬O§â¡uD:\TEST¡v¥Ø¿ý¤ºªºÀɦW¤Î¤l¥Ø¿ý¦W¡A§t¦³Â²Åé¦rªº¡A§ï¦¨¥¿Åé¦r¡C¨Æ¹ê¤W¡AFN2TC ¤]·|Àˬd¡uD:\TEST¡v¬O§_¬°¥Ø¿ý§í©ÎÀɮסA¸ò«e¨âºØ±¡§Î¤@¼Ë¡C
©Î³\¤W±ªº»¡©ú¡A¦³ÂI¨à½ÆÂø¡C±z¥i¥H·Q¦¨¡AFN2TC ·|Àˬd²Ä¤GӰѼƪº³Ì«á¤@¶µ¬O¥Ø¿ýÁÙ¬OÀɮסA¦pªG¬O¥Ø¿ý¡A´N·|§â¸Ó¥Ø¿ýùرªº©Ò¦³ÀɮצWºÙ§ï¦¨¥¿Åé¦r¡F¦pªG¬OÀɮסA´N·|§â¸ÓÀɮתºÀɦWÂà´«¦¨¥¿Åé¦r¡C¥t¥~¦pªG¬OÀɮצWºÙ¡A¥i¥H¨Ï¥Î¸U¥Î¦r¤¸¡A³o®ÉÔ¡AFN2TC ´N·|§â²Å¦X¸Ó¸U¥Î¦r¤¸ªºÀɦW§ï¦¨¥¿Åé¦r¡C³o¼Ë´N²³æ¦h¤F¡C
©³¤U¬O FN2TC ªºì©l½X¡G
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
25 26 27 28
29 30 31 32
33 34 35 36
37 38 39 40
41 42 43 44
45 46 47 48
49 50 51 52
53 54 55 56
57 58 59 60
61 62 63 64
65 66 67 68
69 70 71 72
73 74 75 76
77 78 79 80
81 82 83 84
85 86 87 88
89 90 91 92
93 94 95 96
97 98 99 100
101 102 103 104
105 106 107 108
109 110 111 112
113 114 115 116
117 118 119 120
121 122 123 124
125 126 127 128
129 130 131 132
133 134 135 136
137 138 139 140
141 142 143 144
145 146 147 148
149 150 151 152
153 154 155 156
157 158 159 160
161 162 163 164
165 166 167 168
169 170 171 172
173 174 175 176
177 178 179 180
181 182 183 184
185 186 187 188
189 190 191 192
193 194 195 196
197 198 199 200
201 202 203 204
205 206 207 208
209 210 211 212
213 214 215 216
217 218 219 220
221 222 223 224
225 226 227 228
229 230 231 232
233 234 235 236
237 238 239 240
241 242 243 244
245 246 247 248
249 250 251 252
253 254 255 256
257 258 259 260
261 262 263 264
265 266 267 268
269 270 271 272
273 274 275 276
277 278 279 280
281 282 283 284
285 286 287 288
289 290 291 292
293 294 295 296
297 298 299 300
301 302 303 304
305 306 307 308
309 310 311 312
313 314 315 316
317 318 319 320
321 322 323 324
325 326 327 328
329 330 331 332
333 334 335 336
337 338 339 340
341 342 343 344
345 346 347 348
349 350 351 352
353 354 355 356
357 358 359 360
361 362 363 364
365 366 367 368
369 370 371 372
373 374 375 376
377 378 379 380
381 382 383 384
385 386 387 388
389 390 391 392
393 394 395 396
397 398 399 400
401 402 403 404
405 406 407 408
409 410 411 412
413 414 415 416
417 418 419 420
421 422 423 424
425 426 427 428
429 430 431 432
433 434 435 436
437 438 439 440
441 442 443 444
445 446 447 448
449 |
;FN2TC.ASM·|§â«ü©w¥Ø¿ý©ÎÀɮפ¤¡A©Ò¦³²Å¦XªºÀɦW¤¤¡A§t¦³ªºÂ²Åé¦rÂàÅܦ¨¥¿Åé¦r¡C
;¨Ï¥Î¤èªk¡GFN2TC [-C] [path]
;¡@¡@¡@¡@¡@°Ñ¼Æ¡G-C¡GFN2TC·|¦C¥X¨C¤@ÓÀɦW¡A¨Ï¥ÎªÌn«öY©ÎNÁä¡A¥H½T©w¬O§_§ï¦¨¥¿Åé¦r¡CYªí¥Ü§ï¦W¡ANªí¥Üªu¥Îì¦W
;¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@Y¬Ù²¤¡u-C¡v¡AFN2TC¤£·|¸ß°Ý¡Aª½±µ§ï¦W¡C¡]C¬Oconfirmªº·N«ä¡A¥Î¤p¼g¤]¦æ¡^
;¡@¡@¡@¡@¡@°Ñ¼Æ¡Gpath¡G¸ô®|¤Î¦WºÙ¡A¥i¥H¥]§tÀɦW¡AÀɦW¤]¥i¥H¥]§t¸U¥Î¦r¤¸¡C¦pªG¥]§tÀɦW¡A´N¥u§ïÅܲŦXªºÀɦW¡C¦p
;¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@ªG¥u¬O¸ô®|¦WºÙ¡A´N·|§ïÅܦ¹¸ô®|©Ò¦bªº¤l¥Ø¿ý©ÎÀɦW¡A¦ý¤£§t§ó¤U¤@¼hªº¤l¥Ø¿ý¡F¦pªG¦¹¸ô®|¥]
;¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@§tÀɦW¡A¨º´N¶È§ó§ï²Å¦XªºÀɦW¡C
;½d¨Ò¡GFN2TC "D:\HomePage" --> ·|§â"C:\HomePage"¥Ø¿ý¤º©Ò¦³¤l¥Ø¿ý¦W¤ÎÀɦW§ï¦¨¥¿Åé¦r
;¡@¡@¡@FN2TC "D:\HomePage\*.html" --> ·|§â"C:\HomePage"¥Ø¿ý¤º¡A©Ò¦³°ÆÀɦW¬°.htmlªºÀɮקï¦W¦¨¥¿Åé¦r
;¡@¡@¡@FN2TC D:\HomePage\ch*.html --> ·|§â"C:\HomePage"¥Ø¿ý¤º¡A©Ò¦³°ÆÀɦW¬°.html¥BÀɦW«e¨â¦r¬°chªºÀɮקï¦W
;FN2TC.ASM¬°©R¥O¦C°õ¦æªºµ{¦¡¡A¥ç§Y±±¨î¥xµ{¦¡¡C
OPTION CASEMAP:NONE
.586
.MODEL FLAT,STDCALL
__UNICODE__ EQU 1 ;¤ä´©UNICODE
INCLUDE WINDOWS.INC
INCLUDE KERNEL32.INC
INCLUDE USER32.INC
INCLUDELIB KERNEL32.LIB
INCLUDELIB USER32.LIB
;¸ô®|¦W\ÀɮצWªº¸ê®Æµ²ºcÅé¡]PathFileData¡^
PATHFILEDATA STRUC
pFullname DD ? ;§¹¾ãÀɦW°_©l¦ì§}¡A§¹¾ãÀɦW¥]§tºÏºÐ¾÷¦W¡B¸ô®|¦W¡B¥DÀɦW¤Î°ÆÀɦW
pMainFilename DD ? ;¥DÀɦW¦ì§}
cChar DD ? ;§¹¾ãÀɦWªº¦r¤¸¼Æ¡A¤£§tµ²§ÀªºNULL
PATHFILEDATA ENDS
;*************************************************************************************************************
.CONST
;SCH_AND_TCH_TBL.INC¬O²Å餤¤å¡]Simplified Chinese¡^»P¥¿Å餤¤å¡]Traditional Chinese¡^¹ï·Ó¸ê®Æ¡]Data¡^ªí¡C¨ä¤º
;®e¬°¨âÓªø¦r¦ê¡ATCH©MSCH¡A¤À§O¥Nªí¥¿Åé¦r¡B²Åé¦rªº¸U°ê½X½s½X¡CTCHªº²ÄnÓ¦r²Õ©Ò¥Nªí¥¿Åé¦r¡A´N¬OSCH²ÄnÓ¦r²Õªº
;²Åé¦r¡C¦¹ªí¬°¡m¤@¡³¡³¦Ü¤@¡³¥|¦~±`¥Î»yµü½Õ¬d³ø§i®Ñ¡nªºªþ¿ý18¡A¥Á°ê104¦~±`¥Î»yµü½Õ¬d»y®Æ²Îp¤ÀªR¦rÀWªí.xls¡A¨ä¤º
;¦@¦¬¿ý5289¦r¡A¦ý°£¥h¡u¡ã¡v¤Î4837h¨â¦r¡C¦]¦¹TCH¦³5287Ó¦r²Õ¡ASCH¤]¦³5287Ó¦r²Õ¡C
INCLUDE SCH_AND_TCH_TBL.INC
n_words=(OFFSET SCH-OFFSET TCH)/2 ;n_words¡×5287h¡×TCH¦r²ÕӼơ×SCH¦r²ÕÓ¼Æ
sUsage DW 46h,4eh,32h,54h,43h,6703h,628ah,542bh,6709h,7c21h,9ad4h,5b57h ;FN2TC·|§â§t¦³Â²Åé¦r
DW 7684h,8defh,5f91h,6216h,6a94h,540dh,0ff0ch,6539h,6210h,6b63h ;ªº¸ô®|©ÎÀɦW¡A§ï¦¨¥¿
DW 9ad4h,5b57h,0dh,0ah,4f7fh,7528h,65b9h,6cd5h,0ff1ah,46h,4eh ;Åé¦r¨Ï¥Î¤èªk¡GFN
DW 32h,54h,43h,20h,5bh,2dh,43h,5dh,20h,5bh,70h,61h,74h,68h,5dh ;2TC [-C] [path]
DW 0dh,0ah,3000h,3000h,2dh,43h,0ff1ah,46h,4eh,32h,54h,43h,6703h ;¡@¡@-C¡GFN2TC·|
DW 5217h,51fah,6bcfh,4e00h,500bh,6a94h,540dh,0ff0ch,4f7fh,7528h ;¦C¥X¨C¤@ÓÀɦW¡A¨Ï¥Î
DW 8005h,8981h,6309h,59h,6216h,4eh,9375h,0ff0ch,4ee5h,78bah ;ªÌn«öY©ÎNÁä¡A¥H½T
DW 5b9ah,662fh,5426h,6539h,6210h,6b63h,9ad4h,5b57h,3002h,59h ;©w¬O§_§ï¦¨¥¿Åé¦r¡CY
DW 8868h,0dh,0ah,3000h,3000h,3000h,3000h,793ah,6539h,540dh,0ff0ch ;ªí¡@¡@¡@¡@¥Ü§ï¦W¡A
DW 4eh,8868h,793ah,6cbfh,7528h,539fh,540dh,3002h,82e5h,7701h ;Nªí¥Üªu¥Îì¦W¡CY¬Ù
DW 7565h,300ch,2dh,43h,300dh,0ff0ch,46h,4eh,32h,54h,43h,4e0dh ;²¤¡u-C¡v¡AFN2TC¤£
DW 6703h,8a62h,554fh,0ff0ch,76f4h,63a5h,6539h,540dh,3002h,0ff08h ;·|¸ß°Ý¡Aª½±µ§ï¦W¡C¡]
DW 43h,662fh,0dh,0ah,3000h,3000h,3000h,3000h,63h,6fh,6eh,66h ;C¬O¡@¡@¡@¡@conf
DW 69h,72h,6dh,7684h,610fh,601dh,0ff0ch,7528h,5c0fh,5bebh,4e5fh ;irmªº·N«ä¡A¥Î¤p¼g¤]
DW 884ch,0ff09h,0dh,0ah,3000h,3000h,70h,61h,74h,68h,0ff1ah,8defh ;¦æ¡^¡@¡@path¡G¸ô
DW 5f91h,540dh,7a31h,0ff0ch,53efh,4ee5h,5305h,542bh,6a94h,540dh ;®|¦WºÙ¡A¥i¥H¥]§tÀɦW
DW 0ff0ch,6a94h,540dh,4e5fh,53efh,4ee5h,5305h,542bh,842ch,7528h ;¡AÀɦW¤]¥i¥H¥]§t¸U¥Î
DW 5b57h,5143h,3002h,5982h,679ch,5305h,542bh,6a94h,540dh,0ff0ch ;¦r¤¸¡C¦pªG¥]§tÀɦW¡A
DW 5c31h,53eah,0dh,0ah,3000h,3000h,3000h,3000h,3000h,6539h,8b8ah ;´N¥u¡@¡@¡@¡@¡@§ïÅÜ
DW 7b26h,5408h,7684h,6a94h,540dh,3002h,5982h,679ch,53eah,662fh ;²Å¦XªºÀɦW¡C¦pªG¥u¬O
DW 8defh,5f91h,540dh,7a31h,0ff0ch,5c31h,6703h,6539h,8b8ah,6b64h ;¸ô®|¦WºÙ¡A´N·|§ïÅܦ¹
DW 8defh,5f91h,5167h,7684h,6240h,6709h,5b50h,76eeh,9304h,53cah ;¸ô®|¤ºªº©Ò¦³¤l¥Ø¿ý¤Î
DW 6a94h,0dh,0ah,3000h,3000h,3000h,3000h,3000h,6848h,540dh,7a31h ;ÀÉ¡@¡@¡@¡@¡@®×¦WºÙ
DW 0ff0ch,4f46h,4e0dh,542bh,66f4h,4e0bh,4e00h,5c64h,7684h,5b50h ;¡A¦ý¤£§t§ó¤U¤@¼hªº¤l
DW 76eeh,9304h,3002h,0dh,0ah,7bc4h,4f8bh,0ff1ah,0dh,0ah,46h ;¥Ø¿ý¡C½d¨Ò¡GF
DW 4eh,32h,54h,43h,20h,22h,43h,3ah,5ch,6dh,61h,73h,6dh,33h,32h ;N2TC "C:\masm32
DW 22h,3000h,3000h,3000h,3000h,20h,628ah,43h,3ah,5ch,6dh,61h ;"¡@¡@¡@¡@ §âC:\ma
DW 73h,6dh,33h,32h,76eeh,9304h,5167h,6240h,6709h,5b50h,76eeh ;sm32¥Ø¿ý¤º©Ò¦³¤l¥Ø
DW 9304h,540dh,53cah,6a94h,540dh,6539h,6210h,6b63h,9ad4h,5b57h ;¿ý¦W¤ÎÀɦW§ï¦¨¥¿Åé¦r
DW 0dh,0ah,46h,4eh,32h,54h,43h,20h,22h,43h,3ah,5ch,6dh,61h,73h ;FN2TC "C:\mas
DW 6dh,33h,32h,5ch,2ah,2eh,68h,74h,6dh,6ch,22h,3000h,628ah,43h ;m32\*.html"¡@§âC
DW 3ah,5ch,6dh,61h,73h,6dh,33h,32h,76eeh,9304h,5167h,6240h,6709h ;:\masm32¥Ø¿ý¤º©Ò¦³
DW 526fh,6a94h,540dh,70bah,2eh,68h,74h,6dh,6ch,7684h,6a94h,6848h ;°ÆÀɦW¬°.htmlªºÀÉ®×
DW 6539h,6210h,6b63h,9ad4h,5b57h,13,10,46h,4eh,32h,54h,43h,20h,43h ;§ï¦¨¥¿Åé¦r FN2TC C
DW 3ah,5ch,6dh,61h,73h,6dh,33h,32h,5ch,63h,68h,2ah,2eh,68h,74h,6dh ;:\masm32\ch*.htm
DW 6ch,3000h,628ah,43h,3ah,5ch,6dh,61h,73h,6dh,51,50,76eeh,9304h ;l¡@§âC:\masm32¥Ø¿ý
DW 5167h,6240h,6709h,526fh,6a94h,540dh,70bah,2eh,68h,74h,6dh,6ch ;¤º©Ò¦³°ÆÀɦW¬°.html
DW 4e14h,6a94h,540dh,524dh,5169h,5b57h,70bah,99,68h,13,10,3000h ;¥BÀɦW«e¨â¦r¬°ch¡@
DW 3000h,3000h,3000h,3000h,3000h,3000h,3000h,3000h,3000h,3000h ;¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@
DW 3000h,3000h,7684h,6a94h,6848h,6539h,6210h,6b63h,9ad4h,5b57h ;¡@¡@ªºÀɮק令¥¿Åé¦r
sError01 DW 53c3h,6578h,932fh,8aa4h,3002h ;°Ñ¼Æ¿ù»~¡C
sError02 DW 672ah,8f38h,5165h,6a94h,540dh,3002h ;¥¼¿é¤JÀɦW¡C
sError03 DW 6a94h,540dh,542bh,6709h,4e0dh,5408h,6cd5h,5b57h,5143h,3002h ;ÀɦW§t¦³¤£¦Xªk¦r¤¸¡C
sError04 DW 932fh,8aa4h,7684h,8defh,5f91h,540dh,6216h,6a94h,540dh,3002h ;¿ù»~ªº¸ô®|¦W©ÎÀɦW¡C
sError05 DW 627eh,4e0dh,5230h,6307h,5b9ah,7684h,6a94h,6848h,3002h ;§ä¤£¨ì«ü©wªºÀɮסC
sError06 DW 767ch,751fh,932fh,8aa4h,0ff01h ;µo¥Í¿ù»~¡I
szFmtRename DW 25h,73h,2192h,25h,73h,13,10,0 ;%s ¡÷ %s
szFmtConfirm DW 662fh,5426h,628ah,300ch,25h,73h,300dh,6539h,540dh,70bah,300ch ;¬O§_§â¡u%s¡v§ï¦W¬°¡u
DW 25h,73h,300dh,28h,79h,2fh,6eh,29h,0ff1fh,0h ;%s¡v(y/n)¡H
szFmtExist DW 300ch,25h,73h,300dh,5df2h,5b58h,5728h,0ff0ch,300ch,25h,73h ;¡u%s¡v¤w¦s¦b¡A¡u%s
DW 300dh,4e0dh,6539h,540dh,3002h,13,10,0 ;¡v¤£§ï¦W¡C
szFmtChgFile DW 542bh,7c21h,9ad4h,5b57h,7684h,6a94h,540dh,6709h,25h,64h,500bh ;§t²Åé¦rªºÀɦW¦³%dÓ
DW 0ff0ch,5be6h,969bh,6539h,540dh,7684h,6a94h,6848h,6709h,25h ;¡A¹ê»Ú§ï¦WªºÀɮצ³%
DW 64h,500bh,3002h,0h ;dÓ¡C
szFmtDir DW 76eeh,9304h,0ff1ah,25h,73h,13,10,0 ;¥Ø¿ý¡G%s
;*************************************************************************************************************
.DATA
hOutput DD ? ;¼Ð·Ç¿é¥X¸Ë¸m¥N½X
hInput DD ? ;¼Ð·Ç¿é¥X¸Ë¸m¥N½X
pParam DD ? ;°Ñ¼Æ°_©l¦ì§}
fConfirm DD ? ;¨Ï¥ÎªÌ¬O§_¦³¿é¤J¡u-C¡v°Ñ¼Æ¡C¦³¿é¤J¡AbConfirm¡×1¡F¨S¿é¤JbConfirm¡×0
pfd PATHFILEDATA <>
w32fd WIN32_FIND_DATA <>
hFind DD ?
old_filename DW MAX_PATH DUP (?)
new_filename DW MAX_PATH DUP (?)
buffer DW MAX_PATH DUP (?)
nChgFileName DD 0 ;¤w§ï¦WªºÀÉ®×Ó¼Æ
nFitFileName DD 0 ;²Å¦X±ø¥ó¥B§t¦³Â²Åé¦rÀɦWªºÀÉ®×Ó¼Æ
CharWritten DD ?
;*************************************************************************************************************
.CODE
;-------------------------------------------------------------------------------------------------------------
;get_parameter°Æµ{¦¡¥Î¨Ó¤ÀªR¨Ï¥ÎªÌ¦b©R¥O¦C¿é¤J°Ñ¼Æ¡CpCL¬O©R¥O¦C¦ì§}¡ApPFD¬OPATHFILEDATAµ²ºcÅé¦ì§}¡C
get_parameter PROC USES esi edi ebx pCL:DWORD,pPFD:DWORD
;¨ú±o¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¡AFN2TCªº°Ñ¼Æ³Ì¦h¦³¨â¶µ¡A¡u-C¡v¤Î¸ô®|¦W¡Cget_parameter°Æµ{¦¡¤ÀªR¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¡AµM«á§â
;FindFirstFile¥i±µ¨üªº¸ô®|¤ÎÀɦW°O¿ý¦bPATHFILEDATAµ²ºcÅ餺¡C
;¿é¤J¡GpCL¡Ð¨Ï¥ÎªÌ¦b©R¥O¦C¿é¤Jªº°Ñ¼Æ¦ì§}
;¡@¡@¡@pPFD¡ÐPATHFILEDATAµ²ºcÅé¦ì§}¡Cªð¦^®É¡Aget_parameter¦b¦¹¦ì§}ªºPATHFILEDATAµ²ºcÅé¡A¶ñ¤J¾A·íªº¸ê®Æ
;¿é¥X¡G¶i¦ìºX¼Ð¡×CY¡Aªí¥Ü¿ù»~¡AEAX¡×¿ù»~½X
;¡@¡@¡@¡@¡@EAX¡×0¡A¨Ï¥ÎªÌ¨S¿é¤J¥ô¦ó°Ñ¼Æ
;¡@¡@¡@¡@¡@EAX¡×1¡A°Ñ¼Æ¿ù»~¡A¿é¤J¤£¬O¡u-C¡v©Î¡u-c¡vªº°Ñ¼Æ
;¡@¡@¡@¡@¡@EAX¡×2¡A¥u¿é¤J¡u-C¡v©Î¡u-c¡v¡A¥B¥¼¿é¤JÀɦW
;¡@¡@¡@¡@¡@EAX¡×3¡A¸ô®|¦W©ÎÀɦW§t¦³¤£¦Xªkªº¦r¤¸
;¡@¡@¡@¡@¡@EAX¡×4¡A¿ù»~ªº¸ô®|¦W©ÎÀɦW¡]ÅÞ¿è¿ù»~¡A¨Ò¦p¦³¨âӺϺо÷¦Wµ¥µ¥¡^
;¡@¡@¡@¡@¡@EAX¡×5¡A§ä¤£¨ì«ü©wªºÀÉ®×
;¡@¡@¡@¡@¡@EAX¡×6¡A¨ä¥L¿ù»~
;¡@¡@¡@¶i¦ìºX¼Ð¡×NC¡Aªí¥Ü¥¿½T¡APATHFILEDATAµ²ºcÅé¤w¶ñ¤J¾A·í¸ê®Æ
;¡@¡@¡@¡@¡@EAX¡×¨Ï¥ÎªÌ¬O§_¿é¤J¡u-C¡v°Ñ¼Æ¡A¦³¿é¤J¡AEAX¡×1¡F¨S¿é¤J¡AEAX¡×0
LOCAL confirm:DWORD ;¼È®É°O¿ý¨Ï¥ÎªÌ¬O§_¿é¤J¡u-C¡v°Ñ¼Æ¡A¦³¿é¤J¡Aconfirm¬°¤@¡F§_«h¬°¹s
LOCAL driver:DWORD ;¼È®É°O¿ýºÏºÐ¾÷Ó¼Æ
LOCAL wildcard:DWORD ;°O¿ý¸U¥Î¦r¤¸Ó¼Æ
LOCAL temp_name[MAX_PATH]:WORD
ASSUME esi:PTR PATHFILEDATA
cld
;¸õ¹L¡ufn2tc¡v¡C¦b©R¥O´£¥Ü¦r¤¸¿é¤Jµ{¦¡°õ¦æ®É¡A¨t²Î·|¦Û°Ê¦A°Ñ¼Æ¦C¥[¤W°õ¦æÀɤΨä©Ò¦b¸ô®|¦WºÙ¡An¥ý©¿²¤¥¦¡C
;¦]¦¹n¥ý§ä¨ì¨âÓ¡u"¡v¤§¥~ªºªÅ¥Õ¡AªÅ¥Õ¤§«á¤~¬O¨Ï¥ÎªÌ¯u¥¿¿é¤Jªº°Ñ¼Æ¡C
xor edx,edx ;EDX¡×¡u"¡vÓ¼Æ
mov esi,pPFD
mov ebx,pCL
mov [esi].pMainFilename,edx
mov [esi].cChar,edx
mov confirm,edx
mov driver,edx
mov wildcard,edx
g_p_00: cmp WORD PTR [ebx],22h ;¡u"¡v¦r¤¸
je g_p_02
cmp WORD PTR [ebx],20h ;ªÅ¥Õ¦r¤¸
je g_p_03
cmp WORD PTR [ebx],0
je g_p_04
g_p_01: add ebx,2
jmp g_p_00
g_p_02: inc edx
jmp g_p_01
;¹J¨ìªÅ¥Õ®É¡AÀˬdEDX¬O§_¬°©_¼Æ¡C¦pªGEDX¬°©_¼Æ¡Aªí¥Ü²{¦b¤w¹J¨ì©_¼ÆÓ¡u"¡v¡A¥ç§Y¦¹ªÅ¥Õ¦b¨âÓ¡u"¡v¤§¶¡¡A¸õ¨ì
;g_p_01³BÄ~Äò´M§ä¨âÓ¡u"¡v¤§¥~ªºªÅ¥Õ¡F¦pªGEDX¬O°¸¼Æ¡Aªí¥Ü¦¹ªÅ¥Õ¬O¦b¨âÓ¡u"¡v¤§¥~¡Aªí¥Ü¤@ӰѼƤwµ²§ô
g_p_03: test edx,1
jnz g_p_01
;§R¥h¡ufn2tc¡v»P°Ñ¼Æ¤§¶¡ªºªÅ¥Õ©Î¸õ®æ¦r¤¸¡C
.WHILE (WORD PTR [ebx]==20h)||(WORD PTR [ebx]==9)
add ebx,2
.ENDW
cmp WORD PTR [ebx],0
jne g_p_06
g_p_04: sub eax,eax ;¦pªG¬O0¡Aªí¥Ü¨Ï¥ÎªÌ°£¤FªÅ¥Õ©Î¸õ®æ¦r¤¸¥~¡A¨S¦³¿é¤J¥ô¦óªF¦è
g_p_05: stc
jmp g_p_30
;EBX¡×²Ä¤@ӰѼƦì§}¡CÀˬd¬O§_¬°¡u-¡v¡A¦pªG¤£¬O¡u-¡v¡Aªí¥Ü¨Ï¥ÎªÌ¨S¦³¿é¤J¡u-C/c¡v¡Aªí¥Ü¤£¶·½T»{
g_p_06: cmp WORD PTR [ebx],2dh ;¡u-¡v¦r¤¸
jne g_p_14
.IF (WORD PTR [ebx+2]==43h)||(WORD PTR [ebx+2]==63h) ;¡uC¡v©Î¡uc¡v¦r¤¸
mov confirm,1
add ebx,4
cmp WORD PTR [ebx]," "
je g_p_08
cmp WORD PTR [ebx],9
jne g_p_07
.ELSE
g_p_07: mov eax,1 ;¿ù»~½X¡AEAX¡×1¡A°Ñ¼Æ¿ù»~¡A¿é¤J¤£¬O¡u-C¡v©Î¡u-c¡vªº°Ñ¼Æ
jmp g_p_05
.ENDIF
;¤w³B²z§¹¨Ï¥ÎªÌ¬O§_¦³¡u-C¡v°Ñ¼Æ¡A¸õ¹LªÅ¥Õ©Î¸õ®æ¦r¤¸
g_p_08: cmp WORD PTR [ebx]," "
je g_p_10
cmp WORD PTR [ebx],9
je g_p_10
cmp WORD PTR [ebx],0
jne g_p_14
g_p_09: mov eax,2 ;¿ù»~½X¡AEAX¡×2¡A¥u¿é¤J¡u-C¡v©Î¡u-c¡v¡A¥B¥¼¿é¤JÀɦW
jmp g_p_05
g_p_10: add ebx,2
jmp g_p_08
g_p_11: mov eax,3 ;¿ù»~½X¡AEAX¡×3¡A¸ô®|¦W©ÎÀɦW§t¦³¤£¦Xªkªº¦r¤¸
jmp g_p_05
;³B²zNULL¦r¤¸¡C¥ýÀˬd¨Ï¥ÎªÌ¬O§_¦b¡u-C¡v¤§«á¨S¦³¿é¤J¸ô®|¡A¦pªG¬Oªº¸Ü´N¸õ¦Üg_p_09
g_p_12: cmp ebx,[esi].pFullname
jz g_p_09
test edx,1
je g_p_23 ;YEDX¡×1¡Aªí¥Ü¥u¿é¤J©_¼ÆÓ¡u"¡v
g_p_13: mov eax,4 ;¿ù»~½X¡AEAX¡×4¡A¿ù»~ªº¸ô®|¦W©ÎÀɦW¡]ÅÞ¿è¿ù»~¡A¨Ò¦p¦³¨âӺϺо÷¦Wµ¥µ¥¡^
jmp g_p_05
;°õ¦æ¨ì¦¹¡A¤w¸gÀˬd¹L¨Ï¥ÎªÌ¬O§_¿é¤J¤F¡u-C¡v°Ñ¼Æ¡A¤]¤w¸õ¹L¨ä«áªºªÅ¥Õ©Î¸õ®æ¦r¤¸¡A¦¹¨èEBX«ü¦V¤§«á¤£¬OªÅ¥Õ©Î¸õ
;®æ¦r¤¸ªº¦ì§}¡A§Y±N¶}©lnÀˬd¸ô®|¦WºÙ¡A¨Ã°£¥h¡u"¡v¦r¤¸¡C°£¥hªº¤èªk¬O§â©Ò¦³¦r¤¸¦A¦s¦^EDI©Ò«ü¦ì§}¡A¦Ó¤@¶}©l¡A
;EBX©MEDI³£«ü¦V¦P¼Ë¦ì§}¡C¦pªG¹J¨ì¡u"¡v¡A´N¤£¦s¦^¡C¦P®É¡A¤]Àˬd¸U¥Î¦r¤¸¡B¡u:¡vªºÓ¼Æ¡A¤ÎÀˬd¦³µL¤£¦Xªkªº¦r¤¸
g_p_14: mov [esi].pFullname,ebx
mov edi,ebx
sub edx,edx ;EDX¡×°O¿ý¡u"¡vÓ¼Æ
g_p_15: movzx eax,WORD PTR [ebx]
or ax,ax
jz g_p_12
cmp ax,20h
jb g_p_11 ;¦pªG¤ñ20h¤p¡Aµo¥Í¿ù»~¡A¸õ¦Üg_p_11¡C
je g_p_22 ;¦pªG¬OªÅ¥Õ¦r¤¸¡A¸õ¦Üg_p_22
cmp ax,3ch ;¡u<¡v
je g_p_11
cmp ax,3eh ;¡u>¡v
je g_p_11
cmp ax,7ch ;¡u|¡v
je g_p_11
cmp ax,22h ;¡u"¡v
je g_p_20
cmp ax,3fh ;¡u?¡v
je g_p_18
cmp ax,2ah ;¡u*¡v
je g_p_18
cmp ax,5ch ;¡u\¡v
je g_p_19
cmp ax,3ah ;¡u:¡v
je g_p_21
g_p_16: stosw
g_p_17: add ebx,2
jmp g_p_15
g_p_18: mov wildcard,1
jmp g_p_16
;³B²z¡u\¡v¦r¤¸¡Cº¥ý¡A¥ýÀˬd¸ô®|¦W¬O§_¦³¸U¥Î¦r¤¸¡A¦pªG¦³ªº¸Ü¡A´Nµo¥Í¿ù»~¡A¸õ¦Üg_p_13³B¡CÀˬd¦n«á¡A¦]¬°¦³
;¡u\¡v¦r¤¸¡A¥Nªí¨Ï¥ÎªÌ©Ò¿é¤Jªº°Ñ¼Æ¡A¥]§t¸ô®|¦WºÙ¡A¦]¦¹§âpfdµ²ºcÅ骺fPathÄæ¦ì³]¬°¤@¡C
g_p_19: cmp wildcard,1 ;Ywildcard¡×1¡Aªí¥Ü¦b¡u\¡v¦r¤¸¤§«e¦³¥X²{¸U¥Î¦r¤¸¡A
je g_p_13 ;¬Gµo¥Í¿ù»~
jmp g_p_16
;³B²z¡u"¡v¡C¨ÏEDX¼W¥[¤@¡A¦ý¤£¦s©óEDI©Ò«ü¦ì§}¡A³o¼Ë´N·|§R¥h¡u"¡v
g_p_20: inc edx
jmp g_p_17
;³B²zºÏºÐ¾÷¦Wªºµ{¦¡¡C¦¹µ{¦¡¤ù¬q¬O¥Ñ¤W±ÀˬdAX¡×¡u:¡v¦r¤¸³B¸õÅD¦Ó¨Óªº¡C
g_p_21: inc driver
cmp driver,1;ºÏºÐ¾÷¦W³Ì¦h¥u¯à¦³¤@Ó¡A§_«h´Nµo¥Í¿ù»~
jne g_p_13
mov ecx,edi
sub ecx,[esi].pFullname
cmp ecx,2 ;¦pªG¦³ºÏºÐ¾÷¦Wªº¸Ü¡A¥²©w¦b§¹¾ã¸ô®|¦Wªº³Ì«e±¡A¤]´N¬O³Ì§C¦ì§}ªº¨âÓ¦r¤¸¡C¦]
je g_p_16 ;¦¹§âEDI´î¥h§¹¾ã¸ô®|°_©l¦ì§}À³¸Ónµ¥©ó2¡A¦pªG¤£¬O2¡Aªí¥ÜºÏºÐ¾÷¦W¤£¦b³Ì«e±
jmp g_p_13 ;¡Aªí¥Üµo¥Í¿ù»~¡A¸õ¨ìg_p_13
;³B²zªÅ¥Õ¡C¥ýÀˬd¦¹ªÅ¥Õ¬O§_¦b¨âÓ¡u"¡v¤§¶¡¡A¦pªG¬Oªº¸Ü¡Aªí¥Ü¦¹ªÅ¥Õ¬°¸ô®|¦W©ÎÀɦWªº¤@³¡¤À¡A¸õ¦Üg_p_16¦s¤JEDI
;©Ò«ü¦ì§}¡F¦pªG¤£¬O¡Aªí¥Ü¸ô®|¦W¤wµ²§ô¤F¡C
g_p_22: test edx,1
jnz g_p_16
g_p_23: mov WORD PTR [edi],0
;Àˬd¬O§_¦³¸U¥Î¦r¤¸¡A¦pªG¦³ªº¸Ü¡Aªí¥Ü¿é¤Jªº°Ñ¼Æ¬°ÀɮסA§_«hÀˬd¬O§_¬°¥Ø¿ý
cmp wildcard,1
je g_p_27
INVOKE GetFileAttributes,[esi].pFullname
cmp eax,INVALID_FILE_ATTRIBUTES
je g_p_25
test eax,FILE_ATTRIBUTE_DIRECTORY
jz g_p_27
;¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¬°¥Ø¿ý¡AÀò±o§¹¾ã¸ô®|¦W¡A¨Ã¦b¨ä«á¥[¤W¡u\*.*,0¡v©Î¡u*.*,0¡v
INVOKE GetFullPathName,[esi].pFullname,SIZEOF temp_name/2,ADDR temp_name,0
lea edx,temp_name
mov ecx,eax
mov edi,[esi].pFullname
g_p_24: movzx eax,WORD PTR [edx]
stosw
add edx,2
loop g_p_24
.IF ax!=5ch
mov ax,5ch ;Y³Ì«á¤@Ó¦r¤¸¤£¬°¡u\¡v¡AFN2TC·|¦Û¦æ¥[¤W
stosw
.ENDIF
mov [esi].pMainFilename,edi
mov eax,2e002ah ;*.
stosd
mov eax,2ah ;*,0
stosd
mov ecx,edi
sub ecx,2
sub ecx,[esi].pFullname
shr ecx,1
mov [esi].cChar,ecx
jmp g_p_29
g_p_25: call GetLastError
cmp eax,ERROR_FILE_NOT_FOUND
jne g_p_26
mov eax,5 ;¿ù»~½X¡AEAX¡×5¡A§ä¤£¨ì«ü©wªºÀÉ®×
jmp g_p_05
g_p_26: mov eax,6 ;¿ù»~½X¡AEAX¡×6¡A¨ä¥L¿ù»~
jmp g_p_05
;¨Ï¥ÎªÌ¿é¤Jªº¬OÀɮצWºÙ¡A¦³¥i¯à¥]§t¸U¥Î¦r¤¸¡C
g_p_27: INVOKE GetFullPathName,[esi].pFullname,SIZEOF temp_name/2,ADDR temp_name,ADDR [esi].pMainFilename
lea edx,temp_name
mov ecx,eax
mov [esi].cChar,eax
sub [esi].pMainFilename,edx ;[esi].pMainFilename¡×§¹¾ãÀɦW¦ì§}¨ì¥DÀɦW¦ì§}¡A¦³´XӦ줸²Õ
mov edi,[esi].pFullname
add [esi].pMainFilename,edi
g_p_28: movzx eax,WORD PTR [edx]
stosw
add edx,2
loop g_p_28
mov [edi],cx
g_p_29: mov eax,confirm
clc
g_p_30: ret
ASSUME esi:NOTHING
get_parameter ENDP
;-------------------------------------------------------------------------------------------------------------
main PROC
LOCAL pSrMainFn:LPSTR ;ì¨ÓÀɮתº¥DÀɦW¦ì§}
LOCAL pTrMainFn:LPSTR ;§ï¦W«áªº¥DÀɦW¦ì§}
LOCAL fChanged:DWORD ;¬YÓÀɦW¤¤¡A¦³´XÓ¦r¤¸§ï¦¨¥¿Åé¦r
;¨ú±o¼Ð·Ç¿é¥X¡B¿é¤J¸Ë¸mªº¥N½X¡A¨Ã¤ÀªR¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¡C
INVOKE GetStdHandle,STD_OUTPUT_HANDLE ;¨ú±o¼Ð·Ç¿é¥X¸Ë¸m¥N½X
mov hOutput,eax
INVOKE GetStdHandle, STD_INPUT_HANDLE ;¨ú±o¼Ð·Ç¿é¤J¸Ë¸m¥N½X
mov hInput,eax
call GetCommandLine
mov pParam,eax
INVOKE get_parameter,pParam,OFFSET pfd
jnc no_error
.IF eax==0
mov edx,OFFSET sUsage
mov ecx,OFFSET sError01-OFFSET sUsage
.ELSEIF eax==1
mov edx,OFFSET sError01
mov ecx,SIZEOF sError01
.ELSEIF eax==2
mov edx,OFFSET sError02
mov ecx,SIZEOF sError02
.ELSEIF eax==3
mov edx,OFFSET sError03
mov ecx,SIZEOF sError03
.ELSEIF eax==4
mov edx,OFFSET sError04
mov ecx,SIZEOF sError04
.ELSEIF eax==5
not_find: mov edx,OFFSET sError05
mov ecx,SIZEOF sError05
.ELSE
mov edx,OFFSET sError06
mov ecx,SIZEOF sError06
.ENDIF
right_shift: shr ecx,1
INVOKE WriteConsole,hOutput,edx,ecx,ADDR CharWritten,0
xor eax,eax
jmp exit
;¶}©ln§â§t¦³Â²Åé¦rªºÀɦW§ï¦¨¥¿Åé¦r¡C¦]¬°FindFirstFile¶Ç¦^¨Óªº¸ê®ÆùØ¡A¥u¦³ÀɮצWºÙ¡A¦]¦¹n¥ý§â¸ô®|¦W¦s¤J
;old_filename»Pnew_filename¨â¦r¦êùØ¡A¨Ã§â³o¨âÓ¦r¦ê¤¤ªº¥DÀɦW°_©l¦ì§}¡A¤À§O¦s©ópSrMainFn»PpTrMainFnÅܼÆùØ
no_error: mov fConfirm,eax
push ebx
lea edx,old_filename
push esi
lea ecx,new_filename
push edi
mov esi,pfd.pFullname
next_char: cmp esi,pfd.pMainFilename
je find_first
lodsw
mov [ecx],ax
mov [edx],ax
add ecx,2
add edx,2
jmp next_char
find_first: mov pSrMainFn,edx
mov pTrMainFn,ecx
;¦b¿Ã¹õ¤W¦L¥X¤u§@¥Ø¿ý¡]¥ç§Yn§ïÀɦWªºÀɮשҦb¥Ø¿ý¡^
mov WORD PTR [edx],0
INVOKE wsprintf,OFFSET buffer,OFFSET szFmtDir,OFFSET old_filename
INVOKE WriteConsole,hOutput,OFFSET buffer,eax,OFFSET CharWritten,0
INVOKE FindFirstFile,pfd.pFullname,OFFSET w32fd
cmp eax,INVALID_HANDLE_VALUE
je not_find
mov hFind,eax
;§â¤@ӲŦX¨Ï¥ÎªÌ¿é¤JªºÀɮצWºÙ¡]¦¹ÀɮצWºÙ¤£§t¸ô®|¦W¡A¦s©ñ©ów32fd.cFileNameÄæ¦ìùØ¡^¡A¶ñ¤Jold_filename¡B
;new_filename¨â¦r¦êùØ¡Aold_filenameªº¥DÀɦW»Pw32fd.cFileName¤@¼Ë¡Anew_filename¬O¥Î¨Ó¦s©ñ§ó§ï«á¥¿Å餤¤åªºÀɦW
;ªº¦r¦ê¡C¦bno_error¨ìfind_first¤§¶¡ªºµ{¦¡¤ù¬q¡A¥Î¨ÓÀx¦sold_filename»Pnew_filenameªº¸ô®|¦W¡A¦Ón§ó§ïªº¥DÀɦW
;°_©l¦ì§}¡A»P§ó§ï«áªº¥DÀɦW°_©l¦ì§}¡A¤À§O¦s©ñ¦bpSrMainFn»PpTrMainFn¨âÓÅܼÆùØ
next_file: lea esi,w32fd.cFileName
mov ebx,pSrMainFn ;EBX¡×ì¨ÓªºÀɦW°_©l¦ì§}¡]¦p¦³¸ô®|¡A¦bEBX©Ò«ü¦ì§}¤§«e¡^
mov edx,pTrMainFn ;EDX¡×«á¨ÓªºÀɦW°_©l¦ì§}¡]¦p¦³¸ô®|¡A¦bEDX©Ò«ü¦ì§}¤§«e¡^
mov fChanged,0
char_in_fn: lodsw
mov [ebx],ax
add ebx,2
cmp ax,4e00h ;Yì¨ÓÀɮתºÀɦW©Ò§tªº¦r¤¸¡A¦b4e00h¡ã9fefh¤§¶¡¡A¤~¬O¦b¤¤
jb not_CJK_UI ;¤éÁú²Î¤@ªí·N¤å¦rªº¤¤¤å¦r¡C¸U°ê½Xªº¤¤¤éÁú²Î¤@ªí·N¤å¦r¡A¥¿
cmp ax,9fefh ;Åé¦r»P²Åé¦r¬O§¨Âø½s½X¡C¦b³o½d³ò¤ºªº¦r¤¸¡A¤~¶·³B²z¡C
ja not_CJK_UI
mov edi,OFFSET SCH
mov ecx,n_words
repne scasw
jecxz not_CJK_UI ;¦pªGECX¡×0¡Aªí¥Ü¨S¦³¹ïÀ³ªº¥¿Åé¦r¡A¥u¦n¥Îì¨Óªº¦r¥N´À
sub edi,OFFSET SCH
add edi,OFFSET TCH
cmp ax,[edi-2] ;YAX¡×[EDI-2]¡Aªí¥Ü¥¿Åé¦r»P²Åé¦rªº¸U°ê½X¬Û¦P¡A¤]¤£¶·
je not_CJK_UI ;°µ³B²z¡Aª½±µ¸õ¨ìnot_CJK_UI³B¡C
mov ax,[edi-2]
inc fChanged
not_CJK_UI: mov [edx],ax
add edx,2
or ax,ax
jnz char_in_fn
cmp fChanged,0 ;¦pªGfChanged¬°¹s¡Aªí¥Ü³oÓÀɮצWºÙ¤¤¡A¨S¦³Â²Åé¦r»ÝnÅÜ¥¿Åé¦r
jz a_find_over
inc nFitFileName
cmp fConfirm,0 ;¦pªG¨Ï¥ÎªÌ¦³¿é¤J¡u-C¡v¡Aªí¥Ün¥Ñ¨Ï¥ÎªÌ½T»{¬O§_§ïÀɦW
jz rename ;¦pªG¨Ï¥ÎªÌ¦³¿é¤J¡u-C¡v¡A«hfConfirm¡×1
input_again: INVOKE wsprintf,OFFSET buffer,OFFSET szFmtConfirm,pSrMainFn,pTrMainFn
INVOKE WriteConsole,hOutput,OFFSET buffer,eax,OFFSET CharWritten,0
INVOKE ReadConsole,hInput,OFFSET buffer,3,OFFSET CharWritten,0
lea ebx,buffer
cmp WORD PTR [ebx],4eh ;¡uN¡v
je a_find_over
cmp WORD PTR [ebx],6eh ;¡un¡v
je a_find_over
cmp WORD PTR [ebx],59h ;¡uY¡v
je rename
cmp WORD PTR [ebx],79h ;¡uy¡v
jne input_again
rename: INVOKE MoveFile,OFFSET old_filename,OFFSET new_filename
or eax,eax
jnz success_rename
call GetLastError
cmp eax,ERROR_ALREADY_EXISTS;ÀˬdÀɮ׬O§_¦s¦b
jne finish
INVOKE wsprintf,OFFSET buffer,OFFSET szFmtExist,pTrMainFn,pSrMainFn
jmp pnt_msg
success_rename: inc nChgFileName
INVOKE wsprintf,OFFSET buffer,OFFSET szFmtRename,pSrMainFn,pTrMainFn
pnt_msg: INVOKE WriteConsole,hOutput,OFFSET buffer,eax,OFFSET CharWritten,0
a_find_over: INVOKE FindNextFile,hFind,OFFSET w32fd
or eax,eax
jnz next_file
finish: INVOKE FindClose,hFind
pop edi
pop esi
pop ebx
INVOKE wsprintf,OFFSET buffer,OFFSET szFmtChgFile,nFitFileName,nChgFileName
INVOKE WriteConsole,hOutput,OFFSET buffer,eax,OFFSET CharWritten,0
INVOKE CloseHandle,hOutput
INVOKE CloseHandle,hInput
exit: INVOKE ExitProcess,eax ;EAX¡×ªð¦^¨t²Îªº¿ù»~½X¡AYEAX¡×0¡Aªí¥Ü¿ù»~¡FYEAX¡×1¡Aªí¥Ü¥¿±`
main ENDP
;*************************************************************************************************************
END main
;https://www.pconlife.com/
|
FN2TC ¬O±±¨î¥xµ{¦¡¡A¨Ã«D¤@¯ëµøµ¡µ{¦¡¡C²ÕĶ¤èªk»Pµøµ¡µ{¦¡µy¦³¤£¦P¡A®t§O¦b©ó³sµ²®É¡A¶·¤U¹F¡u/SUBSYSTEM:CONSOLE¡v°Ñ¼Æ¡C²ÕĶ»P³sµ²¹Lµ{¦p¤U¡G
E:\HomePage\SOURCE\Win32\FN2TC>SET INCLUDE=C:\masm32\INCLUDE;%INCLUDE% [Enter] E:\HomePage\SOURCE\Win32\FN2TC>SET LIB=C:\masm32\LIB;%LIB% [Enter] E:\HomePage\SOURCE\Win32\FN2TC>SET PATH=C:\masm32\BIN;%PATH% [Enter] E:\HomePage\SOURCE\Win32\FN2TC>SET ML=/coff /link /SUBSYSTEM:CONSOLE [Enter] E:\HomePage\SOURCE\Win32\FN2TC>ml fn2tc.asm [Enter] Microsoft (R) Macro Assembler Version 6.15.8803 Copyright (C) Microsoft Corp 1981-2000. All rights reserved. Assembling: fn2tc.asm ************* UNICODE Build ************* Microsoft (R) Incremental Linker Version 5.12.8078 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /SUBSYSTEM:WINDOWS "fn2tc.obj" "/OUT:fn2tc.exe" E:\HomePage\SOURCE\Win32\FN2TC>
³o¤@¸`¡A¤p¤ì°¸n½Í½Í FN2TC ¹B§@ì²z¡A¥i¤À¬°´XÓ³¡¥÷¨Ó»¡¡G©R¥O¦C¦r¦ê¡BFindFirstFile/FindNextFile/FindClose ªº¥Îªk¡BGetFileAttributes¡BGetFullPathName¡B¤ÀªR get_parameter °Æµ{¦¡
¤@¯ë°õ¦æ±±¨î¥xµ{¦¡®É¡A³£¬O¥ý°õ¦æ CMD.EXE µ{¦¡¡A¶}±Ò¤@ÓºÙ¬°¡u©R¥O´£¥Ü¦r¤¸¡vªºµøµ¡¡A¦b¡u©R¥O´£¥Ü¦r¤¸¡v¤U¿é¤Jµ{¦¡¦WºÙ´Nºâ¬O°õ¦æ¤F¡C¦³®É¤]·|¦bµ{¦¡¦WºÙ«á±¥[¤W¤@¨Ç°Ñ¼Æ¡A¯à°÷«ü©w±±¨î¥xµ{¦¡°µþ¨Ç¨Æ¡A©Î¬O«ç»ò°µ¡C³o¨Ç³Q¨Ï¥ÎªÌ¿é¤Jªºµ{¦¡¦WºÙ¥H¤Î°Ñ¼Æ¡AºÙ¬°¡u©R¥O¦C¦r¦ê¡v¡CnÀò±o¨Ï¥ÎªÌ¿é¤Jªº©R¥O¦C¦r¦ê¡A¥i¥H¦bµ{¦¡ùØ©I¥s GetCommandLine API ( ¦b FN2TC.ASM ªº²Ä 319 ¦æ )¡A³oÓ API ¨S¦³°Ñ¼Æ¡A¶Ç¦^ȬO¨Ï¥ÎªÌ¿é¤Jªº¡u©R¥O¦C¦r¦ê¡v¦ì§}¡C¨Ò¦p¤U±ªº¨Ò¤l¡G
E:\HomePage\SOURCE\Win32\FN2TC>fn2tc -C [Enter] ¡÷GetCommandLine ©Ò¶Ç¦^ªº¦r¦ê¬O¡ufn2tc -C¡v¦A¥[¤W NULL¡C E:\HomePage\SOURCE\Win32\FN2TC>D: [Enter] D:\>E:fn2tc -C C:\masm32 [Enter] ¡÷GetCommandLine ©Ò¶Ç¦^ªº¦r¦ê¬O¡uE:fn2tc -C C:\mams32¡v¦A¥[¤WªÅ¦r¤¸ D:\>E:fN2tC -c Ê^¨|.txt [Enter] ¡÷GetCommandLine ©Ò¶Ç¦^ªº¦r¦ê¬O¡uE:fN2tC -c Ê^¨|.txt¡v¦A¥[¤WªÅ¦r¤¸
±q¤W±ªº¤TÓ¨Ò¤l¡A´NÀ³¸Ó¯àª¾¹D¡AGetCommandLine ©Ò¶Ç¦^¨Óªº©R¥O¦C¦r¦ê¡A¨ä¹ê´N¬O½Æ»s¨Ï¥ÎªÌ©Ò¿é¤Jªº©Ò¦³¦r¤¸¦Ó¤w¡C
¦pªG¨Ï¥Î Olly Debug °£¿ù¡A¨Ã¥Bn¦b°£¿ù®É¿é¤J°Ñ¼Æ¡A¬O§_¥i¥H°µ¨ì©O¡Hµª®×¬O·íµM¥i¥H¡C©³¤UÁ|Ó¨Ò¤l¡C¨Ò¦p·Qn¹ï¡uE:\HomePage\SOURCE\Win32\FN2TC\fn2tc.exe¡vµ{¦¡°£¿ù¡A¨ä¨BÆJ¦p¤U¡G
¦Ó¦b¤Wz¹ï¸Ü²°ùØ¿é¤Jªº°Ñ¼Æ¬O¡u-C Ê^¨|.txt¡vªº¸Ü¡A¦b Olly Debug ©I¥s GetCommandLine ¶Ç¦^¨Óªº©R¥O¦C¦r¦ê¬O¡u"E:\HomePage\SOURCE\Win32\FN2TC\fn2tc.exe" -C Ê^¨|.txt¡v¡A»P¦b©R¥O´£¥Ü¦r¤¸ªºµ²ªG²¤·L¤£¦P¡C¤]´N¬O»¡¡AOlly Debug ©Ò¶Ç¦^¨Óªº°Ñ¼Æ¡A·|¥Î¨âÓ¡u"¡v§âµ{¦¡¦WºÙ¬A°_¨Ó¡A¦Ó¥Bµ{¦¡¦WºÙ·|¥H¥]§tºÏºÐ¾÷¦Wªºµ´¹ï¸ô®|ªí¥Ü¡F¦Ó«áªº°Ñ¼Æ¡A¥þ«ö·Ó¨Ï¥ÎªÌ¿é¤J°Ñ¼Æªºµ²ªG¡C¦p¤U¹Ï©Ò¥Ü¡A¦b①¥Îºñ½u®Ø¦íªº¬O©I¥s GetCommandLine «á¡A©Ò¶Ç¦^¡u©R¥O¦C¦r¦ê¡v¦ì§}¡A¦Ó¨ä¤º®e¦b②©M③¥Î¬õ½u®Ø¦íªº°Ï°ì¡A´N¬OGetCommandLine ©Ò¶Ç¦^¨Óªº¡u©R¥O¦C¦r¦ê¡v¡G
¤£ºÞ¬O¦b©R¥O´£¥Ü¦r¤¸¤U¸ü¤J°õ¦æªºµ{¦¡¡A©Î¬O¥Î Olly Debug ¸ü¤J°£¿ùªºµ{¦¡¡A¦pªG¦bì©l½X¤¤¦³¤U±±Ôz¡G
__UNICODE__ EQU 1 ;¤ä´©UNICODE
INCLUDE WINDOWS.INC
¨º»ò²ÕĶ³sµ²«á©Ò±oªºµ{¦¡¡A¦b³B²z¦r¤¸®É¡A¬O¥H¸U°ê½X¤è¦¡³B²zªº¡C·í¨ä©I¥s GetCommandLine ¶Ç¦^¨Óªº©R¥O¦C¦r¦ê¬O¥H¸U°ê½X½s½X¡F¦pªG¨S¦³¤W±ªº±Ôz¡A¨ºµ{¦¡¬O¨Ï¥Î ANSI ½s½X¡A«h¸Ó©R¥O¦C¦r¦ê¤]¬O¥H ANSI ½s½X¡C¦b·¥¤j³¡¤Àªº±¡§Î¤U¡A«eªÌ¤@Ó¦r¦û¥Î¨âӦ줸²Õ¡A«áªÌ¥u¦û¥Î¤@Ӧ줸²Õ¡C³o¦b²Õ¦X»y¨¥ùØ¡A³B²z¦r¤¸®Én¤p¤ß³B²z¡A§_«h«Ü®e©öµo¥Í¿ù»~¡C
¦pªGn¤@¦¸³B²z¤j¶qªº¯S©wÀɮסA¥i¥H¥Î FindFirstFile/FindNextFile/FindClose ·f°t¸U¥Î¦r¤¸¡A·|«D±`¤è«K¡C¸U¥Î¦r¤¸ªº»¡©ú¡A½Ð«ö³oùØ¡C¦¹³B»¡©ú FindFirstFile/FindNextFile/FindClose ¤TÓ Win32 API ªº¥Îªk¡C³o¤TÓ Win32 API ªºì«¬¬O¡G
HANDLE WINAPI FindFirstFile( __in LPCTSTR lpFileName, __out LPWIN32_FIND_DATA lpFindFileData ); BOOL WINAPI FindNextFile( __in HANDLE hFindFile, __out LPWIN32_FIND_DATA lpFindFileData ); BOOL WINAPI FindClose( __inout HANDLE hFindFile );
FindFirstFile ªº¥\¥Î¬O¦b«ü©wªº¥Ø¿ý¤¤·j´M²Å¦XªºÀɮשΥؿý¡CFindFirstFile ²Ä¤@ӰѼƬOÀɦW¦ì§}¡A²Ä¤GӰѼƬO WIN32_FIND_DATA µ²ºcÅé¦ì§}¡C©I¥s FindFirstFile «en§â lpFileName ¤Î lpFindFileData ³o¨âÓªí¥Ü¦ì§}ªºÅܼƶñ¦n¾A·íÈ¡A¦A¦æ©I¥s¡C¦pªG FindFirstFile ·j´M¥¢±Ñ¡AEAX ¶Ç¦^ªºªð¦^ȬO INVALID_HANDLE_VALUE ( INVALID_HANDLE_VALUE ¤§È¬°¡Ð1 )¡A¨Ã«D FALSE¡C¦¹®É¥i¥H¦A¶i¤@¨B©I¥s GetLastError¡A±o¨ì¿ù»~ªºì¦]¡C¦pªG FindFirstFile °õ¦æ¦¨¥\¡A¨t²Î·|§â·j´M¥N½X ( search handle )¡A¦s©ó EAX ¼È¦s¾¹¡A¨Ã¦b lpFindFileData ©Ò«üªº WIN32_FIND_DATA µ²ºcÅ餺¶ñ¦n§äµÛªº²Ä¤@ÓÀɮשΥؿýªº¸ê®Æ¡C§Ú̪ºµ{¦¡¡A´N¥i¥H§Q¥Î·j´M¥N½X¤Î WIN32_FIND_DATA ¤ºªº¸ê®Æ¡A¹ïÀɮ׶i¦æ«þ¨©¡B§R°£¡B§ó¦Wµ¥¹Lµ{¡C
¥Ñ FindFirstFile ¶Ç¦^¨Óªº·j´M¥N½X¡AÁÙ¥i¥H¥Î¦b FindNextFile ªº²Ä¤@ӰѼơA¥i§@¬°¤U¦¸·j´Mªº¸ê®Æ¡AÄ~Äò´M§ä¤U¤@ӲŦXªºÀɮסCFindNextFile ªº²Ä¤GӰѼƬO WIN32_FIND_DATA µ²ºcÅé¦ì§}¡C¦pªG FindNextFile ¦¨¥\ªº§äµÛ²Å¦XªºÀɮסA´N·|¶Ç¦^ TRUE¡A¨Ã§â§ä¨ìÀɮתº¬ÛÃö¸ê®Æ¶ñ¤J WIN32_FIND_DATA µ²ºcÅ餺¡A§Ú̪ºµ{¦¡¥i¥H§Q¥Î¦b WIN32_FIND_DATA µ²ºcÅ餺ªº¸ê®Æ¡A¶i¦æÀɮ׳B²z¡C¦pªG FindNextFile °õ¦æ¥¢±Ñ©Î§ä¤£¨ì²Å¦XªºÀɮסA·|¶Ç¦^ FALSE¡A¦A¶i¤@¨B©I¥s GetLastError ±o¨ì¥¢±Ñì¦]¡A¦pªG¬O¦]¬°¨S¦³²Å¦XªºÀɮצөÛP©I¥s¥¢±Ñ¡A¨º»ò GetLastError ·|¶Ç¦^ ERROR_NO_MORE_FILES¡C¦pªG¤w¸g¨S¦³²Å¦XªºÀɮצӥB¤]¤£¦An¶i¦æ·j´M¡A¨º»ò´N¸Ó©I¥s FindClose Ãö³¬¦¹¦¸·j´M¡CFindClose ¥u¦³¤@ӰѼơA´N¬O¥Ñ FindFirstFile ¶Ç¦^¨Óªº·j´M¥N½X¡C
ÂǥѤTÓ API ªº¯S©Ê¡A§ÚÌ¥i¥H³]p¤@Ó°j°é¡A³o¼Ë´N¯à³B²z©Ò¦³²Å¦XÀɮשΥؿý¤F¡C¾ãÓ¬yµ{¡A¥i¥H°Ñ¦Ò¥k¹Ï¡C±µµÛ¡A¤p¤ì°¸n»¡©úªº¬O FindFirstFile ªº¨âӰѼơA¥ý»¡ WIN32_FIND_DATA µ²ºcÅé¡A«á»¡ lpFileName¡CWIN32_FIND_DATA µ²ºcÅ餺ªºÄæ¦ì¦p¤U¡G
WIN32_FIND_DATA STRUCT dwFileAttributes DWORD ? ;ÄÝ©Ê ftCreationTime FILETIME <> ;Àɮ׫إ߮ɶ¡ ftLastAccessTime FILETIME <> ;³Ìªñ¦s¨ú®É¶¡ ftLastWriteTime FILETIME <> ;³Ìªñקï®É¶¡ nFileSizeHigh DWORD ? ;Àɮפj¤p¡A°ª¦ì§}ªºÂù¦r²Õ nFileSizeLow DWORD ? ;Àɮפj¤p¡A§C¦ì§}ªºÂù¦r²Õ dwReserved0 DWORD ? dwReserved1 DWORD ? cFileName BYTE MAX_PATH DUP (?);ÀɦW ( ¤£¥]§t¸ô®|¦W ) cAlternateFileName BYTE 14 DUP (?) ;µuÀɦW WIN32_FIND_DATA ENDS
WIN32_FIND_DATA µ²ºcÅ骺²Ä¤@ÓÄæ¦ì¡AdwFileAttributes¡A¬O«üÀÉ®×ÄÝ©Ê¡A¦p¤Uªí©Ò¥Ü¡AdwFileAttributes Äæ¦ì¥i¥H¬O¤Uªí¤¤ªº¤@өμÆÓªºÁp¶°¡G
ÄÝ©Ê | ¼ÆÈ | »¡©ú |
FILE_ATTRIBUTE_ARCHIVE | 20H | «O¦s¡Aªí¥ÜÀɮ׻ݳƥ÷¡A³q±`¬O´£¨Ñµ¹³Æ¥÷³nÅé©Î³Æ¥÷©R¥O¨Ï¥Îªº¡C·í¨Ï¥ÎªÌ«Ø¥ß©ÎקïÀɮ׮ɡA·|¦Û°Ê§â¸ÓÀɮ׳]©w¨ã¦³ FILE_ATTRIBUTE_ARCHIVE ÄÝ©Ê¡A¥H´£¥Ü³Æ¥÷³nÅé³oÓÀɮש|¥¼³Æ¥÷¡F³Æ¥÷«á¡A¦¹Äݩʦ۰ʨú®ø¡C¦pªG¨Ï¥ÎªÌ¦A¦¸×§ïÀɮסA·|¦A¦¸³]©w FILE_ATTRIBUTE_ARCHIVE ÄÝ©Ê¡C§ÚÌ¥iÂǦ¹ÄÝ©Ê¡A³]p³Æ¥÷³nÅé¡A¶È³Æ¥÷קï¹LªºÀɮסA¤£³Æ¥÷¥¼§ó°ÊªºÀɮסC |
FILE_ATTRIBUTE_COMPRESSED | 800H | À£ÁY¡Aªí¥ÜÀɮשΥؿý¬°À£ÁYªº¡C¹ïÀɮרӻ¡¡Aªí¥Ü¦¹Àɮ׳QÀ£ÁY¹L¡C¹ï¥Ø¿ý¨Ó»¡¡A¦³¤F¦¹ÄÝ©Ê«á¡A¦¹¥Ø¿ýùØ·s«ØªºÀÉ®×·|³QÀ£ÁY¡C |
FILE_ATTRIBUTE_DEVICE | 40H | «O¯d |
FILE_ATTRIBUTE_DIRECTORY | 10H | ¥Ø¿ý¡C¨ã¦³¦¹ÄݩʮɡAªí¥Ü¦¹¬°¥Ø¿ý¡A¦Ó«DÀɮסC |
FILE_ATTRIBUTE_ENCRYPTED | 4000H | ¥[±K¡C¹ïÀɮרӻ¡¡A¬O¤º®e¥[±K¡C¹ï¥Ø¿ý¨Ó»¡¡A¬O¹ï±N¨Ó·s«ØªºÀɮצ۰ʳ]©w¥[±KÄÝ©Ê¡C |
FILE_ATTRIBUTE_HIDDEN | 2H | ÁôÂáA¤@¯ë¦Ó¨¥¡A¨ã¦³¦¹ÄݩʪºÀɮשΥؿý¡A¦bÀÉ®×Á`ºÞùب£¤£µÛ¡C¦ý¥i¥H¦b¡uÀÉ®×Á`ºÞ¡v¡÷¡u¤u¨ã¡v¡÷¡u¸ê®Æ§¨¿ï¶µ¡v¡÷¡uÀ˵ø¡v¡÷¡uÅã¥Ü©Ò¦³Àɮפθê®Æ§¨¡vùس]©w¦¨¡uÅã¥Ü©Ò¦³Àɮפθê®Æ§¨¡v¡A³o¼Ëªº¸Ü¡A§Y¨Ï¨ã¦³ FILE_ATTRIBUTE_HIDDEN ÄÝ©Ê¡A¤]¯à¨£±oµÛ¡C |
FILE_ATTRIBUTE_NORMAL | 80H | ÀɮרS¦³³]¸m¨ä¥LÄÝ©Ê¡A¦¹ÄÝ©Ê¥u¯à³æ¿W¨Ï¥Î¡C |
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | 2000H | |
FILE_ATTRIBUTE_OFFLINE | 1000H | Â÷½u¡CÀɮפº®e¼È®É¤£¥i¥Î¡A¦¹ÄݩʳQ»·ºÝÀx¦s¸Ë¸m ( remote storage ) ³nÅé©Ò¥Î¡A¤£¥i¥ô·N§ó§ï³oºØÄÝ©Ê¡C |
FILE_ATTRIBUTE_READONLY | 1H | °ßŪ¡C¹ïÀɮצӨ¥¡AÀ³¥Îµ{¦¡¥u¯àŪ¨ú¡A¤£¯àקï©Î§R°£¡C¹ï¥Ø¿ý¦Ó¨¥¡AÀ³¥Îµ{¦¡¤£¯à§R°£¡C |
FILE_ATTRIBUTE_REPARSE_POINT | 400H | |
FILE_ATTRIBUTE_SPARSE_FILE | 200H | µ}²¨ÀɮסC |
FILE_ATTRIBUTE_SYSTEM | 4H | ¨t²ÎÀÉ¡Aªí¥Ü¦¹ÀɮשΥؿý¬O§@·~¨t²Îªº¤@³¡¥÷¡A |
FILE_ATTRIBUTE_TEMPORARY | 100H | ¼È¦sÀÉ¡C³q±`Ãö³¬¼È¦sÀÉÀÉ®×¥N½X®É¡A¨t²Î·|§R°£¦¹ÀɮסC |
FILE_ATTRIBUTE_VIRTUAL | 10000H |
WIN32_FIND_DATA ªº²Ä¤G¡B¤T¡B¥|ÓÄæ¦ì¡A¤À§Oªí¥ÜÀɮ׫إ߮ɶ¡¡B³Ìªñ¦s¨úªº®É¶¡¡B³Ìªñקï®É¶¡¡A§¡¥H FILETIME ®æ¦¡°O¿ý¡CnFileSizeHigh¡BnFileSizeLow ¦X°_¨Ó¬O¤@Ó¤»¤Q¥|¦ì¤¸ªº¼Æ¡A¥NªíÀɮפj¤p¡A¥H¦ì¤¸²Õ¬°³æ¦ì¡A¦]¦¹Àɮפj¤p¬° nFileSizeHigh¡Ñ100000000H¡ÏnFileSizeLow ¦ì¤¸²Õ¡F¦pªG¬O¥Ø¿ý¡A«h¦¹Äæ¦ì¬° 0¡C±µ¤U¨Óªº dwReserved0 ¥u¦³¦b dwFileAttributes Äæ¦ì¤¤¥]§t¤F FILE_ATTRIBUTE_REPARSE_POINT Äݩʤ~¦³·N¸q¡A§_«h¦¹Äæ¦ìµL¥Î¡CdwReserved1 ¬O«O¯dªºÄæ¦ì¡A¯d«Ý±N¨Ó¨Ï¥Î¡CcFileName ¬O¤@Óªø 260 Ó¦r¤¸ªº¦r¦ê¡Aªí¥ÜÀɦW ( ¶È§t¥DÀɦW»P°ÆÀɦW¡A¤£¥]§t¸ô®| )¡CcAlternateFileName ¬°¤@Ó 14 ¦ì¤¸²Õªøªº¦r¦ê¡A¨ä¤º°O¿ýµÛµuÀɦW¡AµuÀɦW¬O«ü DOS ¨Ï¥Îªº 8.3 §ÎºA¡A¥ç§Y 8 Ӧ줸²Õªøªº¥DÀɦW¡A¦A¥[¤W 3 Ӧ줸²Õªøªº°ÆÀɦW¡A¨ä¶¡¥H¡u.¡v¹j¶}¡C
©³¤U¡A¤p¤ì°¸n»¡©úªº¬O FindFirstFiile ªº²Ä¤@ӰѼơAlpFileName¡ClpFileName ¬Oªí¥ÜÀɮצWºÙ¦r¦êªº¦ì§}¡A³oÓªí¥ÜÀɮצWºÙªº¦r¦ê¡A¤]¥i¥H¥]§tºÏºÐ¾÷¦W©Î¸ô®|¦W¡C³q±`¬O¼g¦¨¤U±ªº§Î¦¡¡A²Ä¤@Ó¬Oµ´¹ï¸ô®|¡A²Ä¤GÓ¬O¬Û¹ï¸ô®|¡A³o¨âºØ¸ô®|ªº»¡©ú¡A½Ð«ö³oùØ¡C
X:\sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy X:sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy
¡uX:¡v¬OºÏºÐ¾÷¦WºÙ¡Fsub-dir-1¡Bsub-dir-2¡K¬O¥Ø¿ý¦WºÙ¡Fxxxxxx.yyy ¬OÀɮצWºÙ¡A¨ä¤¤¡uxxxxxx¡v¬O¥DÀɮצW¡A¡uyyy¡v¬O°ÆÀɦW¡C¦b³oÓªí¥ÜÀɮצWºÙªº¦r¦ê¤¤¡A¬Y¨Ç³¡¥÷¬O¥i¥H¬Ù²¤ªº¡A¤À¦¨¤U±´XºØ±¡§Î»¡©ú¡C¤£ºÞ¬Oþ¤@ºØ±¡§Î¡A¥u¦³³Ì«á¤@¶µ¥i¥H¨Ï¥Î¸U¥Î¦r¤¸¡F«e±ªº¶µ¥Ø³£¤£¯à¨Ï¥Î¸U¥Î¦r¤¸¡A¦pªG¨Ï¥Î¤F¡AFindFirstFile ·|µo¥Í¿ù»~¡A¨Ã¶Ç¦^ INVALID_HANDLE_VALUE ¿ù»~È¡A¦pªG¦A©I¥s GetLastError¡AGetLastError ·|¶Ç¦^ ERROR_INVALID_NAME¡C©Ò¿×³Ì«á¤@¶µ¡A³q±`¬OÀɮצWºÙ¡F¦ý¤]¥i¯à¬OÀɦW¬Ù²¤±¡ªp¤U¡A³Ì«á¤@¼hªº¥Ø¿ý¦WºÙ¡C¦¹¥~¡AlpFileName ©Ò«üªºÀɦW©Î¥Ø¿ý¦W¦r¦ê¡A§Y¨Ï§t¦³ªÅ¥Õ¦r¤¸¡A¤]¤£¯à¥Î¤@¹ï¡u"¡v¬A¦í¡A§_«h·|µo¥Í¿ù»~¡A¶Ç¦^ INVALID_HANDLE_VALUE¡A¦A¶i¤@¨B©I¥s GetLastError «á¡A±o¨ì ERROR_INVALID_NAME¡F¨Æ¹ê¤W¤£»Ý¥Î¡u"¡v´N¦æ¤F¡C©³¤U§ÚÌ¬Ý¬Ý lpFileName ©Ò«üªº¦r¦ê¡A¥i¥H¦³þ¨Ç±¡§Î¡G
§¹¾ãªºÀɦW¡G¥]§tºÏºÐ¡B¸ô®|¡BÀɮפTªÌ¥þ³¡ªí¥Ü¥X¨Ó¡C¨ä®æ¦¡¹³©³¤Uªº¼Ë¤l¡G
X:\sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy X:sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy
²Ä¤@ºØ±¡§Î¡A¸û¬°³æ¯Â¡A±qºÏºÐ¾÷¦W¡B¸ô®|¦W¡BÀɮצW¨Ì§Ç±Æ¦C¥X¨Ó¡A¹³³oºØ±¡§ÎºÙ¬°¡uµ´¹ï¸ô®|¡v¡AFindFirstFile ¨Ì§Ç´N¯à§ä¨ìÀɮסC²Ä¤GºØ±¡§ÎºÙ¬°¡u¬Û¹ï¸ô®|¡v¡AFindFirstFile ·|±q¡uX:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¶}©l·j´M¡usub-dir-1¡v¤l¥Ø¿ý¡A¦A¥Ñ¡usub-dir-1¡v¤l¥Ø¿ýùØ·j´M¡u®]¡v¥Ø¿ý¡A¡usub-dir-2¡v......ª½¨ì¡usub-dir-n¡v¥Ø¿ýùتº¡uxxxxxx.yyy¡vÀɮ׬°¤î¡C¦ÓÃö¡u²{¦b¥Ø¿ý¡vªº»¡©ú¡A½Ð°Ñ¦Òµù¤@«á¥b³¡ªº»¡©ú¡C¤£ºÞ¬O¨Ï¥Îµ´¹ï¸ô®|©Î¬Û¹ï¸ô®|¡AÁöµM¸ô®|¦WºÙ¤£¥i¨Ï¥Î¸U¥Î¦r¤¸¡A¦ý¬OÀɮצWºÙ¥i¥H¨Ï¥Î¸U¥Î¦r¤¸¡A¦pªG¦A·f°t FundNextFile¡A´N¥i¥H·j´M¯S©wºØÃþªºÀɮסC©³¤Uªº¨Ò¤l¬O´M§ä¡uC:\masm32\bin\ml.exe¡v¥i°õ¦æÀÉ¡C
;************************************************************************************************************* .DATA filename DB "C:\masm32\bin\ml.exe",0 w32fd WIN32_FIND_DATA <> ;************************************************************************************************************* .CODE ;------------------------------------------------------------------------------------------------------------- ...... ...... INVOKE FindFirstFile,OFFSET filename,OFFSET w32fd
nª`·Nªº¬O¡A¦pªG FindFirstFile °õ¦æ¦¨¥\¡A¦b w32fd.cFileName ªº¦ì§}¤WªºÀɦW¬O¡uml.exe¡v¡A¨Ã¤£§tºÏºÐ¾÷¤Î¸ô®|¦WºÙ¡C¦pªG§â¤W¨Ò¤¤ªº filename ¦r¦ê§ï¦¨¡ufilename DB "C:\masm32\bin\*.exe",0¡v¡A¦A©M FindNextFile ·f°t¡A´N¯à·j´M¨ì¦b¡uC:\masm32\bin¡v¥Ø¿ý¤¤¡A©Ò¦³°ÆÀɦW¬° .exe ªºÀɮפF¡C
¬Ù²¤ÀɦW¡G¦pªG¬Ù²¤ÀɦWªº¸Ü¡A¨ä®æ¦¡¹³
X:\sub-dir-1\sub-dir-2\......\sub-dir-n X:sub-dir-1\sub-dir-2\......\sub-dir-n
³oºØ±¡§Î¡A¨ä¹ê´N¬O´M§ä«ü©wªº¥Ø¿ý¡C²Ä¤@ºØ±¡§Î¬Oµ´¹ï¸ô®|¡A±q¡uX:¡vºÏºÐ¾÷ªº®Ú¥Ø¿ý¶}©l§ä¡F²Ä¤GºØ±¡§Î¬O¬Û¹ï¸ô®|¡A±q¡uX:¡vºÏºÐ¾÷²{¦bªº¥Ø¿ý¶}©l¡C¤£ºÞþ¤@ºØ±¡§Î¡A³Ì«á¤@ӥؿý¤§«á¤£¯à¦³¡u\¡v¡A¤£µMªº¸Ü¡A´N·|¥X²{ INVALID_HANDLE_VALUE¡A¦pªG¦A©I¥s GetLastError¡AGetLastError ·|¶Ç¦^ ERROR_FILE_NOT_FOUND¡C¥u¦³³Ì©³¼hªº¥Ø¿ý¦WºÙ¡Asub-dir-n¡A¥i¥H¨Ï¥Î¸U¥Î¦r¤¸¡F¨ä¾l¥Ø¿ý¦WºÙ¡A³£¤£¯à¥X²{¸U¥Î¦r¤¸¡C¥ý¬Ý¬Ý²Ä¤@ºØ±¡§Î¡AÁ|Ó¨Ò¤l»¡©ú¡A¬Ý¬Ý©³¤Uªº¨Ò¤l¡G
;************************************************************************************************************* .DATA filename DB "C:\masm32\bin",0 w32fd WIN32_FIND_DATA <> ;************************************************************************************************************* .CODE ;------------------------------------------------------------------------------------------------------------- ...... ...... INVOKE FindFirstFile,OFFSET filename,OFFSET w32fd
³o¼Ëªº¸Ü¡AFindFirstFile ·|§â¡ubin¡vªº¸ê®Æ¶ñ¦b w32fd µ²ºcÅ餺¡A©Ò¥H¦b w32fd.cFileName ¬°¡ubin¡v¡Aw32fd.dwFileAttributes ¤º¡A´N·|¥]§t FILE_ATTRIBUTE_DIRECTORY ÄÝ©Ê¡A¨ä¥L¦UÄæ¦ìªº¸ê®Æ¤]³£¬O¡ubin¡vªº¸ê®Æ¡C¦ý¬O¡A¦pªG§â filename ¦r¦êÅܦ¨¡G
filename DB "C:\masm32\bin\",0
´N·|¨Ï FindFirstFile ²£¥Í¿ù»~¡AFindFirstFile ·|¶Ç¦^ INVALID_HANDLE_VALUE¡C¶i¤@¨B©I¥s GetLastError¡A·|±o¨ì ERROR_FILE_NOT_FOUND¡C©Ò¥H¡A³Ì«á±¦³¨S¦³¡u\¡v®t§O«Ü¤j¡C¦pªG¬O²Ä¤GºØ±¡§Î¡A¨Ï lpFileName Åܦ¨¬Û¹ï¸ô®|¡A·|Åý¨Ï¥Î±¡§ÎÅܱo¨ü¨ì«Ü¤jªº¨î¡C¦pªGÅý¤W±¨Ò¤l¤¤ªº filename Åܦ¨¡G
filename DB "C:masm32\bin",0
¨º»ò¡A¥u¦³¦b¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ý¬°®Ú¥Ø¿ý®É¡A©I¥s FindFirstFile ¤~·|¦¨¥\¡F§_«h³£·|µo¥Í¿ù»~¡A¶i¤@¨B©I¥s GetLastError¡A·|±o¨ì ERROR_FILE_NOT_FOUND¡C
¬Ù²¤ºÏºÐ¾÷©Î¸ô®|¦W¡G¦pªG¬O¬Ù²¤ºÏºÐ¾÷¦WºÙ¡A¨º»ò FindFirstFile ´N·|¥Ñ²{¦bªººÏºÐ¾÷¶}©l·j´M¡A¹³¤U±²Ä¤@ºØ±¡§Î¡F¦pªG¬O¬Ù²¤¸ô®|¦WºÙ¡A¨º»ò´N¬O¥Ñ²{¦bªº¥Ø¿ý·j´M¡A¹³¤U±²Ä¤GºØ±¡§Î¡F¦pªGºÏºÐ¾÷»P¸ô®|¦WºÙ³£¬Ù²¤¡A¨º´N±q²{¦bªººÏºÐ¾÷»P²{¦b¥Ø¿ý¶}©l·j´M¡C
\sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy X:xxxxxx.yyy xxxxxx.yyy
¬Ù²¤¸ô®|¦W¤ÎÀɦW¡G¦b³oºØ±¡§Î¤U¡A´N¥u³ÑºÏºÐ¾÷¦W¡CFindFirstFile ·|§ä¨ì¸ÓºÏºÐ¾÷ªº²{¦b¥Ø¿ý¡A¨Ã§â¸ÓºÏºÐ¾÷ªº²{¦b¥Ø¿ý¶ñ¤J lpFindFileData ©Ò«üªº WIN32_FIND_DATA µ²ºcÅ餺¡C¦ý¬O¦pªG¸ÓºÏºÐ¾÷ªº²{¦b¥Ø¿ý¬O®Ú¥Ø¿ýªº¸Ü¡AFindFirstFile ·|µo¥Í¿ù»~¡A¶i¤@¨B©I¥s GetLastError¡A·|±o¨ì ERROR_FILE_NOT_FOUND ¿ù»~½X¡C
¬Ù²¤ºÏºÐ¾÷¤ÎÀɦW¡G¦b³oºØ±¡§Î¤U¡A´N¥u³Ñ¸ô®|¦W¡CFindFirstFile ·|±q²{¦bºÏºÐ¾÷¶}©l·j´M¡Aª½¨ì«ü©wªº¥Ø¿ý¡C³Ì©³¼hªº¥Ø¿ý¥i¥H¨Ï¥Î¸U¥Î¦r¤¸¡A¨ä¾l¤£¦æ¡C
Á¿¤F³o»ò¦h¡AÁ`¦@¤ºØ±¡§Î¡A¦³¤@ÂI½ÆÂø¡C²³æªº»¡¡AFindFirstFile ¦b°õ¦æ®É¡A¥u¬O¨Ì·Óµ{¦¡³]p®v©Òµ¹ªº lpFileName ¦ì§}¡A§ä¨ì¸Ó¦ì§}ªº¦r¦ê¡CµM«á¨Ì·Óµ{¦¡³]p®v©Òµ¹ªº¸ô®|¡A©¹¤U´M§ä¤@¼h¤@¼hªº¥Ø¿ý¡Aª½¨ì²Å¦XªºÀɮשΥؿý¬°¤î¡C¦pªG¨S¦³ºÏºÐ¾÷¦W©Î¸ô®|¦W¡A´N¥H²{¦bªººÏºÐ¾÷©Î²{¦bªº¥Ø¿ý¶}©l·j´M¡C¨ä¹ê¡AFindFirstFile ¹ïÀɮשΥؿý¬O¤@µø¦P¤¯ªº¡A¥un²Å¦X¦r¦ê¡A³£¯à§ä¨ì¡CFindNextFile ¤]¬O¦p¦¹¡C
GetFileAttributes API ¬O¥Î¨Ó¨ú±oÀɮשΥؿýªºÄÝ©Ê¡A³o¨ÇÄÝ©Ê¥]§t¨t²ÎÀÉ¡B¼È¦sÀÉ¡B°ßŪÀÉ¡Kµ¥µ¥¡A¨ä쫬¬O
DWORD WINAPI GetFileAttributes( __in LPCTSTR lpFileName );
GetFileAttributes ¥u¦³¤@ӰѼơA´N¬OÀɮצWºÙ©Î¸ô®|¦WºÙªº¦ì§}¡AÀɮצWºÙ©Î¸ô®|¦WºÙ¥i¥H¨Ï¥Î¡uµ´¹ï¸ô®|¡v©Î¡u¬Û¹ï¸ô®|¡v¡C¦pªG GetFileAttributes ¦¨¥\°õ¦æ¡AEAX ·|ªð¦^ÀɮשΥؿýªºÄÝ©Ê¡C³oÓÄÝ©Ê©M WIN32_FIND_DATA µ²ºcÅ骺 dwFileAttributes Äæ¦ì©Ò©w¸qªº¬Û¦P¡A¥i¥H°Ñ¦Ò³oùØ¡C¦pªG©I¥s GetFileAttributes ¥¢±Ñ¡A¶Ç¦^ªº¿ù»~½X¬O INVALID_FILE_ATTRIBUTES¡A¥²¶·¶i¤@¨B©I¥s GetLastError ¤~¯à±o¨ìµo¥Í¿ù»~ªºì¦]¡C±`¨£²£¥Í¿ù»~ªºì¦]¡A¦³¤U±´XºØ±¡§Î¡G
GetFullPathName API ¬O¥Î¨ÓÀò¨ú¬YÓÀɮתº§¹¾ã¸ô®|¦WºÙ¤ÎÀɮצWºÙ¡C¨ä쫬¬°¡G
DWORD WINAPI GetFullPathName( __in LPCTSTR lpFileName, __in DWORD nBufferLength, __out LPTSTR lpBuffer, __out LPTSTR* lpFilePart );
lpFileName ¬O¡u¬YÓÀɮסvªºÀɦW¦ì§}¡A¥H NULL µ²§À¡A¥i¥H¬OµuÀɦW ( §Y DOS §@·~¨t²Îªº 8.3 ÀɦW )¡A¤]¥i¥H¥]§tºÏºÐ¾÷¦WºÙ©Îºô¸ôºÏºÐ¾÷¦WºÙ¡CGetFullPathName ·|§â§¹¾ãªºÀɦW¡A¶ñ¤J lpBuffer ©Ò«ü©w¦ì§}ªº½w½Ä°Ï¤º¡A¦Ó¦¹½w½Ä°Ïªº¤j¤p¬° nBufferLength¡ClpFilePart ¬O½w½Ä°Ï¤º§¹¾ãÀɦW³Ì«á¤@¶µªº¦ì§}¡A¦pªG¤£»Ýn¦¹¸ê®Æ¡A¥i¥H§â lpFilePart ³]¬° 0¡C¦pªG GetFullPathName °õ¦æ¦¨¥\¡A·|¶Ç¦^¶ñ¤J½w½Ä°Ï¤ºªº¦r¤¸¼Æ¡A¦¹¦r¤¸¼Æ¤£¥]§t NULL ¦r¤¸¡C¦pªG½w½Ä°Ï¤Ó¤p¡A¥ç§Y nBufferLength ¤Ó¤p¡A¥HP©óµLªk®e¯Ç§¹¾ãÀɦW¦Ó¥¢±Ñ¡Aªð¦^ȬO§¹¾ãÀɦW¥¿½Tªºªº¦r¤¸¼Æ¡A¦¹¦r¤¸¼Æ¥]§t NULL ¦r¤¸¡Cµ{¦¡¥i¥HÂÇ¥ÑÀˬdªð¦^Ȫº¦r¤¸¼Æ¡A¬O§_¤j©ó½w½Ä°Ï¤j¤p¡A¦pªG¤j©ó¡A´Nªí¥Ü½w½Ä°Ï¤Ó¤pµLªk®e¯Ç§¹¾ãÀɮצWºÙ¡C¦pªG¬O¨ä¥Lì¦]¾ÉPªº¿ù»~¡Aªð¦^Ȭ° 0¡A»Ýn¶i¤@¨B©I¥s GetLastError¡A¤~¯à±oª¾µo¥Í¿ù»~ªºì¦]¡C
GetFullPathName ªº¹B§@¤è¦¡¡A¨ä¹ê¥u¬O§â²{¦bºÏºÐ¾÷¡B²{¦b¥Ø¿ý¡A»P lpFileName ©Ò«ü¦ì§}ªº¦r¦êµ²¦X¦b¤@°_¡C°²¦p lpFileName ¤ºªº¦r¦ê¥»¨´N¬O§¹¾ãªº¸ô®|¦WºÙ»PÀɮצWºÙ¡A¨º»ò GetFullPathName ¥u¬O±N¦¹¦r¦ê·Ó§Û¨ì½w½Ä°Ï¤º¡C¦¹¥~¡AGetFullPathName ¨Ã¤£Àˬd lpFileName ©Ò«üªº¦r¦ê¡A¬O§_§t¦³¸ô®|¦W¡BÀɦW©Ò¤£¦Xªkªº¦r¤¸¡F¤]¤£·|Àˬd»yªk¤Wªº¿ù»~¡A¨Ò¦p¨âӺϺо÷¦W¤]¤£·|³y¦¨¿ù»~¡C¦¹¥~¡AGetFullPathName ¨Ã¤£·|Àˬd lpFileName ©Ò«üªºÀɮ׬O§_¯uªº¦s¦b¡C
get_parameter °Æµ{¦¡¦³ÂIº¾¸H¡A¦pªG¸Ô²Ó¸Ñ»¡¡A¦³ÂI¨£¾ð¤£¨£ªLªº·Pı¡A¦Ó¥B¥¢¥h«ÂI¡C¦]¦¹¤p¤ì°¸¦b³oùØ¡A¥u´£¥X´XÓÆ[©À¡C
¤ÀªR¨Ï¥ÎªÌ¿é¤Jªº¡u©R¥O¦C¦r¦ê¡v·|µo²{¡A°Ñ¼Æ»P°Ñ¼Æ¤§¶¡¬O¥HªÅ¥Õ¦r¤¸¤À¹j¡CªÅ¥Õ¦r¤¸ªº¸U°ê½X¬O 0020h¡A¦ÓÀɮשΥؿý¦WºÙ¤]¥i¥H§t¦³ªÅ¥Õ¦r¤¸¡C¦]¦¹n¦p¦ó¤À¿ëªÅ¥Õ¦r¤¸¡A¬OÀɦW©Î¥Ø¿ý¦Wªº¤@³¡¥÷¡AÁÙ¬O°Ñ¼Æªº¤À¹j°O¸¹¡A¬O¤@¤jÃøÃD¡C©¯¦n¦b¡u©R¥O´£¥Ü¦r¤¸¡vùØ¡A§t¦³ªÅ¥Õ¦r¤¸ªºÀɦW©Î¥Ø¿ý¦W¡A¥²¶·¥Î¨âÓ¡u"¡v¬A°_¨Ó¡C¨Ò¦p©³¤Uªº¨Ò¤l¡G
"C:\Program Files" C:\"Program Files" C:\"Program Files"\"Debugging Tools for Windows (x64)" C:\"Program Files\Debugging Tools for Windows (x64)" C:\Progra"m F"iles\"Debugging Tools for Windows (x64)"
¤W±³o¨Ç¨Ò¤l¡A³£¬O¦Xªkªº¡C¨Æ¹ê¤W¥¦Ì³£¬O Windows §@·~¨t²Î¤º«nªº¥Ø¿ý¡C¤W±ªº¤Ó¨Ò¤l¤¤¡A«e¨âÓ¨Ò¤l¬O¤@¼Ëªº¡A«á¤TÓ¤]³£¬Û¦P¡C¥J²ÓÆ[¹î«á¡A¥i¥H±o¨ìµ²½×¡G¥un¬O¦b¨âÓ¡u"¡v¤§¶¡ªºªÅ¥Õ¦r¤¸¡A¤£ºÞ´XӪťզr¤¸¡A³£¬OÀɦW©Î¥Ø¿ýªº¤@³¡¥÷¡C¦Ó³o¨âÓ¡u"¡v¡A¤]¥i¥H¦b¥ô·N¦ì¸m¡A¥un¯à§âªÅ¥Õ¦r¤¸¬A¦í¡AªÅ¥Õ¦r¤¸´N¬OÀɦW©Î¥Ø¿ýªº¤@³¡¥÷¡C¦]¦¹¡A¦b¨âÓ¡u"¡v¤§¥~ªºªÅ¥Õ¦r¤¸¡A´N¥Nªí¬O°Ñ¼Æ¤§¶¡ªº¤À¹j²Å¸¹¡C¥i¥H³o»ò«ä¦Ò¡A¦]¬°¡u"¡v¬O¨â¨â¦¨¹ïªº¡A©Ò¥HªÅ¥Õ¦r¤¸¥X²{«e¡A¦³°¸¼ÆÓ¡u"¡v¡A¥NªíªÅ¥Õ¦r¤¸¦b¨âÓ¡u"¡v¤§¥~¡A¬O°Ñ¼Æ¶¡ªº¤À¹j²Å¸¹¡C§ÚÌ¥i¥H³]¤@Óªì©lȬ° 0 ªºÅܼơA¥h°O¿ý¡u"¡vªºÓ¼Æ¡F¦A³]¥t¤@ÓÅܼưO¿ý¦ì§}¡A¦¹ÅܼƩҰO¿ýªº¦ì§}¥Ñ¡u©R¥O¦C¦r¦ê¡vªº§C¦ì§}¶}©l©¹°ª¦ì§}¡A¤@Ó¦r¤¸¡B¤@Ó¦r¤¸³v¤@Àˬd¡C¦pªG¹J¨ì¡u"¡v®É¡A´NÅý°O¿ý¡u"¡vªºÅܼƥ[¤@¡F¦pªG¹J¨ìªÅ¥Õ¦r¤¸®É¡A´NÀˬd°O¿ý¡u"¡vªºÅܼƬO°¸¼ÆÁÙ¬O©_¼Æ¡C¦pªG¬O°¸¼Æ¡A´Nªí¥Ü¦¹ªÅ¥Õ¦r¤¸¦b¨âÓ¡u"¡v¤§¥~¡A¬°°Ñ¼Æ¤§¶¡ªº¤À¹j²Å¸¹¡F¦pªG¬O©_¼Æ¡A´Nªí¥Ü¦¹ªÅ¥Õ¦r¤¸¦b¨âÓ¡u"¡v¤§¤º¡A¬°ÀɦW©Î¥Ø¿ý¦Wªº¤@³¡¥÷¡C
¦³¤F³oÓÆ[©À¤§«á¡A´N¤ñ¸û²³æ¤F¡C¦b FN2TC ì©l½Xªº²Ä 131¡ã153 ¦æ¡A¥Î¨Ó´M§ä¡u©R¥O¦C¦r¦ê¡vªºµ{¦¡¦WºÙ¡C¦b²Ä 133 ¦æ¡A³]©w EDX ¬°¹s¡A§â EDX ·í°µ¬Opºâ¡u"¡vӼƪºÅܼơF¦Ó²Ä 135 ¦æ¡A§â EBX ³]¬°«ü¦V¡u©R¥O¦C¦r¦ê¡vªº°_©l¦ì§}¡Cµ{¦¡ªº²Ä 141 ¦æ¨ì²Ä 148 ¦æªº°j°é¡A¬O¥h·j´Mµ{¦¡¦WºÙªºµ²§À¡C¦b²Ä 141 ¦æ¡AÀˬd¬O§_¹J¨ì¡u"¡v¦r¤¸¡A¦pªG¹J¨ì¤F´N¸õÅD¦Ü²Ä 149 ¦æ¡A¨Ï EDX ¼W¥[¤@¡F²Ä 143 ¦æ¡A¦p¹J¨ìªÅ¥Õ¦r¤¸¡A«h¸õÅD¦Ü²Ä 153 ¦æ¡AÀˬd EDX ¬O§_¬°°¸¼Æ¡A¦pªG¬O°¸¼Æ¡A¨ì²Ä 155 ¦æ¡Aªí¥Ü§äµÛ¤F¥Nªí¤À¹jµ{¦¡¦WºÙ»P²Ä¤@ӰѼƪºªÅ¥Õ¦r¤¸¡C
get_parameter ¤£¥u¤W±ªº°j°é¥Î³oÓÆ[©À¡A¦b²Ä 201¡ã228 ¦æ¡A¤]¤@¼ËªºÆ[©À¡A¥h§ä¨ì²Ä¤GӰѼƪºµ²§À¡C²Ä 203 ¦æ¡A§â EDX ³]¬°¹s¡A°O¿ý¡u"¡vӼơC²Ä 216¡ã217 ¦æ¡AÀˬd¬O§_¬°¡u"¡v¦r¤¸¡A¦pªG¬Oªº¸Ü¡A¸õÅD¦Ü²Ä 237 ¦æ¡A¨Ï EDX ¥[¤@¡C²Ä 209 ¦æ¡AÀˬd¬O§_¬°ªÅ¥Õ¡A¦pªG¬Oªº¸Ü´N¸õÅD¦Ü²Ä 250 ¦æ¡AÀˬd EDX ¬O§_¬°°¸¼Æ¡C¦pªG¬O°¸¼Æ¡A´N¨ì²Ä 252 ¦æ¡Aªí¥Ü©R¥O¦C¦r¦ê¤w¸gµ²§ô¡C
«e±²Ä①´£¹L¡AÀɮצWºÙ©Î¥Ø¿ý¦WºÙ¥i¥H¨Ï¥ÎªÅ¥Õ¦r¤¸¡C¦pªGn¦b©R¥O´£¥Ü¦C¤¤¿é¤JÀɦW©Î¥Ø¿ý¦W®É¡A¦Ó¦¹ÀɦW©Î¥Ø¿ý¦W§t¦³ªÅ¥Õ¦r¤¸®É¡A»Ý¥Î¤@¹ï¡u"¡v¬A°_¨Ó¡C¨Ò¦p¡A¤U±ªº¨Ò¤l¡A°²³]n§â¡uC:\Documents and Settings\UserXP\My Documents¡v¥Ø¿ý¤¤ªº©Ò¦³§t²Åé¦rªºÀɦW§ï¦¨¥¿Åé¦r¡AÀ³¸Ó¬On¿é¤J¤U±ªº«ü¥O¡G
E:\HomePage\SOURCE\Win32\FN2TC>FN2TC "C:\Documents and Settings\wanker\My Documents" [Enter]
¦ý¬O¹ï©ó Win32 API ¦Ó¨¥¡AÀɦW©Î¥Ø¿ý¦W¬O¤£¯à¦³¡u"¡vªº¡A¥²¶·¥H NULL µ²§À¡A¦pªG¦³¡u"¡v·|µo¥Í¿ù»~¡A¨Ò¦p FindFirstFile ´N¬O¦p¦¹¡C¦]¦¹¦b©I¥s Win32 API ¤§«e¡An§â¡u"¡v°£¥h¡C³o¤u§@¡A¤]¬O¥Ñ get_parameter °Æµ{¦¡§¹¦¨ªº¡C³o¬qµ{¦¡½X¦b²Ä 224 ¦æ¡ã 257 ¦æ¡C¤p¤ì°¸§Q¥Îªºì²z¬O¡A¥Î EBX «ü¦V¡u©R¥O¦C¦r¦ê¡v¡AEDI ¤]«ü¦V EBX ¦ì§}¡CµM«á¥Ñ§C¦ì§}¦V°ª¦ì§}Àˬd¨CÓ¡u©R¥O¦C¦r¦ê¡vªº¦r¤¸¡A¦Ó¨CÓ¦r¤¸¤S¦s¤J¨ì EDI ©Ò«üªº¦ì§}¡C¦ý¬O¦pªGÀˬd¨ì¡u"¡v¡A¨º´N¤£Àx¦s¡C¦Ó«áªº¦r¤¸¡A´N·|¦s¦b¡u"¡v¦r¤¸©Ò¦b¦ì§}¡A©ó¬O¡u"¡v´N³QÂл\¦¨«á±ªº¦r¤¸¤F¡A¦]¦Ó®ø°£¡u"¡v¦r¤¸¡Cµ{¦¡²Ä 237 ¦æ¡A¬OÀË´ú¨ì¡u"¡v¦r¤¸¡A¦pªG¬Oªº¸Ü¡A´N¨Ïpºâ¡u"¡vӼƪº EDX ¥[¤@¡AµM«á´N¸õ¨ì²Ä 227 ¦æ¡A¤£Àx¦s¡Aª½±µ³B²z¤U¤@Ó¦r¤¸¡F¦pªG¬O¨ä¥L¦r¤¸¡A³£·|¸õ¨ì 226 ¦æ¡A§â¦r¤¸¦s¤J EDI ©Ò«ü¦ì§}¡C
±q FN2TC ¨Ï¥Î¤èªk¡BFindFirstFile/FindNextFile/FindClose ªº¥Îªk¥H¤Î¤W±②³Bªº»¡©ú¡A±z·í¥iµo²{¤@¥ó´Æ¤âªº¦a¤è¡A¨º´N¬O¦b¡u©R¥O´£¥Ü¦r¤¸¡v³B¿é¤JªºÀɦW¡A»P FindFirstFile ³B©Ò©w¸qªºÀɦW¡A¨Ã¤£§¹¥þ¬Û¦P¡C¨Ò¦p¡A¦pªG¨Ï¥ÎªÌ¦b¡u©R¥O´£¥Ü¦r¤¸¡v¿é¤J¤U±¨Ò¤l¡G
E:\HomePage\SOURCE\Win32\FN2TC>fn2tc c:\masm32\
³o¬O¤¹³\ªº¡A¨ä·N¸q«Ü©úÅã¡A¦]¬°¡uc:\masm32¡v¬Oӥؿý¡A©Ò¥H¤Wz«ü¥O´N¬O§â¡A¡uc:\masm32\¡v¸ô®|¤¤§t¦³Â²Åé¦rªºÀɦW©Î¦r¥Ø¿ý§ï¦¨¥¿Åé¦r¡F¦ý¬O FindFirstFile «o¤£±µ¨ü³o¼ËªºÀɦW¡A¥²¶·§ï¦¨¡uc:\masm32\*.*¡v¤~¦æ¡A§_«h´N·|²£¥Í¿ù»~¡C°£¦¹¤§¥~¡A¤p¤ì°¸¤ÀªR¹L¡AÁ`¦@¦³¤U±´XºØ±¡ªp¬O¡uFN2TC¡v»P¡uFindFirstFile¡v¹ï°Ñ¼Æªº¸ÑÄÀ¡A¦³©Ò¥X¤Jªº±¡ªp¡G
FN2TC ªº¨Ò¤l | ¨Ï¥ÎªÌ¥»·N ( ©Î©R¥O´£¥Ü¤¸¤ºªº·N¸q ) | FindFirstFile ²Ä¤@Ó°Ñ¼Æ |
FN2TC "C:\Documents and Settings\*.*" | ³B²z¡uC:\Documents and Settings¡v¥Ø¿ýùتºÀÉ®× | ¤£¤¹³\¡A¦]¬°ÀɦW¤£¥i¦³¡u"¡v¡A·|µo¥Í INVALID_HANDLE_VALUE ¿ù»~¡A¦A¶i¤@¨B©I¥s GetLastError «á¡A±o¨ì ERROR_INVALID_NAME¡C¶·°£¥h¤Þ¸¹¤~¯à¥¿½T°õ¦æ¡C |
FN2TC C:\masm32\bin\ | ³B²z¡uC:\masm32\bin¡v¥Ø¿ýùتºÀÉ®× | ¤£¤¹³\¡A·|µo¥Í INVALID_HANDLE_VALUE ¿ù»~¡A¦A¶i¤@¨B©I¥s GetLastError «á¡A±o¨ì ERROR_FILE_NOT_FOUND ¿ù»~½X¡C¶·Âà´«¦¨¡uC:\masm32\bin\*.*¡v¡A¤~¯à¥¿½T°õ¦æ¡C |
FN2TC C:\masm32\bin | ³B²z¡uC:\masm32\bin¡v¥Ø¿ýùتºÀÉ®× | ¤¹³\¡A¤£µo¥Í¿ù»~¡A¦ý¶È³B²z¡ubin¡v¥Ø¿ý¦W¡A¦]¦¹¶·Âà´«¦¨¡uC:\masm32\bin\*.*¡v¤~²Å¦X¨Ï¥ÎªÌªº»Ý¨D¡C |
FN2TC C: FN2TC C:. |
¡uFN2TC C:¡v»P¡uFN2TC C:.¡v³£¬On³B²z C: ºÏºÐ¾÷²{¦b¥Ø¿ý¤ºªºÀɦW¤Î¤l¥Ø¿ý¦W | §â¡uC:¡v»P¡uC:.¡v·í¦¨°Ñ¼Æ©I¥s FindFirstFile¡Aµ²ªG³£¤@¼Ë¡A¥i¤À¦¨¨âºØ±¡§Î¨Ó»¡¡G
Y C: ºÏºÐ¾÷²{¦b¥Ø¿ý¬°®Ú¥Ø¿ý¡A·|¥X²{ INVALID_HANDLE_VALUE ¿ù»~¡A¦A¶i¤@¨B©I¥s GetLastError «á¡A±o¨ì ERROR_FILE_NOT_FOUND ¿ù»~½X¡C
Y C: ºÏºÐ¾÷²{¦b¥Ø¿ý¤£¬O®Ú¥Ø¿ý¡A¤£µo¥Í¿ù»~¡A¦ý¶È³B²z C: ºÏºÐ¾÷²{¦b¥Ø¿ýªº¦WºÙ¡A«D³B²z²{¦b¥Ø¿ýùتºÀɮסC
¦]¦¹³o¨âºØ±¡§Î¡A³£À³§ï¦¨¡uC:.\*.*¡v´N¦æ¤F¡C |
FN2TC C:.. | ³B²z C: ºÏºÐ¾÷²{¦b¥Ø¿ýªº¤W¤@¼h¥Ø¿ý¤ºªºÀɦW¤Î¤l¥Ø¿ý¦W | §â¡uC:..¡v·í¦¨°Ñ¼Æ©I¥s FindFirstFile¡A¤£µo¥Í¿ù»~¡A¦ý¶È³B²z C: ºÏºÐ¾÷²{¦b¥Ø¿ýªº¤W¤@¼h¥Ø¿ý¥»¨¡A¦ý«D³B²z¨ä¥Ø¿ýùتºÀɮסC¶·§ï¦¨¡uC:..\*.*¡v |
¤Wªí¤¤¡A²Ä¤@Ó¨Ò¤l¬O·í¨Ï¥ÎªÌ¦b©R¥O´£¥Ü¦r¤¸¡A¿é¤J«ü¥O¡A¡uFN2TC "C:\Documents and Settings\*.*"¡v®É¡A¤@©w±o¥[¤W¨âÓ¡u"¡v¡A¥H«KÅý FN2TC ª¾¹D¡An§â¡uC:\Documents and Settings¡v¥Ø¿ý¤ºªºÀɦW§ó§ï¬°¥¿Åé¦r¡A¦Ó¤£¬O¡uC:\Documents¡v¥Ø¿ý¡C¦ý¬O«o¤£¯à¥H¡u"C:\Documents and Settings\*.*"¡v¦A¥[¤W NULL µ²§Àªº¦r¦ê§@¬° FindFirstFile ªº²Ä¤@ӰѼơA¦]¬°ÀɦWùؤ£¯à¨Ï¥Î¡u"¡v¦r¤¸¡C¦]¦¹¦b²Ä¤@Ó¨Ò¤l¤¤¡An§â¡u"¡v°£¥h¡A¦Ó°£¥h¡u"¡vªº¤èªk¡A¦b②¤w´£¹L¤F¡C¦Ó FindFirstFile ·|¥H NULL µ²§À¡A©Ò¥H¯à²M·¡ª¾¹D¬O¡uC:\Documents and Settings¡v¥Ø¿ý¡C
¤Wªí¤¤ªº²Ä¤G©M²Ä¤TÓ¨Ò¤lùØ¡A¦]¬°¡ubin¡v¬O¡uC:\masm32¡v¥Ø¿ýùتº¤@Ó¤l¥Ø¿ý¡A©Ò¥H·í¨Ï¥ÎªÌ¦b©R¥O´£¥Ü¦r¤¸¡A¿é¤J«ü¥O¡A¡uFN2TC C:\masm32\bin\¡v©Î¡uFN2TC C:\masm32\bin¡v®É¡A¨ä¹ê¬On§â¡uC:\masm32\bin¡v¥Ø¿ýùتºÀɦW§ó§ï¬°¥¿Åé¦r¡C¦ý¬O¦b²Ä¤GÓ¨Ò¤l¤¤¡A¦pªG§â¡uC:\masm32\bin\¡v¦A¥[¤W NULL ¬°µ²§Àªº¦r¦ê·í°µ FindFirstFile ªº²Ä¤@ӰѼơA·|¨Ï FindFirstFile µo¥Í¿ù»~¡C¦Ó¦b²Ä¤TÓ¨Ò¤l¤¤¡A¦pªG§â¡uC:\masm32\bin¡v¦A¥[¤W NULL ¬°µ²§Àªº¦r¦ê·í°µ FindFirstFile ªº²Ä¤@ӰѼơA¨t²Î·|»~¥H¬°´N¬O«ü¡uC:\masm32\bin¡v¥Ø¿ý¥»¨¡A¦Ó«D¨ä¤ºªºÀɮסC·íµM³oÓ¡ubin¡v¥Ø¿ý¤£§t²Åé¦r¡A©Ò¥H¨ä¹ê¹ï FN2TC ªº§@¥Î¨Ó»¡¡A¬O²@µL§@¥Î¡A¦ý«o¤w¸g»~·|¤F¨Ï¥ÎªÌªº¥»·N¡C©Ò¥H²Ä¤G©M²Ä¤TÓ¨Ò¤l¡A³£¥²¶·¦b©I¥s FindFirstFile ¤§«e¡A§â°Ñ¼Æ§ï¦¨¡uC:\masm32\bin\*.*¡v¦A¥[¤W NULL µ²§Àªº¦r¦ê¤~¦æ¡C
¤Wªí¤¤ªº²Ä¥|Ó¨Ò¤l¡A¤£½×¬O¨Ï¥ÎªÌ¿é¤J¡uFN2TC C:¡v©Î¡uFN2TC C:.¡v¡A³£¬On¨Ï FN2TC §â¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ýùتºÀɦW¡AÂà´«¦¨¥¿Åé¦r¡C¦ý¬O¦pªG§â¡uC:¡v©Î¡uC:.¡v¦A¥[¤W NULL ¬°µ²§Àªº¦r¦ê¡A·í¦¨ FindFirstFile ªº²Ä¤@ӰѼơAFindFirstFile ¶Ç¦^¨Óªº´N¬O¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ý¡A¦Ó«D¥Ø¿ýùتºÀɮסA³o¸ò¨Ï¥ÎªÌªº¥»·N¤£¦P¡C¥t¥~ÁÙ¦³¤@Ó°ÝÃD¡A¦pªG¡uC:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¬O®Ú¥Ø¿ýªº¸Ü¡Aµ²ªG·|µo¥Í ERROR_FILE_NOT_FOUND ¿ù»~¡C¦ý¦pªG§â¡uC:¡v©Î¡uC:.¡v³£Âà´«¦¨¡uC:.\*.*¡v¦A¥[¤W NULL µ²§À¡A¦A©I¥s FindFirstFile¡A¨º»òµ²ªG´N¬O¶Ç¦^¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ýùتºÀɦW¡C
¤Wªí¤¤ªº²Ä¤Ó¨Ò¤l¡A¦pªG¨Ï¥ÎªÌ¿é¤J¡uC:..¡v¡Aªí¥Ü¨Ï¥ÎªÌ¬O·Qn³B²z¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ýªº¤W¤@¼h¥Ø¿ý¤º¡A©Ò¦³ÀɮפΨä¥Ø¿ý¡CµM¦Ó¥H¡uC:..¡v¦A¥[¤W NULL §@¬°¦r¦ê¡A·í°µ FindFirstFile ªº°Ñ¼Æ¡A¤£µo¥Í¿ù»~¡A¦ý¬O³B²zªº¬O¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ýªº¤W¼h¥Ø¿ý¦W¡A¨Ã«D¨ä¤ºªºÀɮפΥؿý¡C©Ò¥HÀ³¸Ón§â¡uC:.¡v§ï¦¨¡uC:.\*.*¡v¡A¤~¯àªí¥Ü¨Ï¥ÎªÌn³B²zªº¬O¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ýªº¤W¤@¼h¥Ø¿ý¤º¡A©Ò¦³ÀɮפΨä¥Ø¿ý¡C
¥Ñ¤W±ªº¤ÀªR¡A¥i¥Hµo²{¡AFN2TC n³B²zªº±¡§Î¡A¨ä¹ê¥u¦³¨âºØ¡G①¨Ï¥ÎªÌ©Ò¿é¤Jªº°Ñ¼Æ¶È¶È¥u¦³¥Ø¿ý¦WºÙ¡A¨S¦³ÀɮצWºÙ¡F»P②¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¥]§tÀɮצWºÙ¡C«eªÌ¥²¶·¦b¸ô®|¤§«á¡A²K¥[¤W¡u*.*¡v¡AµM«á³B²zªº¤è¦¡´N¤j¦P¤p²§¤F¡C
¦bµ{¦¡ªº²Ä 256 ¦æ¡A©I¥s GetFileAttributes¡A¨ú±o¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¬OÀÉ®×ÁÙ¬O¥Ø¿ý¡C¦pªG¬O¥Ø¿ý¡A´N¨ì²Ä 262 ¦æ¡A¦¹¦æ©I¥s GetFullPathName ¨ú±o§¹¾ãªº¸ô®|¦WºÙ¡C©I¥s GetFullPathName ªº¥Øªº¬O³B²z¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¬O¬Û¹ï¸ô®|¡A¯àÂà´«¦¨§¹¾ãªº¸ô®|¡C¦]¬°³o®ÉÔ¡A¤w¸g½T©w¬O¥Ø¿ý¤F¡A©Ò¥H¥²¶·¦b¸ô®|³Ì«á±¥[¤W¡u*.*¡v¡A³o¼Ë¤~¯àÅý GetFindFirstFile ¥¿½T°õ¦æ¡C³o¬qµ{¦¡¦b²Ä 262¡ã278 ¦æ¡C±µ¤U¨Óªº²Ä 279¡ã283 ¦æ¡A¬Opºâ§¹¾ãÀɦWªº¦r¤¸Ó¼Æ¡AµM«á¸õ¨ì²Ä 305 ¦æ¡A³]©w EAX ¤Î²M°£¶i¦ìºX¼Ð¡Aªð¦^¥Dµ{¦¡¡C¦pªG¦b²Ä 256 ¦æ¡AÀˬd¨ì¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¬OÀɮצӤ£¬O¥Ø¿ý¡A´N¸õ¨ì²Ä 293 ¦æ¡A©I¥s GetFullPathName ¨ú±o§¹¾ãÀɦW¡A¨Ãpºâ¥X§¹¾ãÀɦW§t¦³´XÓ¦r¤¸«á¡A³]©w EAX ¨Ã²M°£¶i¦ìºX¼Ð«á¡Aªð¦^¥Dµ{¦¡¡C
º¥ý¡A¨Ï¥ÎªÌ¿é¤Jªº°Ñ¼Æ¡A¸g¹L get_parameter ¤ÀªR«á¡AÁ٧Ʊæ¯à§â¤@¨Ç¸ê®Æ«O¯d°_¨Ó¡A¥H«KÅý¥Dµ{¦¡¯à°÷¹B¥Î¡C¨Ò¦p¨Ï¥ÎªÌ¿é¤Jªº§¹¾ãÀɦW¦ì§}¡B¥DÀɦW¦ì§}¡B§¹¾ãÀɦWªº¦r¤¸Ó¼Æµ¥µ¥¸ê®Æ¡A³£·|¬°¥Dµ{¦¡©Ò¹B¥Î¡A¥²¶·«O¯d¤U¨Ó¡C³o¨Ç¸ê®Æ¤Ó¦h¤F¡A¥u¾a EAX µLªk°µ¨ì¡A©Ò¥H¤p¤ì°¸¦bµ{¦¡²Ä 22¡ã27 ¦æ©w¸q¤F¤@Óµ²ºcÅé¡AºÙ¬°¡uPATHFILEDATA¡v¡C¦b©I¥s get_parameter °Æµ{¦¡¤§«e¡An§â PATHFILEDATA µ²ºcÅ骺¦ì§}§@¬°²Ä¤GӰѼơA¶Çµ¹ get_parameter¡C¦pªG get_parameter ¦pªG¦¨¥\ªº¤ÀªR¥X°Ñ¼Æ¤ÎÀɦW¡A¨º»òªð¦^¥Dµ{¦¡®É¡Aget_parameter ·|§â PATHFILEDATA ¤ºªºÄæ¦ì¶ñ¤J¥¿½TÈ¡CPATHFILEDATA Äæ¦ì¦p¤U¡G
PATHFILEDATA STRUC pFullname DD ? ;§¹¾ãÀɦW°_©l¦ì§}¡A§¹¾ãÀɦW¥]§tºÏºÐ¾÷¦W¡B¸ô®|¦W¡B¥DÀɦW¤Î°ÆÀɦW¡A¦ý³o¥|¶µ¤£¤@©w³£·|¥X²{¡C pMainFilename DD ? ;¥DÀɦW¦ì§} cChar DD ? ;§¹¾ãÀɦWªº¦r¤¸¼Æ¡A¤£§tµ²§ÀªºNULL PATHFILEDATA ENDS
¤@¶i¤J get_parameter «á¡A¦bµ{¦¡²Ä 136¡ã137 ¦æ¡A´N¬Oªì©l¤Æ PATHFILEDATA µ²ºcÅé¡A¤]´N¬OÅý³o¨ÇÄæ¦ì³£Åܬ° 0¡CpFullname
¦bÁÙ¨Sµo©ú¹q¸£ªº®É¥NùØ¡A¿ì¤½«Çùؤ]¥²¶·³B²z³\¦hÀɮסA°²¦p§â©Ò¦³Àɮ׳£¦s©ñ¦b¤@ÓÂd¤lùØ¡A¨S¦³¤ÀÃþ¡A¨º»ò¥²©w·|«Ü²V¶Ã¡A¥H«án¬d¾\Àɮפ]¤£®e©ö§ä¨ì¡C¦]¦¹¡A±ø²z¤À©úªº¤H¡A¤@©w·|¤Àªù§OÃþªº§â¦P¤@ÃþªºÀÉ®×ÂkÃþ¨ì¦P¤@Ó¸ê®Æ§¨ùر¡C¦³®ÉÔ¡A¦b¤@Ó¸ê®Æ§¨ùر¡A¥i¯àª½±µ¦s©ñÀɮסA¤]¥i¥H¦A²Ó¤À¦¨§ó¤pªºÃþ§O¡A©Î¬O¨âªÌ¬Ò¦³¡C©ó¬O´N¦b¸ê®Æ§¨ùØ¡A¦³®É¦³ÀɮסA¤]¦³¸û²Ó¤Àªº¸ê®Æ§¨¡A¦P®É³£¦s¦b¡C
¹q¸£ªººÏºÐ¾÷ ( driver )¡A´N¦p¦PÂd¤l¤@¼Ë¡AÀx¦sµÛ¤j¶qªºÀɮסC¦P¼Ëªº¡A¤]À³§âÀɮפÀªù§OÃþ¦¬¯ÇÀx¦s¡C¦b DOS ®É¥N¡AºÏºÐ¾÷¦WºÙ¬O¥Î^¤å¦r¥À¥[¤W«_¸¹ªí¥Ü¡C¨Ò¦p¡uA:¡vªí¥Ü¡uA:¡vºÏºÐ¾÷¡A¡uB:¡vªí¥Ü¡uB:¡vºÏºÐ¾÷¡A³o¨âӺϺо÷¦WºÙ¬O¤w³Q²^¨Oªº³n¦¡ºÏºÐ¾÷¦WºÙ¡A±q¡uC:¡vºÏºÐ¾÷¶}©l¤~¬Oµw¦¡ºÏºÐ¾÷ ( «UºÙµwºÐ¡A¤j³°ºÙµw½L ) ©ÎÀH¨ºÐ¡B¥úºÐ¾÷µ¥µ¥¡C¦pªG±zªº¹q¸£¤W¡A¶W¹L 26 ӺϺо÷¡A¨º»ò¤j¤p¼g¤~¥Nªí¤£¦PªººÏºÐ¾÷¡F¦pªG¨S¶W¹L¡A¤j¤p¼g¥Nªí¬Û¦PªººÏºÐ¾÷¡C
¤Wz©ÒÁ¿ªº¸ê®Æ§¨¡A¥i¥H¬Ý¦¨¥Ø¿ý¡A¥Ø¿ý©³¤U¡A¥i¥H¦s©ñÀɮסA¤]¥i¥H¦s©ñ§ó²Óªº¥Ø¿ý¡C¦b DOS ®É¥N¡A·L³nºÙ¬°¡u¥Ø¿ý¡v( directory )¡F¨ì¤F Windows ®É¥N¡AºÙ¬°¡u¸ê®Æ§¨¡v( folder )¡A¨âªÌ·N¸q¬Û¦P¡C¦b¤@ӺϺо÷©³¤U¡A¥i¯à¦³¦n´Xӥؿý¥H¤Î³\¦hÀɮסF¦Ó¨Cӥؿý¤]¥i¯à¦³¦n´Xӥؿý¥H¤Î³\¦hÀɮסA......¡A¦p¦¹¤@¼h¤@¼h©¹¤U¡C©Ò¥H¡A¤@¯ë¦Ó¨¥¡A¥Î©³¤Uªº¤è¦¡ªí¥ÜÀɮסG
driver:\sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy
¡udriver:¡vªí¥ÜºÏºÐ¾÷¦WºÙ¡A¨CӺϺо÷³Ì¤W¼hªº¥Ø¿ýºÙ¬°¡u®Ú¥Ø¿ý¡v¡A¨Ò¦p¡uC:¡vºÏºÐ¾÷ªº®Ú¥Ø¿ý¬°¡uC:\¡v¡C¦pªGn«ü©ú¬YÓÀɮסA´N¥²¶·¥ÑºÏºÐ¾÷¶}©l¡AµM«á¬O¤@³s¦êªº¥Ø¿ý¦WºÙ¡A³o¨Ç¥Ø¿ý¦WºÙ³£¥H¡u\¡v¤À¹j¡A³Ì«á¤~²×©ó«ü¨ìÀɮצWºÙ¡C¨Ò¦p¡usub-dir-1¡v¡B¡usub-dir-2¡v¡K¡K³£¬O¥Ø¿ý¦WºÙ¡A¥Nªí¡usub-dir-1¡v©³¤U¡A¦³¤@Ó¤l¥Ø¿ý¡usub-dir-2¡v¡A¡usub-dir-2¡v©³¤U¦³Ó¤l¥Ø¿ý¡usub-dir-3¡v¡K¡K¡A¤@ª½¨ì³Ì«á¤@ӥؿý¡A¡usub-dir-n¡v¡A¦Ó«ü©wªº xxxxxx.yyy ÀÉ®×´N¦b¡usub-dir-n¡v¥Ø¿ýùØ¡C©ÎªÌ¡A¤]¥i¥H¤Ï¹L¨Ó»¡¡Axxxxxx.yyy Àɮצb¡usub-dir-n¡v¥Ø¿ýùØ¡A¦Ó¡usub-dir-n¡v¥Ø¿ý¦b¡usub-dir-(n-1)¡v¥Ø¿ýùØ......¡A¡usub-dir-2¡v¥Ø¿ý¦b¡usub-dir-1¡v¥Ø¿ýùØ¡A¦Ó¡usub-dir-1¡v¥Ø¿ýªº¤W¤@¼h¥Ø¿ý´N¬O®Ú¥Ø¿ý¤F¡C¨Cӥؿý¤§¶¡¡A¥Î¤Ï±×½u¡A¡u\¡v¤À¶}¡A³o¤@ªø¦êªº¡u\sub-dir-1\sub-dir-2\......\sub-dir-n\¡vºÙ¬°¡u¸ô®|¡v¡A¸g¥Ñ¸ô®|¡A¥i¥H§ä¨ìÀɮסC¤W±¤@ªø¦êªº¡udriver:\sub-dir-1\sub-dir-2\......\sub-dir-n\xxxxxx.yyy¡v¡A¤]¥i¥H²¤Æ¦¨
driver:\path\filename
ÀɮצWºÙ¥Ñ¨â³¡¥÷²Õ¦¨¡A¥DÀɦW»P°ÆÀɦW¡A¤¤¶¡¥H¡u.¡v¤À¶}¡A¦b³Ì«á¤@Ó¡u.¡v¥ªÃ䪺ºÙ¬°¥DÀɦW¡A¥kÃ䪺ºÙ¬°°ÆÀɦW¡C¹³¤W±ªº¡uxxxxxx¡v¬O¥DÀɦW¡A¡uyyy¡v¬O°ÆÀɦW¡C¤@¯ë¦Ó¨¥¡A¨úÀɦW®Én¦³·N¸q¡A¬O«ü¥DÀɦW¦Ó¨¥¡A¥H«KÅý§Ṳ́@¬Ý´Nª¾¹D¬O¤°»òÀɮסC°ÆÀɦW¬O¥Î¨Ó°Ï¤À¦¹Àɮ׬O¥Ñþ¤@ºØ³nÅé²£¥Íªº©Î¬Oªx«ü¬Y¤@ÃþªºÀɮסA¨Ò¦p¡u.docx¡v¬O·L³n OFFICE WORD ³nÅé²£¥Íªº¤å¥óÀÉ¡B¡u.mp4¡v¬O¼vµÀÉ¡B¡u.mp3¡v¬Oµ¼ÖÀÉ¡B¡u.jpg¡v¬O·Ó¤ùÀÉ¡B¡u.exe¡v¬O¥i°õ¦æµ{¦¡¡K¡Kµ¥µ¥¡CÀɮצWºÙ¥i¥H¥Î¼ÆÓ¡u.¡v¦r¤¸¡A¥u¦³³Ì«á¤@Ó¡u.¡v¤~¬O°Ï¤À¥DÀɦW»P°ÆÀɦW¡C¦³®É¤]¥i¥H¨S¦³°ÆÀɦW¡C
¨Ò¦p¡AMASM32 ªº²ÕĶ¾¹¡Aml.exe¡A¬O©ñ¦b C: ºÏºÐ¾÷ªº¤@Ó¡ubin¡v¤l¥Ø¿ýùØ¡A¦Ó¡ubin¡v¤l¥Ø¿ý¤S¬O¦b®Ú¥Ø¿ý¤Uªº¡umasm32¡v¤l¥Ø¿ý¤º¡A¡umasm32¡v¤l¥Ø¿ýªº¤W¤@¼h¥Ø¿ý´N¬O¡uC:¡vºÏºÐ¾÷ªº®Ú¥Ø¿ý¤F¡A©Ò¥Hªí¥Ü¤è¦¡¦p¤U¡G
c:\masm32\bin\ml.exe
¨ä¤¤¡uC:¡v´N¬OºÏºÐ¾÷¦W¡A¡u\masm32\bin\¡vºÙ¬°¸ô®|¡C¦ý§â¡uC:\mams32\bin\¡v·í¦¨¸ô®|¦W¡A¥ç¥¼¹Á¤£¥i¡A¨ä¤¤¬É½u¬O«Ü¼Ò½kªº¡C¥ÑºÏºÐ¾÷ªº®Ú¥Ø¿ý¶}©l¡A¸g¤@¦ê¥Ø¿ý¦Wºc¦¨ªº¸ô®|¡A³Ì«á¤~¬OÀɮצWºÙ¡A¹³³oºØªí¥Ü¤è¦¡ºÙ¬°¡uµ´¹ï¸ô®|¡v¡CÁÙ¦³¥t¤@ºØºÙ¬°¡u¬Û¹ï¸ô®|¡vªºªí¥Ü¤è¦¡¡A¤]¯à§ä¨ì¯S©wÀɮסCµy«á¦A½Í¡u¬Û¹ï¸ô®|¡v¡C
¬°ÀɮשΥؿý¨úÓ¦W¦r¡A¬O«Ü«nªº¨Æ¡A³Ì¦n¬O¯à±æ¤å¥Í¸q¡C§Y¨Ï¤é¤l¤[¤F¡A¤]¯àª¾¹D³oÓÀɮ׬O¤°»ò¡C¦b 32 ¦ì¤¸ªº Windows §@·~¨t²Î¤¤¡A¨Ã¤£¬O¥ô·N¦r¤¸³£§@¬°ÀɮצWºÙ©Î¥Ø¿ý¦WºÙ¡A»Ý²Å¦X¤U¦C³W©w¡G
C:\masm32\bin>dir ml.exe [Enter] ¡÷dir ¬O¦C¥X¥Ø¿ý ( directory ) ¤ºªºÀɮפ§·N¡A©Ò¥H¡udir ml.exe¡v´N¬O¦C¥X¥Ø¿ýùتº ml.exe ÀɮסC ºÏºÐ°Ï C ¤¤ªººÏºÐ¬O WINDOWS XP PRO ¦pªG¥u¿é¤J¡udir¡v¡A¨º»ò´N·|¦C¥X¸Ó¥Ø¿ýªº©Ò¦³ÀɮסC ºÏºÐ°Ï§Ç¸¹: 9858-1328 C:\masm32\bin ªº¥Ø¿ý 1999/03/29 ¤U¤È 03:45 372,736 ml.exe 1 ÓÀÉ®× 372,736 ¦ì¤¸²Õ 0 ӥؿý 79,776,759,808 ¦ì¤¸²Õ¥i¥Î C:\masm32\bin>dir .\ml.exe [Enter] ¡÷¦]¬°¡u.¡v¥Nªí²{¦b¥Ø¿ý¡A©Ò¥H¡udir .\ml.exe¡v´N¥Nªí¦C¥X²{¦b¥Ø¿ýùرªº ml.exe ÀɮסA©Ò¥H¨ä¹ê©M¡udir ml.exe¡v¬O¤@¼Ëªº·N«ä¡C ºÏºÐ°Ï C ¤¤ªººÏºÐ¬O WINDOWS XP PRO ²{¦bªº¥Ø¿ý´N¬O¤W¤@¦æ«e±ªº¡uC:\masm32\bin¡v¡A©R¥O´£¥Ü¦r¤¸·|§â¥¦¦L¦b³Ì«e±¡C¨Æ¹ê¤W¡A©R¥O´£¥Ü¦r¤¸·|°O¿ý¨CӺϺо÷ªº²{¦b¥Ø ºÏºÐ°Ï§Ç¸¹: 9858-1328 ¿ý¡A¨Ã¥B¦b¿Ã¹õ³Ì«e±¡A¦L¥X·í«eºÏºÐ¾÷ªº²{¦b¥Ø¿ý¡Aµ¥«Ý¨Ï¥ÎªÌ¿é¤J«ü¥O¡C C:\masm32\bin ªº¥Ø¿ý 1999/03/29 ¤U¤È 03:45 372,736 ml.exe 1 ÓÀÉ®× 372,736 ¦ì¤¸²Õ 0 ӥؿý 79,776,759,808 ¦ì¤¸²Õ¥i¥Î C:\masm32\bin>e: [Enter] ¡÷¦b¡u©R¥O´£¥Ü¦r¤¸¡v¥u¿é¤JºÏºÐ¾÷¦W¡A¥Nªí¤Á´«ºÏºÐ¾÷¤§·N¡C§Y¨Ï¤Á´«¨ì¡uE:¡vºÏºÐ¾÷¡A¡uC:¡vºÏºÐ¾÷ªº²{¦bªº¥Ø¿ýÁÙ¬O¡uC:\masm32\bin¡v¡C E:\HomePage\SOURCE\Win32\FN2TC>dir c:ml.exe [Enter] ¡÷¹êÅç¬Ý¬Ý¡C¦C¥X C: ºÏºÐ¾÷²{¦b¥Ø¿ýùتº ml.exe ÀɮסA¸ò«e±ªº¤@¼Ò¤@¼Ë¡CªG¯u¦p¦¹¡A¹q¸£·|°O¦íºÏºÐ¾÷ªº²{¦b¥Ø¿ý¡C ºÏºÐ°Ï C ¤¤ªººÏºÐ¬O WINDOWS XP PRO ºÏºÐ°Ï§Ç¸¹: 9858-1328 C:\masm32\bin ªº¥Ø¿ý 1999/03/29 ¤U¤È 03:45 372,736 ml.exe 1 ÓÀÉ®× 372,736 ¦ì¤¸²Õ 0 ӥؿý 79,776,759,808 ¦ì¤¸²Õ¥i¥Î E:\HomePage\SOURCE\Win32\FN2TC>cd c:.. [Enter] ¡÷cd ¬O§ïÅܥؿý ( change directory ) ªº·N«ä¡A¡u..¡v¬O¤W¼h¥Ø¿ý¡A©Ò¥H¡ucd c:..¡v´N¬O§â C: ºÏºÐ¾÷ªº ²{¦b¥Ø¿ýÅܦ¨¤W¤@¼hªº¥Ø¿ý¡C©Ò¥H C: ºÏºÐ¾÷ªº²{¦b¥Ø¿ýÅܦ¨¡uC:\masm32¡v¤F¡C E:\HomePage\SOURCE\Win32\FN2TC>c: [Enter] ¡÷¤Á´«¨ì¡uC:¡vºÏºÐ¾÷ C:\masm32> ¡÷²{¦b¥Ø¿ý¤w¸gÅܦ¨ì¨Ó¥Ø¿ýªº¤W¤@¼hªº¥Ø¿ý¤F¡A´N¬O¡uC:\masm32¡v
¡u?¡v»P¡u*¡v³o¨âÓ¦r¤¸¡AºÙ¬°¸U¥Î¦r¤¸ ( ©Î¥s³q°t¦r¤¸¡A^¤åºÙ¬° wild card )¡A¥i¥H¥Nªí¥ô·N¦r¤¸¡C¥ý»¡»¡¡u?¡v¦r¤¸¡A¥¦¥Nªí¤@өιsÓ¥ô·N¦r¤¸¡C¨Ò¦p¡uprime?.asm¡vÀɮסA¥i¥H¬O¡uprime1.asm¡v¡A¤]¥i¥H¬O¡uprime2.asm¡v©Î¬O¡uprimea.asm¡vµ¥µ¥¡A¤Z¬O¡uprime¡v«á¥ô·N¤@Ó¦r¡A¦A¥[¤W¡u.asm¡vÀɮ׳£¥i¥H²Å¦X¡uprime?.asm¡v¡C¦¹¥~¡u?¡v¨ä¹ê¤]¥i¥H¬O¥Nªí¤@Ó¤¤¤å¦r¡A¬Æ¦Ü¨ä¥L»y¤åªº¦r¡C¨Ò¦p¥Ø¿ýùئ³¡uprime.asm¡v¡B¡uprime¨k.asm¡v¡B¡uprime¤k.asm¡v¡A¦pªG¤U«ü¥O¡udir prime?.asm¡v¡A«ez¤TÓÀɮ׳£·|¦C¥X¨Ó¡C¦pªG¦hÓ¡u?¡v³s¦b¤@°_¡A¨º»ò¥un¬O¤£¦h©ó¡u?¡vӼƪº¦r¤¸¡A³£²Å¦X¡C¨Ò¦p¥Ø¿ýùئ³¡uprime.asm¡v¡B¡uprime1.asm¡v¡B¡uprime01.asm¡v¡B¡uprime001.asm¡v¡A¦pªG¤U«ü¥O¡udir prime??.asm¡v¡A¥u¦³«e¤TÓ·|¦C¥X¨Ó¡C
¡u*¡v¥i¥Nªí¥ô·NÓ¥ô·N¦r¤¸¡C¤p¤ì°¸·Q¡AÁÙ¬O¬Ý©³¤Uªº¨Ò¤l¡A¸û©ö²z¸Ñ¡G
¦¹¥~¸U¥Î¦r¤¸¦³¤@¶µ¨î¡A¥u¯à¥X²{¦b¸ô®|©Î¬O§¹¾ãÀɦWªº³Ì«á¤@¶µ¡A¨Ò¦p¡G
C:\masm32\bin\*.exe C:\masm32\bin\m?.exe C:\masm32\b*
¹³¤W±²Ä¤TÓ¨Ò¤l¡A§Y¨Ï³Ì«á¤@¶µ¬O¥Ø¿ý¦WºÙ¡A¤]¯à¨Ï¥Î¸U¥Î¦r¤¸¡A©Ò¥H¤W±ªº²Ä¤TÓ¨Ò¤l¬O¥¿½Tªº¸ô®|¦WºÙ¡A¥¦¬O³B²z¡uC:\masm32¡v¥Ø¿ýùر¥ô¦ó¥H¡ub¡v¶}ÀYªºÀɦW©Î¤l¥Ø¿ý¦W¡C°£¤F³Ì«á¤@¶µ¥i¥Î¸U¥Î¦r¤¸¥~¡A¨ä¥L¦ì¸m³£¤£¯à¨Ï¥Î¡A¨Ò¦p©³¤Uªº¨Ò¤l¬O¿ù»~ªº¡G
C:\masm32\*\ml.exe
¤p¤ì°¸Ä±±o¡A¦b¡u©R¥O´£¥Ü¦r¤¸¡v³B²z¤j¶qÀɮ׮ɡA·f°t¸U¥Î¦r¤¸¡A«D±`¤è«K¡A³o¤j·§¬O¡u©R¥O¦C¤¶±¡v( CLI ) ¤ñ¹Ï§Î¨Ï¥ÎªÌ¤¶± ( GUI ) ¤è«Kªº¦a¤è§a¡IµM¦Ó¦³¨Ç¹Ï§Î¨Ï¥ÎªÌ¬É±ªºµ{¦¡¡A¤]Â^¨ú³oÓÀuÂI¡A¥i¥H¥Î¸U¥Î¦r¤¸¡A¨Ò¦p¡uTotal Commander¡v´N¦æ¡C
ÀɦW»P¥Ø¿ý¦W¤wÁ¿§¹¡A©³¤U¤p¤ì°¸n¤¶²Ð¡uµ´¹ï¸ô®|¡v»P¡u¬Û¹ï¸ô®|¡v¡C¡uµ´¹ï¸ô®|¡v¬O«ü´yzÀɮ׮ɡA¥ÑºÏºÐ¾÷¶}©l¡A¨Ì§Ç¬O®Ú¥Ø¿ý¡B®Ú¥Ø¿ý¤U¤@¼hªº¤l¥Ø¿ý¡B¦A¤U¤@¼hªº¥Ø¿ý......ª½¨ìÀɮ׬°¤î¡C¨Ò¦p´yz MASM32 ªº²ÕĶ¾¹¡A¦pªG¨Ï¥Î¡uc:\masm32\bun\ml.exe¡v¤è¦¡ªí¹F¡A´N¬O¡uµ´¹ï¸ô®|¡v¡C¡u¬Û¹ï¸ô®|¡v«üªº¬O±q²{¦bªº¥Ø¿ý¶}©l¡A©¹¤W¼h©Î©¹¤U¼h¥Ø¿ý¡Aª½¦Ü«ü©wªºÀɮסC¨Ò¦p©³¤Uªº¾Þ§@¡G
D:\HomePage\SOURCE\Win32\FN2TC>cd c:\masm32 [Enter] ¡÷cd ¬O¤Á´«¥Ø¿ýªº·N«ä¡A^¤å¬O change directory¡C D:\HomePage\SOURCE\Win32\FN2TC>dir c:bin\ml.* [Enter] ¡÷¡uC:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¬O¡uc:\masm32\¡v¡A«ü¥O¡udir c:bin\ml.*¡vªº·N«ä´N¬O§â¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ý ºÏºÐ°Ï C ¤¤ªººÏºÐ¬O WINDOWS XP PRO ¤U¤@¼hªº¡ubin¡v¤l¥Ø¿ý¡Aùر¥DÀɦW¬O ml ªº©Ò¦³ÀɮצC¥X¨Ó¡C¦¹³Bªº¡ubin\¡v´N¬O¬Û¹ï¸ô®|¡C ºÏºÐ°Ï§Ç¸¹: 9858-1328 C:\masm32\bin ªº¥Ø¿ý 2001/07/22 ¤W¤È 03:31 9,687 ml.err 1999/03/29 ¤U¤È 03:45 372,736 ml.exe 2 ÓÀÉ®× 382,423 ¦ì¤¸²Õ 0 ӥؿý 79,768,842,240 ¦ì¤¸²Õ¥i¥Î D:\HomePage\SOURCE\Win32\FN2TC>dir c:..\m*.* [Enter] ¡÷¡uC:..\¡v¤]¬O¬Û¹ï¸ô®|¡A¬O«ü¡uC:¡vºÏºÐ¾÷²{¦b¥Ø¿ýªº¤W¤@¼h¥Ø¿ý¡C ºÏºÐ°Ï C ¤¤ªººÏºÐ¬O WINDOWS XP PRO ºÏºÐ°Ï§Ç¸¹: 9858-1328 C:\ ªº¥Ø¿ý 2018/01/17 ¤U¤È 02:10 <DIR> masm32 0 ÓÀÉ®× 0 ¦ì¤¸²Õ 1 ӥؿý 79,768,342,528 ¦ì¤¸²Õ¥i¥Î D:\HomePage\SOURCE\Win32\FN2TC>
¤Wz¾Þ§@¤¤ªº²Ä¤@±ø«ü¥O¡A¨Ï±o¨t²Î§â¡uC:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¤Á´«¨ì¡uC:\masm32\¡v¡C²Ä¤G±ø«ü¥O¡A¡udir¡v¬OÅã¥Ü¥Ø¿ýùتºÀɮסA¦¹¥Ø¿ý¤ºªºÀɮ׬Oºò±µµÛªº¡uc:bin\ml.*¡v¡A¦¹®Éªº¡uc:bin\¡v´N¬O¬Û¹ï¸ô®|¡Cn±o¨ì§¹¾ãªº¸ô®|¡A´N±o±q¡uC:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¶}©l¡A¤]´N¬O±q¡uC:\masm32\¡v¶}©l¡FµM«á»P¬Û¹ï¸ô®|µ²¦X¡A³Ì«á±o¨ì¯u¥¿ªº¸ô®|¡A¡uC:\masm32\bin¡v¡C¦pªGn±q¬Û¹ï¸ô®|¡A±o¨ì¤W¼h¥Ø¿ý¡A´Nn¨Ï¥Î³sÄòªº¨âÓ¡u..¡v¡A¨Ò¦p¤Wz¾Þ§@ªº²Ä¤T±ø«ü¥O¡C¦]¬°¡uC:¡vºÏºÐ¾÷ªº²{¦b¥Ø¿ý¬O¡uC:\masm32\¡v¡A¤W¼h¥Ø¿ý´N¬O¡uC:\¡v¡A§Y¡uC:¡vºÏºÐ¾÷ªº®Ú¥Ø¿ý¡A©Ò¥H¡udir c:..\m*.*¡vªº·N«ä¡A´N¬OÅã¥Ü¡uC:¡vºÏºÐ¾÷®Ú¥Ø¿ýùØ©Ò¦³¥H¡um¡v¶}ÀYªºÀɮשΥؿý¡C