²Ä¤G¤Q¥|³¹¡@¸U°ê½X

½t°_

³o¤@³¹¨Ó»¡¤@»¡¥Î²Õ¦X»y¨¥³]­p Win64 À³¥Îµ{¦¡®É¡A¦p¦ó³B²z¡BÀx¦s¡BÅã¥Ü¥H¸U°ê½X½s½Xªº¦r¤¸¡C­º¥ý»¡©ú¤°»ò¬O¸U°ê½X©O¡H¦b¦­´Á¹q¸£­èµo®iªºªì´Á¡A¤j¬ù¬O¥Á°ê¤»¡B¤C¤Q¦~ªº®É­Ô¡A¨º®É­Ô¦U°êµo®i¦U¦Ûªº¦r¤¸½s½X¼Ð·Ç¡C²³©Ò©Pª¾¡A¹q¸£¾Õªøªº¬O³B²z¼Æ­È¡A¦ý¬O¤HÃþ©Ò¨Ï¥Îªº¬O¦U¦¡¦U¼Ëªº¤å¦r¡A©Ò¿×¦r¤¸½s½X¬O«ü¦b¹q¸£¤¤¥H¬Y­Ó¼Æ­È¥Nªí¬Y­Ó¤å¦r¡C

¨Ò¦p¬ü°ê°ê®a¼Ð·Ç¾Ç·|¡]American National Standard Institute¡AANSI¡^¨î©wªº ASCII¡]American Standard Code for Information Interchange¡A¬ü°ê¼Ð·Ç¸ê°T¥æ´«½X¡^¡A´N¬O¥H 41h ¥Nªí "A"¡A¥H 42h ¥Nªí "B"¡K¡K§¹¾ãªº ASCII ½X¥i¥H¬d¾\ºû°ò¦Ê¬ì©Î DOS ²Õ¦X»y¨¥ªþ¿ý¥|¡C¨ä¥L°ê®a¤]¹ï¦Û¤vªº¤å¦r¶i¦æ½s½X¡A¨Ò¦p¤é¥»±Ä¥Î Shift_JIS¡A¤¤µØ¥Á°ê¡B­»´ä¡B¿Dªù±`¥Îªº¬O Big5¡]¤j¤­½X¡^¡A¤¤°ê¤j³°±`¥Îªº¬O GB2312¡C¦³³o»ò¦h°ê®a¦a°Ï¡A±Ä¥Î¤£¦Pªº½s½X¤è¦¡¡AÁöµM¥L­Ìªº«e­± 128 ½X³£»P ASCII ¬Û®e¡A¦ýÁÙ¬O·|³y¦¨¥æ´«¸ê°Tªº§xÃø¡C

¨Ò¦p¡u»¨³Ç¡v¤G¦rªº Big5 ½X¤À§O¬O BBA8h¡BB3C7h¡AGB2312 ¤¤³o¨â¼Æ¤À§O¬O¡uªá¡v¡B¡u«°¡v¡C°²³]¦b¤¤µØ¥Á°ê¦³­Ó¥Î Big5 ½s½Xªº¯Â¤å¦rÀÉ¡AùØ­±¦³¡u»¨³Ç¡v¤@µü¡FÀx¦s¦b¹q¸£¤¤¡A¤£½×¦¡µwºÐ¡BÀH¨­ºÐ¡A³£¬O BBA8h¡BB3C7h ¨â­Ó¤Q¤»¶i¦ì¼Æ¡C¦pªG®³¨ì²ßºD¥H GB2312 ½s½Xªº¤¤°ê¤j³°¤W¥h¡A¥Î¥L­Ìªº³nÅé¶}±Ò¡A¡u»¨³Ç¡v´NÅܦ¨¤F¡uªá«°¡v¡A³o½ÖÁÙ¯à¬Ý±oÀ´¡H³oÁÙºâ¦n¡A¦Ü¤Ö³o­Ó¨Ò¤lÁÙ¹ïÀ³ªº¬O¤¤¤å¦r¡A¥u¬O¬Ý±o¤£ª¾©Ò¤ª¡C¦pªG¬O¹ïÀ³ªº¬O²Å¸¹¡A©Î®Ú¥»¤£¥Î³o¼Æ­È½s½X¡A¨º§ó¬O¬Ý¤£À´¡A³o´N¬O¶Ã½X²£¥Íªº­ì¦]¡C

¨ì¤Fºô»Úºô¸ôµo®i¨Ã²±¦æªº®É¥N¡A³o°ÝÃD§ó¥[ÄY­«¡A¤£¯à¦A±Ä¥Î¦U¦æ¨ä¬Oªº½s½X¤è¦¡¤F¡C¬°¤F¸Ñ¨M³o­ÓÃøÃD¡A¦Û¥Á°ê 73 ¦~¶}©l¡A¦³°ê»Ú²Õ´¤Î³\¦hª¾¦W°ê»Ú¼t°Ó¦@¦PµÛ¤â¬ã¨s¡A©ó¬O¦b¥Á°ê 80 ¦~¥ª¥k¡A¥L­Ì¤½¥¬¤F¬ã¨s¦¨ªG¡A·N§Y ISO 10646/Unicode ¼Ð·Ç¡A²ºÙ Unicode¡A¤¤¤å¥i½Ķ¦¨¸U°ê½X©Î²Î¤@½X¡C

¸U°ê½X¤è¦¡¦¬¶°¤F´X¥G¥þ¥@¬Éªº»y¨¥¤å¦r»P²Å¸¹¡A³£±N¨ä½s½X¡A¤@­Ó¦r²Î¤@¥Î¤@­Ó¼Æ­Èªí¥Ü¡C¸g¹L³o¨Ç¦~¨Óªº±À°Ê¡A²{¦b¤w¸g¦¨¬°©ñ½Ñ¥|®ü¬Ò·Çªº¦r¤¸½s½X¤è¦¡¤F¡C±Ä¥Î³o®M½s½X¤è¦¡¡A¬Æ¦Ü¥i¥H¦b¦P¤@¤å¥ó¤¤Åã¥Ü¤£¦Pªº°ê®aªº¤å¦r¡C¯u¥¿§¹¦¨¤F¨Ï¥Î¹q¸£¯àÅã¥Ü¡BÀx¦s¡B¶Ç°e¦U°ê¤å¦r¡A¸¨¹ê²Î¤@¥þ²y¤å¦r¥æ´«¼Ð·Ç¡C

³o®M¸U°ê½X±q¶}©lµoªíªº¤C¤d¦h¦r¡A³v¦~ÂX¥R¡A¨ì¤µ¦~¡]¥Á°ê113¦~¡^¬°¤î¡A¤w¦¬¿ý¤F¤Q¤­¸U¦r¡AÁÙ¦b³v¨BÂX¼W¤¤¡C»¡¨Ó¥i¯à«Ü¦h¤H¤£´±¬Û«H¡A¸U°ê½X³ºµMÁÙ¦¬¿ý¤F¥j¥N®J¤Î¸t®ÑÅé¡]±q 13000h ¶}©l¬O¥j¥N®J¤Î¸t®ÑÅé¦r¤¸¡^¡I

Windows §@·~¨t²Î¦Û Windows 3.0 ¶}©l¡A½s½X¤è¦¡±Ä¥Î¦U¦Û°ê®aªº½s½X¤è¦¡¡C¨Ò¦p¦b¤¤µØ¥Á°ê³c°âªº Windows 3.1 ±Ä¥Î Big5 ½X¡A¦ý¦b·L³n¤º³¡ºÙ¬° code page 950¡A¡ucode page¡v¤@¯ë½Ķ¦¨¤º½X­¶¡C¦b¤¤°ê¤j³°±Ä¥Î GB2312¡A¤º½X­¶¬O 936¡F¦Ó¤é¤åª©ªº Windows 3.0¡A¤º½X­¶¬° 932¡C

¦ý¦P¤@®É´Á¡A´£¨Ñµ¹¥ø·~¥Îªº Windows NT 3.1 «o¤w±Ä¥Î¸U°ê½X¡C«á¨Ó¨Ñ­Ó¤H¨Ï¥Îªº Windows 95/98/98 SE/Me ©µÄò Windows 3.x¡A¤´±Ä¥Î Big5 ©Î GB2312 ½s½X¡FWindows NT 3.5/4.0/2000 «h±Ä¥Î¸U°ê½X¡C¥Á°ê 90 ¦~µo°âªº Windows XP ¾ã¦X­Ó¤H»P¥ø·~¨Ï¥Îªº¨t²Î¡A±Ä¥Î Windows NT ªº®Ö¤ß¡A¥Î¸U°ê½X½s½X¡C

»¡¨ì³o¨à¡A²{¦bªº Windows §@·~¨t²Î¤º³¡½s½X¤è¦¡¦­¤w¬O¸U°ê½X¡A©Ò¥H²{¥N¼¶¼gµ{¦¡À³¸Ó­n¦Ò¼{±Ä¥Î¸U°ê½X½s¼gµ{¦¡¡C¨º»ò¹ï©ó¥j¦Ñªº²Õ¦X»y¨¥¨Ó»¡¡A¯à§_¤ä´©¥H¸U°ê½X¤è¦¡¼¶¼gÀ³¥Îµ{¦¡©O¡H·íµM¬O¥i¥Hªº¡A§_«h´N¤£·|¦³³o¤@³¹¤F¡C


²³æªº½d¨Ò

­^¤å¦r¥Àªº¸U°ê½Xªí¥Ü¤è¦¡

¦­´Á¡AANSI ¨î©wªº ASCII ½s½X¤è¦¡¥u±Ä¥Î 7 ¦ì¤¸´N¤w¨¬°÷¡C7 ­Ó¦ì¤¸¯àªí¥Ü 27 ­Ó¼Æ­È¡A¤@­Ó¼Æ¥Nªí¤@­Ó¦r¡A­^¤å¦r¥À¥]§t¤j¡B¤p¼g¦@ 52 ­Ó¡A¥[¤W¤Q­Óªü©Ô§B¼Æ¦r¤Î¼ÐÂI²Å¸¹¡A127 ­Ó¼Æ¦r«D±`°÷¥Î¡C

¦ý¬O¡A«e­±´£¹L¸U°ê½Xªº¥ø¹Ï¤ß«Ü¤j¡A¥´ºâ±N¥þ¥@¬É¥j©¹¤µ¨Ó¡A¥¿¦b¨Ï¥Î»P´¿¸g¨Ï¥Î¹Lªº¤å¦r³£¯Ç¤J¨ä¤¤¡C¦pªG¬O³o¼Ë¡A¥²¶·¨Ï¥Î¥|­Ó¦ì¤¸²Õ¨Ó½s½X¡A¥|­Ó¦ì¤¸²Õ¦@ 32 ­Ó¦ì¤¸¡A¤]´N¬OÂù¦r²Õ¡]¥ç§Y²Õ¦X»y¨¥±`¥Îªº DWORD¡^¡A¦ý³W©wÂù¦r²Õªº³Ì°ª¦ì¤¸¥²¶·¬°¹s¡A©Ò¥H¥i¥H½s½XªºÁ`¼Æ°ª¹F 231 ­Ó¡A¤]´N¬O¥i¥H¨Ï¤G¤Q¤@»õ¦h­Ó¤å¦r¶i¦æ½s½X¡A³o¼Ëªº½s½XºÙ¬° UCS¡Ð4¡A¥¦¯à°÷²[»\©Ò¦³¤å¦r¦Óºïºï¦³¾l¡CUSC ¬O universal coded character set ªºÁY¼g¡A¤¤¤å¥i½Ķ¦¨³q¥Î¦r¤¸¶°¡C

¦ý²{¹ê¬O¡A§Y¨Ï¥]§t¤¤¡B¤é¡BÁú¤TºØ±`¥Îªº¤å¦r¡AÁ`¦@¤]¤£·|¶W¹L¤»¸U­Ó¡C°²¦p¯uªº¨Ï¨C­ÓÀɮתº¤å¦r³£¥Î UCS¡Ð4 ½s½X¡A¨º¨C­Ó¦r³£­n¥e¥Î¥|­Ó¦ì¤¸²Õ¡A«D±`®ö¶OªÅ¶¡¡C©ó¬O³\¦h¤H»{¬°¡A¦pªG±Ä¥Î¨â­Ó¦ì¤¸²Õ¨Ó½s½X¡A¥i¥H½s½Xªº¤å¦r¦³ 216 ­Ó¤å¦r¡A¤]´N¬O 65536 ­Ó¡A¤w¸g¥i¥Hº¡¨¬¥@¬É¤W±`¥Îªº¤å¦r¤F¡A³o¼Ëªº½s½X¤è¦¡ºÙ¬° UCS¡Ð2¡A¥¦ÁöµMµLªk²[»\¥@¬É¤W©Ò¦³¤å¦r¡A¦ý«o¯àº¡¨¬µ´¤j³¡¥÷¤H¦bµ´¤j³¡¤À±¡ªp¨Ï¥Î¡C

UCS¡Ð2 ÂàÅܦ¨ UCS¡Ð4 ªº¤èªk¥u»Ý¦A¼W¥[¨â­Ó¦ì¤¸²Õ¡A¦Ó¥B³o¨â­Ó¦ì¤¸²Õ³£¬O 0¡C¨Ò¦p¡u»¨¡v¦rªº¸U°ê½X¬O 8C6Ah¡A³o¬O UCS¡Ð2 ½s½X¤è¦¡¡FÂà´«¦¨ UCS¡Ð4 ´N¬O 00008C6Ah¡C¤£½×¬O UCS¡Ð2 ÁÙ¬O UCS¡Ð4¡A¹ï­^¤å¦r¥À¡Bªü©Ô§B¼Æ¦r¤Î¹³¡u,¡v¡B¡u.¡v¡B¡u+¡v¡B¡u-¡v¡K¡Kµ¥²Å¸¹¦Ó¨¥¡A³£³Q½s¦¨»P ANSI ¨î©wªº ASCII ½X¤@¼Ë¡A³o¼Ë´N¯à»P¦­´Áªº¹q¸£¬Û®e¡C¨Ò¦p­^¤å¦r¥À "A" ªº ASCII ½X¬O 41h¡AÂà´«¦¨ UCS¡Ð2 ¬O 0041h¡AÂà´«¦¨ UCS¡Ð4 ¬O 00000041h¡C

µ²½×´N¬O¡A¸U°ê½X¦Ü¤Ö¥i¤À¬° UCS¡Ð2 »P UCS¡Ð4 ¨âºØ½s½X¤è¦¡¡]¨Æ¹ê¤WÁÙ¦³§ó¦h½s½X¤è¦¡¡^¡A¦pªG©Ò¨Ï¥Îªº¤å¦r¬O±`¥Î¤å¦r¡A¨º»ò¨Ï¥Î UCS¡Ð2 ´N¥i¥H¤F¡A§_«h´N¥²¶·¨Ï¥Î UCS¡Ð4¡C¦P¤@¥÷¤å¥ó©ÎÀÉ®×ùØ¥u¯à¿ï¾Ü¨ä¤¤¤@ºØ¡A¤£¬O UCS¡Ð2 ´N¬O UCS¡Ð4¡A¤£¯à²V¥Î¡A¥H§K³y¦¨¤@­Ó¦r¤£©wªø«×ªº¯ÊÂI¡C¦³Å²©ó UCS¡Ð4 ·¥¨ä¤Ö¥Î¡A©Ò¥H©³¤Uªº¤º®e¡A¦p¤£¯S§OÁn©ú¸U°ê½X½s½X¤è¦¡¡A³£¬O«ü UCS¡Ð2¡C

¤£½×¬O UCS¡Ð2 ÁÙ¬O UCS¡Ð4¡A¤£ºÞ­þºØ¸U°ê½X½s½X¤è¦¡¡A³£¬O¥H¨â­Ó¦ì¤¸²Õ©Î¶W¹L¨â­Ó¦ì¤¸²Õªº¤è¦¡±N¤å¦r½s½X¡A©Ò¥HÀ³¥Îµ{¦¡¤ºªº¤å¦r¦pªG¬O¥Î¸U°ê½X½s¦¨ªº¡A¤@¯ëºÙ¬°¼e¦r¤¸À³¥Îµ{¦¡¡]Wide Character Application¡^©Î¸U°ê½XÀ³¥Îµ{¦¡¡F¦pªG¬O¥H ANSI ¨î©wªº ASCII ½s½Xªº¡A¥iºÙ¬° ANSI À³¥Îµ{¦¡¡C¦Ó¦b¤¤µØ¥Á°ê¡B­»´äµ¥¦a°Ï¨Ï¥Îªº Big5 ½X¡A¬O¦b ASCII ªº°ò¦¤WÂX¥R¤@­Ó¦ì¤¸²Õ¨Óªí¥Ü¤¤¤å¡A¬Û®e©ó ASCII ½s½X¤è¦¡¡C©Ò¥H¡A§Y¨Ï Big5 ½s½Xªº¤¤¤å¦r¦³¨â­Ó¦ì¤¸²Õ¡A¤]ÄÝ©ó ANSI À³¥Îµ{¦¡¡C¦b¥»³¹¤§«eªºµ{¦¡¡A³£ÄÝ©ó ANSI À³¥Îµ{¦¡¡C

½d¨Ò¡GFIRSTU.ASM

©³¤U¥H²Ä¤@³¹ªº FIRST.ASM ¬°¨Ò¤l¡A»¡©ú¦p¦ó¨Ï¥Î²Õ¦X»y¨¥¼¶¼g¼e¦r¤¸À³¥Îµ{¦¡¡A¦¹µ{¦¡ºÙ¬° FIRSTU.ASM¡A¥DÀɦW³Ì«áªº U ¥Nªí¦¹¬°¸U°ê½Xª©¥»¡Cª`·N¡I¦]¬°²ÕĶ¾¹¡AUASM64.EXE ©Î ML64.EXE ³£¥u¯àÃѧO ANSI/ASCII ®æ¦¡ªº­ì©lµ{¦¡¡A©Ò¥H§Y¨Ï½s¼g¼e¦r¤¸À³¥Îµ{¦¡¤]¬O­n§â­ì©lµ{¦¡¦s¦¨ ANSI/ASCII ®æ¦¡¡C¡C­ì©lµ{¦¡¡AFIRSTU.ASM ¦p¤U¡G

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
OPTION  CASEMAP:NONE
OPTION  WIN64:3
OPTION  LITERALS:ON     ;¨Ïinvokeª½±µ±µ¨ü¦r¦ê°Ñ¼Æ

UNICODE EQU     1       ;©I¥sWin64 APIªº¼e¦r¤¸ª©¥»

INCLUDE         WINDOWS.INC
INCLUDELIB      KERNEL32.LIB
INCLUDELIB      USER32.LIB
;*******************************************************************************
.CONST
;¦]¬°¡uOPTION LITERALS:ON¡v¡A¥i¥H¥Î¡uDW¡v§â­^¤å¦r¥ÀÂà´«¦¨UCS-2½s½X
szText  DW      "This sentence is encoded in UCS-2."
;*******************************************************************************
.CODE
;-------------------------------------------------------------------------------
main    PROC
        invoke  MessageBox,0,OFFSET szText,L"Unicode String",MB_OK
        call    ExitProcess
main    ENDP
;*******************************************************************************
END     main

¤W­± FIRSTU.ASM µ{¦¡½X¤¤¥Hµµ¬õ¦â¼Ð¥Ü¥X¨Óªº¡A´N¬O¼¶¼g¸U°ê½XªºÃöÁä¡A©³¤U¤@¤@»¡©ú¡G

①¡BOPTION LITERALS:ON¡G¡uOPTION LITERALS:ON¡v°²«ü¥O¬O JWASM/UASM ·s¼Wªº¡A¥D­n¥Î³~¦³¨â­Ó¡G
⑴¡B¨Ï DW °²«ü¥O DW ¯à²ÕĶ¥H ASCII ½s½Xªº­^¤å¡Bªü©Ô§B¼Æ¦r¦r¦ê¡AÅܦ¨ UCS¡Ð2 ½s½Xªº¦r¦ê¡C
⑵¡B¨Ï INVOKE °²«ü¥O¯à±µ¨ü¦r¦ê±`¼Æ¡C
¹w³]ªº¡uOPTION LITERALS¡v­È¬O OFF¡C
②¡B¥[¤W¡uUNICODE EQU 1¡v¡A«ü©wÀ³¥Îµ{¦¡©I¥s¼e¦r­ìª©¥»ªº Win64 API¡C¨£²Ä 5 ¦æ¡C
③¡B²Ä 13 ¦æªº¡uDW¡v·|§â«á­±ªº­^¤å¦r¥À¡Bªü©Ô§B¼Æ¦rµ¥²Õ¦¨ªº ASCII ¦r¦ê¡A³v­Ó¦ì¤¸²Õ©î¸Ñ¡A¨Ã¦b°ª¦ì§}·s¼W¤@­Ó¦ì¤¸²Õ¡A¨Ï°ª¦ì§}ªº¦ì¤¸²Õ³]¬°¹s¡AÂǦ¹§Î¦¨¸U°ê½X¡C¦P®É¦Û°Ê¦b³Ì«á­±¥[¤W¤@­Ó¦r²Õªº 0¡C·íµM¡A³o¥²¶·¦b¦³¡uOPTION LITERALS:ON¡vªº«e´£¤U¡C
④¡B²Ä 18 ¦æ¡A¦b¦³¡uOPTION LITERALS:ON¡vªº«e´£¤U¡AINVOKE °²«ü¥O¥i¥Hª½±µ±µ¨ü¦r¦ê±`¼Æ¡C¦pªG³o­Ó¦r¦ê±`¼Æ«e¦³¥[¤W¡uL¡v¡A¨º»ò UASM64.EXE ·|§â¥Ñ­^¤å¦r¥À¡Bªü©Ô§B¼Æ¦rµ¥²Õ¦¨ªº ASCII ¦r¦ê¡AÂàÅܦ¨ UCS¡Ð2 ½s½Xªº¦r¦ê¡C

²ÕĶ»P³sµ²¤è¦¡¬O¥ý¶}±Ò¡u©R¥O´£¥Ü¦r¤¸¡v¿é¤J¤U­±¶À¦â¦rªº«ü¥O¡A»s§@¥X¨Óªº FIRSTU.EXE µe­±¦p¥k¹Ï¡G

Microsoft Windows [ª©¥» 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\wanker>uasm [Enter]  ¡÷°õ¦æ UASM.BAT §å¦¸ÀÉ¡A¬Ù¤F³\¦h¥´¦r¿é¤J¡A¨£²Ä 11 ³¹ UASM.BAT

C:\Users\wanker>SET INCLUDE=C:\UASM\Include

C:\Users\wanker>SET LIB=C:\UASM\lib64

C:\Users\wanker>SET PATH=C:\UASM;C:\UASM\bin64;C:\Windows\system32;C:\Windows;C:
\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Fi
les (x86)\UltraEdit-32

C:\Users\wanker>E:

E:\>CD E:\HOMEPAGE\SOURCE\WIN64
LINK=/SUBSYSTEM:WINDOWS /DEBUG

E:\HomePage\SOURCE\Win64>cd UNICODE [Enter] ¡÷¤Á´«¦Ü UNICODE ¤l¥Ø¿ý

E:\HomePage\SOURCE\Win64\UNICODE>uasm64 -win64 FIRSTU.ASM [Enter]
UASM v2.56, Oct 27 2022, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

FIRSTU.ASM: 22 lines, 3 passes, 519 ms, 0 warnings, 0 errors

E:\HomePage\SOURCE\Win64\UNICODE>link firstu.obj [Enter]
Microsoft (R) Incremental Linker Version 14.25.28614.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/SUBSYSTEM:WINDOWS /DEBUG

E:\HomePage\SOURCE\Win64\UNICODE>

µ²½×¡G­n»s§@­^¤åªº¼e¦r¤¸À³¥Îµ{¦¡¡A«Ü²³æ¡A¥u­n¦b­ì©lµ{¦¡¤¤³]©w¡uOPTION LITERALS:ON¡v¡A¥[¤J¡uUNICODE EQU 1¡v§Y¥i¡C«eªÌ¨Ï¡uDW¡v°²«ü¥O©w¸q¸U°ê½X¦r¤¸¡A«áªÌ¨ÏÀ³¥Îµ{¦¡©I¥s Win64 API ªº¼e¦r¤¸ª©¥»¡C


¤¤¤åªº¼e¦r¤¸À³¥Îµ{¦¡

¹ï©ó¼¶¼g¤¤¤åªº¼e¦r¤¸À³¥Îµ{¦¡´N¨S³o»ò©¯¹B¤F¡A¦ý¬OÁÙ¬O¦³¤èªkªº¡C©³¤U¥ý¨Ó¬Ý¬Ý¡A§â FIRSTU.ASM §ï¦¨¤¤¤åª©ªº FIRSTUC.ASM ¬O¤°»ò¼Ë¤l¡H¥DÀɦW³Ì«á¤@­Ó¦r¤¸¡uC¡vªí¥Ü¤¤¤åªº·N«ä¡C©³¤U¬O FIRSTUC.ASM ªº¤º®e¡G

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
OPTION  CASEMAP:NONE
OPTION  WIN64:3

UNICODE EQU     1       ;©I¥sWin64 APIªº¼e¦r¤¸ª©¥»

INCLUDE         WINDOWS.INC
INCLUDELIB      KERNEL32.LIB
INCLUDELIB      USER32.LIB
;**********************************************************************************************
.CONST
szTitle DW      986fh,793ah,842ch,570bh,78bch,5b57h,4e32h,0                ;Åã¥Ü¸U°ê½X¦r¦ê
szText  DW      9019h,500bh,53e5h,5b50h,662fh,4ee5h,55h,43h,53h,0ff0dh,32h ;³o­Ó¥y¤l¬O¥HUCS¡Ð2
        DW      7de8h,78bch,800ch,6210h,3002h,0                            ;½s½X¦Ó¦¨¡C
;**********************************************************************************************
.CODE
;---------------------------------------------------------------------------------------------
main    PROC
        invoke  MessageBox,0,OFFSET szText,OFFSET szTitle,MB_OK
        call    ExitProcess
main    ENDP
;**********************************************************************************************
END     main

¤¤¤åª©ªº¼e¦r¤¸À³¥Îµ{¦¡»P ANSI À³¥Îµ{¦¡¤£¦P¤§³B¡A¤]¦b¤W­±­ì©l½X¤¤¥Hµµ¬õ¦âªº¦r¼Ð¥Ü¥X¨Ó¤F¡C²Ä 4 ¦æ¡A¸ò­^¤åª©ªº¤@¼Ë¡A¡uUNICODE EQU 1¡v¥Î¨Ó¨ÏÀ³¥Îµ{¦¡©I¥s¼e¦r¤¸ª©ªº Win64 API¡C²Ä 11¡ã13 ¦æ©w¸qªº¦r¦ê¡A¥þ³¡¥Î¼Æ­Èªí¥Ü¡C«Ü©úÅã¡A²Ä 11 ¦æ²Ä¤@­Ó¦r²Õ¡A986Fh ¬O UCS¡Ð2 ½s½X¡A¨ä¤¤¤å¦r´N¬O«á­±µù¸Ñªº¡uÅã¡v¡C¨Ì¦¹Ãþ±À¡A793Ah ¬O¡u¥Ü¡vªº UCS¡Ð2 ½s½X ¡K¡K¡A³o¼Ë´N«Ü¦nÁA¸Ñ¤F¡C

¦]¬°²ÕĶ¾¹¡A¤£½×¬O UASM64.EXE ÁÙ¬O ML64.EXE ³£¥u¯àŪ¨ú ANSI ¨î©wªº ASCII ¯Â¤å¦rÀɮסA¦Ó§Ú­ÌµLªk¦b¦r¦ê¤¤¥H UCS¡Ð2 ½s½X¡A¦b¨ä¥L°²«ü¥O©Î x86 «ü¥O¥Î ASCII ½s½X¡C©Ò¥H¥u¯à¥Î¤W­±³o¼ËªºÅܳq¤è¦¡¡A¦bªí¥Ü¦r¦ê®É¡A¥H UCS¡Ð2 ½s½X«áªº¤Q¤»¶i¦ì©Î¤Q¶i¦ì¼Æ­Èªí¥Ü¡C

ÁٳѤU¤@­Ó°ÝÃD¡AÃø¹D¥Î¤¤¤å¸U°ê½X¦r¦ê¡A¬O¤£¬O­n¤@­Ó¦r¤@­Ó¦rªº¬dªí¡A¬d¥X¸Ó¦rªº½s½X¡H·íµM¤£¬O¡A¦pªG¬O³o¼Ë¡A¼g­Óµ{¦¡°Z¤£¦Û­h¡H¦b¤U¤@³¹¡A¤p¤ì°¸·|¼¶¼g¤@­Óµ{¦¡¡A¸Ñ¨M³o­Ó°ÝÃD¡C

²ÕĶ¡B³sµ² FIRSTUC.ASM ªº¨BÆJ¸ò FIRSTU.ASM ¤@¼Ë¡A¤£¦A±Ô­z¡A¦Ó¥¦°õ¦æªºµ²ªG¦p¥k¹Ï¡C¬Ý°_¨Ó¦ü¥G¸ò ANSI À³¥Îµ{¦¡¨S¤°»ò®t§O¡A¦ý¬O¦pªG¥Î x64dbg ¸ü¤J¥¦¡AÆ[¹î¥¦¦b .CONST °Ï¬qªº¤º®e¡A´N¯à¬Ý¥X¥¦½T¹ê¬O¦p°²¥]´«ªº¼e¦r¤¸À³¥Îµ{¦¡¡A¨BÆJ¦p¤U¡G

  1. ¶}±Ò x64dbg¡A¸ü¤J FIRSTUC.EXE¡C
  2. «ö¤U¥|¦¸ F7 Áä¡A³æ¨B°lÂÜ¥|¨B¤§«á¡A¤w¸g°õ¦æ¨ì RIP ©Ò«üªº¦ì§} 13FEC1020 ³B¡A¦¹®É¤w§â­n¦L¦b¤u§@°Ï¤Wªº¦r¦ê¦ì§}¦s¤J RDX ¤º¡A¦p¤U¹Ï¡C³o®É¸ê®ÆÅã¥Ü°ÏÁÙ¤£¬O¸Ó¦r¦êªº¦ì§}¡A¥i¥H§â·Æ¹«´å¼Ð²¾¨ì¸ê®ÆÅã¥Ü°Ï¡]①³B¡A¯»¬õ¦â®Ø¡^«ö¤U·Æ¹«¥ªÁä¡A«ö¤U¥[³tÁä¡ACtrl¡ÐG¡A¸õ¥X¤@¹ï¸Ü²°¡C¦b¨ä½s¿è®Ø¿é¤J¡uRDX¡v¡A¡]②³B¡A¬õ¦â®Ø¡^ªí¥Ü¨Ï¸ê®ÆÅã¥Ü°ÏÅã¥Ü RDX ©Ò«üªº¦ì§}¡F¤]¥i¥Hª½±µ¿é¤J¦ì§}¡A13FEC4010¡]¦b x64dbg ¿é¤J®É¡A¤j¤p¼g§¡¥i¡^¡C¿é¤J§¹¦¨«á«ö¤U Enter Áä©Î¥Î·Æ¹«ÂI¿ï③³Bªº¡u½T»{¡v«ö¶s ³o®É­Ô¸ê®ÆÅã¥Ü°Ï¤º¬O¥H ASCII ½s½XÅã¥Ü¦r¤¸¡A¨£¤U¹Ïµµ¦â®Ø¡C§â·Æ¹«´å¼Ð²¾¨ì¸ê®ÆÅã¥Ü°Ï¡A«ö¤U·Æ¹«¥kÁä¡]¨£④³B¡^¡A¥X²{§Ö±¶¥\¯àªí¡C¥Î·Æ¹«¥ªÁäÂI¿ï⑤³Bªº¡u¤Q¤»¶i¦ì¡v¼u¥X¿ï¶µ¡A¦A¥Î·Æ¹«¥ªÁäÂI¿ï⑥³Bªº¡u¦r½X­¶¡v
  3. µM«á·|¥X²{¤@­Ó¿ï¾Ü¦r½X­¶¹ï¸Ü²°¡A¦p¤U¹Ï¡C§Ú­Ì­n¿ï¾Üªº¬O¸U°ê½Xªº½s½X¤è¦¡¡AUCS¡Ð2 ©Î UCS¡Ð4¡C¦]¬° UCS¡Ð2 »P UTF¡Ð16 ¬Ûªñ¡A¦Ó«á­±ªº¡uLE¡v©Î¡uBE¡v¤À§O¥Nªí¤pºÝ§Ç¡]Little-Endian¡^»P¤jºÝ§Ç¡]Big-Endian¡^¡Cx86¡Ð64 CPU ªºÀx¦s¤è¦¡¬O¤pºÝ§Ç¡A©Ò¥H¿ï¾Ü⑦³Bªº UTF¡Ð16LE¡AµM«áÂIÀ»⑧³Bªº½T»{«ö¶s¡C¦p¤U¹Ï¡G
  4. ²×©ó¤j¥\§i¦¨¡A¨£⑨³BªºÂŦâ®Ø¤º¡A¤w¸g¯à¥¿±`Åã¥Ü¥H¸U°ê½X½s½Xªº¥¿Å餤¤å¤F¡C§A¤]¥i¥H§âÂŦâ®Ø¥kÃ䪺±²¶b©¹¤W±²°Ê¡A¥i¥H¬Ý¨ì¹ï¸Ü©M¼ÐÃDÄ檺¤å¦r¡C

Á¿¨ì³o¨à¡AÅýÀ³¥Îµ{¦¡Åã¥Ü¡BÀx¦s©Î³B²zªº¦r¤¸¡A¬O¥H¸U°ê½X½s½Xªº¤è¦¡§¹¦¨¡Aºâ¬O§i¤@¬q¸¨¡C¦A²`¤J¤@ÂI¡A´N¬OÅýÀ³¥Îµ{¦¡¯à¥H¦hºØ¤£¦P¤å¦rÅã¥Ü¡AÅý§ó¦h°ê®aªº¤H¯à¨Ï¥Î¡A¹³³o¼Ëªºµ{¦¡ºÙ¬°¦h»y¨¥À³¥Îµ{¦¡¡]Multilingual Application¡^©Î°ê»Ú¤ÆÀ³¥Îµ{¦¡¡]Internationalized Application¡^¡C


°ê»Ú¤ÆÀ³¥Îµ{¦¡¡]Internationalized Application¡^

°ê»Ú¤ÆÀ³¥Îµ{¦¡­^¤å¬O internationalized application¡A©Î I18N Application¡]I18N ¬O Internationalization ÁY¼g¡A¬O¶}ÀYªº I ©Mµ²§Àªº n ¤§¶¡¦³ 18 ­Ó¦r¥À¡^¡A¬O«ü¥i¥HÅý¨Ï¥ÎªÌ¿ï¾Ü¬YºØ»y¨¥ªºÀ³¥Îµ{¦¡¡A³oºØÀ³¥Îµ{¦¡¨ã¦³¦h»y¨¥¤¶­±¡C­n¼¶¼g³oºØµ{¦¡¡A¦Ü¤Ö¦³¤TºØ¤èªk¡G

  1. ¬°¨CºØ»y¨¥¼¶¼g­ì©lµ{¦¡¡]ASM ÀÉ¡^¤Î¸ê·½´y­zÀÉ¡]RC ÀÉ¡^¡A³o¬O¦­¥ý¨Ï¥Îªº¤èªk¡A¤w³vº¥²^¨O¡CÄY®æªº»¡¡A³o¤£¯àºÙ¬°°ê»Ú¤ÆÀ³¥Îµ{¦¡¡C
  2. ¥Î¸ê·½´y­zÀɤºªº¦r¦êªí¹ê²{¦h»y¨¥¤¶­±¡C
  3. ¥H¶È§t¸ê·½ªº°ÊºA³sµ²µ{¦¡®w¹ê²{¦h»y¨¥¤¶­±¡C

¥»³¹µÛ­«¦b²Ä¤GºØ¤èªk¡C¬°¤F¥Î³oºØ¤èªk¼¶¼g°ê»Ú¤ÆÀ³¥Îµ{¦¡¡A¥²¶·¥ýÁA¸Ñ¦r¦êªí¡A¥H¤Î¦p¦ó¸ü¤J¥¦¡C

¦r¦êªí¡]String Table¡^

¦r¦êªí¦b¸ê·½´y­zÀɤº¡A¥¦ÄÝ©ó¸ê·½ªº¤@ºØ¡C¥i¥H¨Ì©³¤U®æ¦¡«Ø¥ß¦r¦êªí¡G

STRINGTABLE
[optional-statements]
BEGIN
  stringID,string
   ⁝
END

¨ä¤¤ STRINGTABLE ¬O«O¯d¦r¡A¥Nªí¦r¦êªí±q³o¨à¶}©l¡Coptional-statements ¬O¥i¥H¬Ù²¤ªº¡A¨ä·N¸q¸ò¸ê·½´y­zÀɤ¤ªº¥\¯àªí°Ï¶ô¤@¼Ë¡A½Ð°Ñ¾\²Ä¤Q¤»³¹¡C

¦b BEGIN »P END ¤§¶¡¤~¬O¯u¥¿©w¸q¤F¦U¦¡¦U¼Ëªº¦r¦ê¡ABEGIN/END ¤]¥i¥H¥Î¤@¹ï¡u{ }¡v¥N´À¡A¦b¥¦­Ì¤§¶¡ªº¨C¤@²Õ¦r¦ê³£¬O¥Ñ¤@­Ó¤Q¤»¦ì¤¸ªº¦r¦êÃѧO½X¤Î¦r¦êºc¦¨¡C¤Q¤»¦ì¤¸¥i¥Hªí¥Ü 1¡ã65535 ¤§¶¡ªº¾ã¼Æ¡A¦]¦¹¦r¦êÃѧO½X¤]¬O¦b³o­Ó½d³ò¤º¡C¦r¦ê¥²¶·¥H¤@¹ï¤Þ¸¹¡]"¡^¬A¦í¡A¦r¦ê¤]¥i¥H¥]§t´«¦æ²Å¸¹¡A¥i¥H¥Î¡u\12¡v©Î¥Î¤Q¤»¶i¦ì¡u\x0c¡vªí¥Ü¡A¤]¥i¥H¥Î²ßºD¤Wªº¡u\x0d\x0a¡v¨Óªí¥Ü¡C¦pªG¦b¦r¦ê¤¤­nªí¥Ü "¡A¥i¥H¥Î¨â­Ó³sÄòªº " ªí¥Ü¡A³o¼Ë¥u·|¥X²{¤@­Ó "¡C¦r¦ê»P¦r¦êÃѧO½X¤§¶¡¡A¥i¥H¥ÎªÅ¥Õ©Î¡u,¡v¤À¹j¡C©³¤U¨Ò¤l¥i¨Ñ°Ñ¦Ò¡G

#define IDS_FILE 2000
#define IDS_EDIT 2001
STRINGTABLE
{
  IDS_FILE,"ÀÉ®×"
  IDS_EDIT "½s¿è"
}

LoadString API

¸ü¤J¦r¦êªí¤¤ªº¦r¦ê¡A¥i©I¥s LoadString¡A¥¦ªº­ì«¬¬O¡G

invoke  LoadString,\
        hInstance,\     ; handle of module containing string resource
        uID,\           ; resource identifier
        lpBuffer,\      ; address of buffer for resource
        nBufferMax 	    ; size of buffer

hInstance ¬O¼Ò²Õ¥N½X¡FuID ¬O­n¸ü¤Jªº¦r¦êÃѧO½X¡FlpBuffer ¥Î¨Ó«ü©w¸ü¤J«áªº¦r¦ê¦s©ñ¦ì§}¡FnBufferMax ¬O¦s©ñ¦r¦êªºªÅ¶¡¤j¤p¡AANSI ª©ªº API ¥H¦ì¤¸²Õ¬°³æ¦ì¡A¼e¦r¤¸ª©¥H¦r¤¸¬°³æ¦ì¡A¦¹ªÅ¶¡¤j¤p¥]§t³Ì«áµ²§Àªº 0¡C¦pªG¦r¦êªø«×¶W¹L nBufferMax¡A¨º»ò¥u·|¨ú±o¦r¦êªº«e nBufferMax¡Ð1 ­Ó¦ì¤¸²Õ©Î¦r¤¸¡A´î±¼ªº¤@¬O«O¯dµ¹¦r¦êµ²§Àªº 0¡C

LoadString ÁÙ¦³­Ó¥\¯à¡A¦pªG nBufferMax ³]¬°¹s¡A¨º»ò lpBuffer ©Ò«üªº¦ì§}¤¤·|±o¨ì¸Ó¦r¦êªº¦ì§}¡A³o­Ó¦ì§}¬O°ßŪ¤£¯à¼g¤J¡C¦pªG­n³]©w nBufferMax ¬°¹s¡A¦b½sĶ *.RC ÀɮɡA³Ì¦n¯à¿é¤J¡u-n¡v©Î¡u/n¡v°Ñ¼Æ¡A¦p¤U¡G

E:\HomePage\SOURCE\Win64\UNICODE>rc /n muln1.rc [Enter]

¡u/n¡v¬O·|¨Ï¦r¦êªí¤¤ªº¦r¦êµ²§À³B¥[¤W¡uNULL¡v¡A³o¼Ëªº¦n³B¬Oµ{¦¡¤£¥²¬°¸ü¤Jªº¦r¦ê·Ç³Æ¤@¶ô°O¾ÐÅé¡C

¼¶¼g°ê»Ú¤ÆÀ³¥Îµ{¦¡ªºµ¦²¤

­nÅýÀ³¥Îµ{¦¡¯à°÷ÀH¨Ï¥ÎªÌªº²ßºD¡A¿ï¨ú¤£¦Pªº»y¨¥¤¶­±¡AÀ³¸Ó¦³³\¦hºØ¤èªk¡A¦ý¤p¤ì°¸ªº«ä¸ô¬O¹³¤U­±³o¼Ë¡G

  1. ¦b¸ê·½´y­zÀɤº¡A¦r¦êªí«Ø¥ß¤£¦P»y¨¥ªº¦r¦ê®É¡AÅý¬Û¦P»y¨¥¦r¦êªº¦r¦êÃѧO½X§Î¦¨³sÄòªº¾ã¼Æ¡C
  2. ¦b¤£¦P»y¨¥¤§¶¡¡A·N¸q¬Û¦Pªº¦r¦êªº¦r¦êÃѧO½X¤§®t¬Û¦P¡C¨Ò¦p¤U­±ªº¨Ò¤l´N²Å¦X³o¨â¶µµ¦²¤¡A¤¤¤åªº¦r¦êÃѧO½X³£¦b¤@¤d¦h¡A­^¤å«h¦b¤­¤d¦h¡F¥B¡u½s¿è¡vªº¦r¦êÃѧO½X¤ñ¡uÀɮסv¦h¤@¡A­^¤åªº¡uEdit¡v¤]¤ñ¡uFile¡v¦h¤@¡G
    STRINGTABLE
    BEGIN
      1000, "ÀÉ®×"
      1001, "½s¿è"
      1002, "»y¨¥"
       ⁝
      5000, "File"
      5001, "Edit"
      5002, "Language"
       ⁝
    END
  3. ¦b­ì©lµ{¦¡¤¤¡A¥H¤@­ÓÅܼƨӥNªí¨Ï¥ÎªÌ¿ï¾Üªº»y¨¥¡A¨Ò¦p¥H¤W­zªº¨Ò¤l¡A·í¨Ï¥ÎªÌ¿ï¾Ü¤¤¤å®É¡A¸ÓÅܼÆÅܬ° 1000¡F·í¨Ï¥ÎªÌ¿ï¾Ü­^¤å®É¡A¸ÓÅܼÆÅܬ° 5000¡C
  4. ·í¨Ï¥ÎªÌ§ïÅÜ»y¨¥®É¡A­n¨ú§ïÅܵ{¦¡¤¶­±¤Wªº¤å¦r®É¡A«Ü®e©ö¨Ì¾Ú²Ä 3. ©Ò´£¨ìªºÅܼơA¥Ñ¸ê·½¤¤¸ü¤J¦P¸q¦r¦ê¡C

©³¤U¹ê§@¤@­Ó¨Ò¤l»¡©ú¤W­±ªºµ¦²¤¡C


²Ä¤@­Ó°ê»Ú¤ÆÀ³¥Îµ{¦¡¡GMULN1

MULN1 ¤¤ªº MU¡BLN ¬O«ü Multilingual ¤¤ Mu ¤Î lin¡A·N§Y¦h»y¨¥À³¥Îµ{¦¡¡C¥¦°õ¦æ®É·|«Ø¥ß¤@­Ó¹ï¸Ü²°µe­±¦p¤U¹Ï¡A¥iÅý¨Ï¥ÎªÌ¿é¤J¦W¦r¡AµM«á«ö¤U¡u°Ý­Ô¡v«ö¶s¡A¥i¥H¦b¹ï¸Ü²°¤W¦L¥X¡u§A¦n¡A¢æ¢æ¡vªº°Ý­Ô»y¦r¼Ë¡]¥Ò¹Ï¡^¡C¨Ï¥ÎªÌ¤]¥i¥HÂI¿ï¥\¯àªí¤¤ªº»y¨¥¡A¦³¥¿Å餤¤å¡B²Å餤¤å¡B­^¤å¡B¦è¯Z¤ú¤å¡B¦L¦a¤å¥|ºØ»y¨¥¡]¤A¹Ï¡^¡A³o¥|ºØ»y¨¥¬O¥@¬É¨Ï¥Î¤H¤f³Ì¦hªº¥|ºØ»y¨¥¡C¤@¥¹¨Ï¥ÎªÌ§ïÅÜ»y¨¥«á¡A¨Ò¦p¿ï¾Ü¡u¦L¦a»y¡v¡A¹ï¸Ü²°¤¤ªº¥\¯àªí¡B±±¨î¶µ¤Wªº¤å¦r³£·|ÀH¤§Åܦ¨¦L¦a»y¤å¦r¡]¤þ¹Ï¡^¡C

¥ý¨Ó¬Ý¬Ý MULN1.EXE.MANIFEST ªº¤º®e¡Aª`·N¡A¥¦»P«e¤@³¹Â²µu«Ü¦h¡A¦]¬°¬Ù²¤¤F<assemblyIdentity ¡K¡K> ¤¸¯À¡C³o­Ó¤¸¯À¥Î¨Ó´y­zÀ³¥Îµ{¦¡¥»¨­¡A¦p¤£»Ý­n¬O¥i¥H¬Ù²¤ªº¡C

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        processorArchitecture="*"
        publicKeyToken="6595b64144ccf1df"
        language="*"
      />
    </dependentAssembly>
  </dependency>
</assembly>

©³¤U¬O¸ê·½´y­zÀÉ¡AMULN1.RC¡Aªº¤º®e¡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
#pragma  code_page(65001)
#include "RESOURCE.H"
#define MANIFEST  24
#define ID_DLG    1000
#define ID_ICON   1001
#define ID_MENU   1002
#define IDS_NAME  2001
#define IDE_NAME  2002
#define IDS_GREET 2003
#define IDB_GREET 2004
#define IDB_QUIT  2005
#define IDM_OPEN  30000
#define IDM_SAVE  30001
#define IDM_QUIT  30002
#define IDM_HELP  30003
#define IDM_TC    31000
#define IDM_SC    32000
#define IDM_EN    33000
#define IDM_ES    34000
#define IDM_HI    35000

ID_DLG  DIALOGEX 350,180,126,56
CAPTION "¦h»y¨¥À³¥Îµ{¦¡½d¨Ò"
FONT    12,"Times New Roman",400,0,0
STYLE   WS_VISIBLE|WS_OVERLAPPEDWINDOW
BEGIN
  RTEXT    "½Ð¿é¤J©m¦W¡G",IDS_NAME,6,3,51,17
  EDITTEXT IDE_NAME,    61, 6,51,9
  LTEXT    "",IDS_GREET,14,20,93,9
  PUSHBUTTON "°Ý­Ô",IDB_GREET,32,32,36,12
  PUSHBUTTON "Â÷¶}",IDB_QUIT, 74,32,36,12
END

ID_MENU MENU
BEGIN
  POPUP "ÀÉ®×"
    {
      MENUITEM "¶}±Ò",IDM_OPEN
      MENUITEM "Àx¦s",IDM_SAVE
      MENUITEM "Â÷¶}",IDM_QUIT
    }
  POPUP "»y¨¥"
    {
      MENUITEM "¥¿Å餤¤å",IDM_TC
      MENUITEM "简Ê^¤¤¤å",IDM_SC
      MENUITEM "English",IDM_EN
      MENUITEM "Español",IDM_ES
      MENUITEM "स्पेनिश",IDM_HI
    }
  MENUITEM "»¡©ú",IDM_HELP
END

1 MANIFEST "muln1.exe.manifest"

ID_ICON ICON "muln1.ico"

STRINGTABLE
BEGIN
  IDM_TC,   "ÀÉ®×"
  IDM_TC+1, "»y¨¥"
  IDM_TC+2, "»¡©ú"
  IDM_TC+3, "¶}±Ò"
  IDM_TC+4, "Àx¦s"
  IDM_TC+5, "Â÷¶}"
  IDM_TC+6, "½Ð¿é¤J©m¦W¡G"
  IDM_TC+7, "°Ý­Ô"
  IDM_TC+8, "Â÷¶}"
  IDM_TC+9, "§A¦n¡A"
  IDM_TC+10,"¦h»y¨¥À³¥Îµ{¦¡½d¨Ò"
  IDM_TC+11,"¦h»y¨¥À³¥Îµ{¦¡½d¨Ò\x0a²Ä1.00ª©"
 
  IDM_SC,   "¤å¥ó"
  IDM_SC+1, "语¨¥"
  IDM_SC+2, "说©ú"
  IDM_SC+3, "开启"
  IDM_SC+4, "¦s储"
  IDM_SC+5, "°h¥X"
  IDM_SC+6, "请输¤J©m¦W¡G"
  IDM_SC+7, "问­Ô"
  IDM_SC+8, "°h¥X"
  IDM_SC+9, "§A¦n¡A"
  IDM_SC+10,"¦h语¨¥应¥Îµ{§Ç­S¨Ò"
  IDM_SC+11,"¦h语¨¥应¥Îµ{§Ç­S¨Ò\12²Ä1.00ª©"

  IDM_EN,   "File"
  IDM_EN+1, "Language"
  IDM_EN+2, "Help"
  IDM_EN+3, "Open"
  IDM_EN+4, "Save"
  IDM_EN+5, "Quit"
  IDM_EN+6, "Please input your name:"
  IDM_EN+7, "Greeting"
  IDM_EN+8, "Quit"
  IDM_EN+9, "Hello, "
  IDM_EN+10,"Multilingual program examples"
  IDM_EN+11,"Multilingual Program Examples\12Version 1.00"

  IDM_ES,   "Archivo"
  IDM_ES+1, "Idioma"
  IDM_ES+2, "Ayuda"
  IDM_ES+3, "Abrir"
  IDM_ES+4, "Guardar"
  IDM_ES+5, "Salir"
  IDM_ES+6, "Por favor, ingrese su nombre:"
  IDM_ES+7, "Hola"
  IDM_ES+8, "Salir"
  IDM_ES+9, "Hola, "
  IDM_ES+10,"Ejemplo de programa multilingüe"
  IDM_ES+11,"Ejemplo de Programa Multilingüe\12Versión 1.00"

  IDM_HI,   "फ़ाइल"
  IDM_HI+1, "भाषा"
  IDM_HI+2, "सहायता"
  IDM_HI+3, "खोलें"
  IDM_HI+4, "सहेजना"
  IDM_HI+5, "बाहर निकलें"
  IDM_HI+6, "कृपया अपना नाम दर्ज करें:"
  IDM_HI+7, "सादर प्रणाम"
  IDM_HI+8, "बाहर निकलें"
  IDM_HI+9, "नमस्ते, "
  IDM_HI+10,"बहुभाषी कार्यक्रम का उदाह"
  IDM_HI+11,"बहुभाषी कार्यक्रम का उदाह\12संस्करण 1.00"
END

ª`·N¨ì STRINGTABLE °Ï¶ô¡A±q²Ä 57¡ã123 ¦æ¬O¤­ºØ»y¨¥¤å¦rªº¦r¦ê¡A¨Ã¥B¥Ñ²Ä 16¡ã20 ¦æ¥i¥H¬Ý¥X¤­ºØ¤å¦rªº¦r¦êÃѧO½X¡G¥¿Å餤¤åªº¦r¦êÃѧO½X°_©l©ó 31000¡A²×¤î©ó 31011¡F²Å餤¤å°_©l©ó 32000¡A²×¤î©ó 32011¡K¡K¡A¨Ì¦¹Ãþ±À¡C¦P¤@ºØ»y¨¥ªº¦r¦êÃѧO½X³£¬O³sÄòªº¾ã¼Æ¡A¤£¦PºØªº»y¨¥«h¤£³sÄò¡C°£¦¹¤§¥~¡A¤£¦P»y¨¥¤§¶¡¡A¬Û¹ïÀ³ªº¦r¦êÃѧO½X©Ò¥Nªíªº¦r¦ê¡A·N¸q¬Û¦P¡C¨Ò¦p³o¤­ºØ¤å¦rªº°_©l¦r¦êÃѧO½X©Ò¥Nªíªº¦r¦ê¡AÀɮסB¤å¥ó¡BFile¡BArchivo¡Bफ़ाइल³£¬OÀɮתº·N«ä¡A¦P²z²Ä¤G­Ó³£¬O»y¨¥ªº·N«ä¡C

¦]¬° MULN1.RC ¤º§t¦hºØ»y¨¥¡A¦]¦¹¦bÀx¦s®É¶·ª`·NÀx¦s®æ¦¡¡A±`¨£±¡§Î¦p¤U¡G

  1. ¦b¹w³]ªº±¡§Î¤U¡ARC.EXE °²³]¸ê·½´y­zÀɬO¥Î¥¿¦b½sĶªº¨t²Î¤W ANSI ¥N½X­¶¡]code page¡^Àx¦sªº¡]½Ð°Ñ¾\Raymond Chen ªº¤åÄm¡^¡C¹ï¦b¤¤µØ¥Á°ê¡B­»´äµ¥¦a³c°âªº Windows XP ¤Î¨ä¥H«á¨t²Î¦Ó¨¥¡A¹w³]­È¬O 950¡A³o¥¿¹ïÀ³ Big5 ½s½X¡A³oµLªkº¡¨¬ MULN1 ¹ï¦h»y¨¥­n¨D¡A¬Æ¦Ü§A¦b¤å®Ñ³B²z¾¹¤W¡A©Ò¨£ªº¦è¯Z¤ú¤å¡B¦L¦a¤å³£¬O¶Ã½X¡C
  2. §â MULN1.RC ³]¬° UTF¡Ð8 ½s½X¡C²{¦b¥u»Ýª¾¹D¡AUTF¡Ð8 ¤]¬O¸U°ê½Xªº¥t¤@ºØ½s½X¤è¦¡¡A¥H«á¦A»¡©ú¡C¦b MULN1.RC ªº²Ä¤@¦æ¦³
    #pragma  code_page(­¶½X)
    §iª¾ RC.EXE ³o¥÷¸ê·½´y­zÀɪº½s½X¤è¦¡¡C65001 ´N¬O UTF¡Ð8¡A950 ¬O Big5¡A936 ¬O GB2312¡C«ü©w½s½X¤è¦¡«á¡A¦bÀx¦s¸ê·½´y­zÀɮɤ]»Ý«ü©w UTF¡Ð8 ®æ¦¡Àx¦s¡C¹ï MULN1.RC ¨Ó»¡¡A¥u¯à«ü©w¡u#pragma code_page(65001)¡v¡C
  3. Åý RC.EXE ¦Û¤v¥h§P§O¡C¦pªG¨S¦³¯S§O«ü©wªº¸Ü¡ARC.EXE ÁöµM·|¥Î¹w³]ªº ANSI ¥N½X­¶¡A¦ý¥¦¤]¯à¦Û°Ê§P§O¡C¦Ü¤Ö¤p¤ì°¸¦bÀx¦s¸ê·½´y­zÀɮɡA¿ï¾Ü UTF¡Ð16 no BOM ®æ¦¡Àx¦s¡AµM«á¥Î RC.EXE ½sĶ¬O¨S¦³°ÝÃDªº¡C

¦b¨Ï¥Î¸ê·½½sĶ¾¹¡ARC.EXE ½sĶ¸ê·½´y­zÀÉ¡AMULN1.RC ®É¡A­n¤U¹F¡u-n¡v©Î¡u/n¡v¿ï¶µ¡A³o¬O¦]¬°¦b©I¥s LoadString ¨ú±o¦r¦ê®É¡A´¿¨Ï³Ì«á¤@­Ó°Ñ¼Æ³]¬°¹s¡C¨£«e­± LoadString ªº»¡©ú¡C

³Ì«á¬O MULN.ASM ªº¤º®e¡A¦sÀɮɥ²¶·¥H ANSI/ASCII ®æ¦¡Àx¦s¡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
;¦h»y¤åÀ³¥Îµ{¦¡¡C²ÕĶ¡B³sµ²¤è¦¡¡G
;1.§âMULN1.ASM¡BMULN1.RC¡BMELN1.EXE.MANIFEST¡BMULN1.ICO¥|­ÓÀÉ®×
;  ©ñ¦b¦P¤@¤l¥Ø¿ýùØ
;2.¶}±Ò©R¥O¡A¨Ì§Ç¿é¤J¤U­±«ü¥O
;  uasm64 -win64 muln1.asm
;  rc -n muln1.rc
;  link muln1.obj muln1.res
;MULN1¥i¥HÅý¨Ï¥ÎªÌ¦b½s¿è®Ø¿é¤J©m¦W¡A«ö°Ý­Ô«ö¶s¡A·|¥X²{°Ý­Ô»y¡C
;¥i¥H¸g¥Ñ»y¨¥¥\¯àªí¿ï¾Ü¤­ºØ»y¨¥¡A§ïÅÜ»y¨¥«á¡A¥D¥\¯àªí¡B±±¨î¶µ
;ªº¤å¦r³£·|ÀH¤§§ïÅÜ
OPTION  CASEMAP:NONE
OPTION  WIN64:3

UNICODE   EQU 1
ID_DLG    EQU 1000
ID_ICON   EQU 1001
ID_MENU   EQU 1002
IDS_NAME  EQU 2001
IDE_NAME  EQU 2002
IDS_GREET EQU 2003
IDB_GREET EQU 2004
IDB_QUIT  EQU 2005
IDM_OPEN  EQU 30000
IDM_SAVE  EQU 30001
IDM_QUIT  EQU 30002
IDM_HELP  EQU 30003
IDM_TC    EQU 31000
IDM_SC    EQU 32000
IDM_EN    EQU 33000
IDM_ES    EQU 34000
IDM_HI    EQU 35000

INCLUDE       WINDOWS.INC
INCLUDE       COMMCTRL.INC
INCLUDELIB    KERNEL32.LIB
INCLUDELIB    USER32.LIB
INCLUDELIB    COMCTL32.LIB
INCLUDELIB    MSVCRT.LIB   ;wcscat¨ç¦¡ªº³sµ²¸ê®Æ¦bMSVCRT.LIB¤º
;*********************************************************************
.DATA
hInst    DQ   ?     ;¼Ò²Õ¥N½X
hMenu    DQ   ?     ;¥D¥\¯àªí¥N½X
hFilMenu DQ   ?     ;Àɮפl¥\¯àªí¥N½X
hLngMenu DQ   ?     ;»y¨¥¤l¥\¯àªí¥N½X
lng      DD   31000 ;¹w³]ªº»y¨¥
buffer1  DW   40h DUP (0)
buffer2  DW   40h DUP (0)
;*********************************************************************
.CODE
;---------------------------------------------------------------------
chg_lng PROC    hdlg:HANDLE
        LOCAL   mii:MENUITEMINFO,id:DWORD
        lea     r8,buffer1
        mov     mii.cbSize,SIZEOF mii
        mov     mii.fMask,40h   ;MIIM_STRING=40h
        mov     mii.dwTypeData,r8
        mov     edx,lng
        mov     id,edx
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;ÀÉ®×
        invoke  SetMenuItemInfo,hMenu,0,1,ADDR mii
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;»y¨¥
        invoke  SetMenuItemInfo,hMenu,1,1,ADDR mii
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;»¡©ú
        invoke  SetMenuItemInfo,hMenu,2,1,ADDR mii
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;¶}±Ò
        invoke  SetMenuItemInfo,hFilMenu,0,1,ADDR mii
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;Àx¦s
        invoke  SetMenuItemInfo,hFilMenu,1,1,ADDR mii
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;Â÷¶}
        invoke  SetMenuItemInfo,hFilMenu,2,1,ADDR mii
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;½Ð¿é¤J©m¦W
        invoke  SetDlgItemText,hdlg,IDS_NAME,OFFSET buffer1
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;°Ý­Ô
        invoke  SetDlgItemText,hdlg,IDB_GREET,OFFSET buffer1
        inc     id
        invoke  LoadString,hInst,id,OFFSET buffer1,20h  ;Â÷¶}
        invoke  SetDlgItemText,hdlg,IDB_QUIT,OFFSET buffer1
        ret
chg_lng ENDP
;---------------------------------------------------------------------
DlgProc PROC    hDlg:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
        LOCAL   pCaption:QWORD,pText:QWORD
.if uMsg==WM_INITDIALOG
      ;³]©w¹ï¸Ü²°¼ÐÃDÄ楪Ã䪺¹Ï¥Ü¬°¸ê·½¤¤©w¸qªº¹Ï¥Ü
        invoke  SendMessage,hDlg,WM_SETICON,ICON_SMALL,RV(LoadIcon,hInst,ID_ICON)
      ;³]©w¹ï¸Ü²°ªº¥D¥\¯àªí¬°¸ê·½¤¤©w¸qªº¥\¯àªí
        mov     hMenu,RV(LoadMenu,hInst,ID_MENU)
        invoke  SetMenu,hDlg,hMenu
      ;¨ú±oÀɮפl¥\¯àªí¤Î»y¨¥¤l¥\¯àªí¥N½X
        mov     hFilMenu,RV(GetSubMenu,hMenu,0)
        mov     hLngMenu,RV(GetSubMenu,hMenu,1)

.elseif uMsg==WM_COMMAND
        mov     rax,r8   ;R8W¡×ÃѧO½X
        shr     rax,10h  ;AX¡×³qª¾½X
  .if ax==0
    .if r8w==IDB_QUIT
        jmp     quit
    .elseif r8w==IDB_GREET
grt:  ;«ö¤U¡u°Ý­Ô¡v«ö¶s¡A¥ý¨ú±o½s¿è®Ø¤º¦r¦ê¡A¦AÀˬd¸Ó¦r¦ê¬O§_¬°ªÅ¦r¦ê
      .if RV(GetDlgItemText,hDlg,IDE_NAME,ADDR buffer2,SIZEOF buffer2-1)==0
        mov     WORD PTR buffer1,0
      .else
        mov     edx,lng
        add     edx,9
        invoke  LoadString,hInst,edx,ADDR buffer1,20h
        invoke  wcscat,ADDR buffer1,ADDR buffer2
      .endif
        invoke  SetDlgItemText,hDlg,IDS_GREET,ADDR buffer1
    .elseif r8w==IDM_OPEN
    .elseif r8w==IDM_SAVE
    .elseif r8w==IDM_QUIT
        jmp     quit
    .elseif r8w==IDM_HELP
      ;¨ú±oMessageBox¼u¥X¹ï¸Ü²°¦r¦ê¦ì§}¤Î¼ÐÃD¦ì§}
        mov     edx,lng
        add     edx,11
        invoke  LoadString,hInst,edx,ADDR pText,0
        mov     edx,lng
        add     edx,10
        invoke  LoadString,hInst,edx,ADDR pCaption,0
      ;Åã¥ÜMessageBox¼u¥X¹ï¸Ü²°
        invoke  MessageBox,hDlg,pText,pCaption,MB_OK
    .elseif (r8w>=IDM_TC) && (r8w<=IDM_HI)
        movzx   rax,r8w
        mov     lng,eax
        invoke  chg_lng,hDlg
        invoke  DrawMenuBar,hDlg
        mov     edx,lng
        add     edx,10
        invoke  LoadString,hInst,edx,ADDR pCaption,0
        invoke  SetWindowText,hDlg,pCaption
        jmp     grt
    .endif
  .endif

.elseif uMsg==WM_CLOSE
quit:   invoke  EndDialog,hDlg,0

.else   ;¨ä¥L¥¼³B²zªº°T®§ªð¦^ FALSE
        xor     rax,rax
        ret
 
.endif  ;¤w³B²zªº°T®§¡Aªð¦^ TRUE
        mov     rax,1
        ret
DlgProc ENDP
;---------------------------------------------------------------------
main    PROC
        call    InitCommonControls
        mov     hInst,RV(GetModuleHandle,0)
        invoke  DialogBoxParam,hInst,ID_DLG,0,OFFSET DlgProc,0
        invoke  ExitProcess,0
main    ENDP
;*********************************************************************
END     main

¦p«e©Ò­z¡AMULN1 ³Ì­«­nªº¥\¯à¬O¥i¥H¥Ñ¥\¯àªí¤Wªº¿ï¶µ¡A§ïÅܹï¸Ü²°©ÒÅã¥Üªº»y¨¥¤å¦r¡C³B²z³o¹Lµ{¤¤¡A³Ì­«­nªºÅܼƬO²Ä 45 ¦æªº lng¡A¥¦¬O language ªºÂ²¼g¡A¹w³]­È¬O 31000¡A¤]´N¬O¥¿Å餤¤å°_©l¦r¦êÃѧO½X¡C·í¨Ï¥ÎªÌ¿ï¾Ü»y¨¥¥\¯àªí¤¤ªº¿ï¶µ§ïÅÜ»y¨¥®É¡Alng ¤§­È·|ÀH¤§§ïÅÜ¡A¦ý³£¬O¬YºØ»y¨¥¦b¸ê·½¦r¦êªí¤¤¡A°_©l¦r¦êªº¦r¦êÃѧO½X¡C

¨Ò¦p¨Ï¥ÎªÌ¿ï¾Ü­^¤å¡A¥Ñ²Ä 29 ¦æ±oª¾¡A­^¤åªº¿ï¶µÃѧO½X¡AIDM_EN ¬O 33000¡Alng ·|Åܦ¨ 33000¡A³o«ê¦n¤]¬O MULN1.RC ¤¤²Ä 85 ¦æ¡A­^¤åªº°_©l¦r¦êÃѧO½X¡F¤S¨Ò¦p¨Ï¥ÎªÌ¿ï¾Ü¦L¦a¤å¡Alng ·|Åܦ¨ 34000¡A³o¤]«ê¦n¬O MULN1.RC ¤¤ªº IDM_HI¡C·íµM¡A³o¬O¬G·N¦w±Æ¦¨³o¼Ëªº¡C¬°¤°»ò³o¼Ë¦w±Æ¡AÁA¸Ñ¤F chg_lng °Æµ{¦¡ªº¹B§@¡A´Nª¾¹D¬°¦ó³o¼Ë¦w±Æ¡C

¦b»¡³o­ì¦]¤§«e¡A³o¨àÁÙ­n¦h»¡¤@ÂIÃD¥~¸Ü¡C¨Ï¥ÎªÌ¿ï¾Ü¥\¯àªí¤Wªº¿ï¶µ©Î«ö¤U¹ï¸Ü²°¤¤ªº«ö¶s¡A¨t²Î³£·|¹ï MULN1 ªº¹ï¸Ü²°¨ç¦¡µo¥X WM_COMMAND¡A¦pªG¬O«eªÌ¡AwParam ªº²Ä 16¡ã31 ¦ì¤¸¤£¨Ï¥Î¡A³]¬°¹s¡F¦pªG¬O«áªÌ¡AwParam ²Ä 16¡ã31 ¦ì¤¸ºÙ¬°³qª¾½X¡A¦Ó¦¹¨è³qª¾½X¬O BN_CLICKED¡A¨ä­È«ê¦n¤]¬O¹s¡C©Ò¥H MULN1 §â³o¨â¨Æ¥óÂ\¦b¤@°_³B²z¡AMULN1 ¬O¾a«ö¶sÃѧO½X¸ò¿ï¶µÃѧO½X°Ï§O¥¦­Ì¡C²Ä 103¡B142 ¦æªº .if ax==0/.endif ¤º¥]§t¤F¥t¤@­Ó .if/.endif¡A³Q¥]§tªº .if/.endif Àˬd R8W¡]R8W ¬°«ö¶sÃѧO½X©Î¿ï¶µÃѧO½X¡^¨Ó½T©w¨Ï¥ÎªÌ¾Þ§@ªº¬O¿ï¶µÁÙ¬O«ö¶s¡C

chg_lng °Æµ{¦¡

¨¥Âk¥¿¶Ç¡A¦^¨ì¦p¦ó§â¥\¯àªí¤Wªº¿ï¶µ¤å¦r¤Î±±¨î¶µ¤å¦r³£´«¦¨¨ä¥L»y¨¥¤å¦r¡C

­n§ó§ï¿ï¶µ¤å¦r¡A¤èªk¬O©I¥s SetMenuItemInfo¡ASetMenuItemInfo ªº¸Ô²Ó¥Îªk½Ð°Ñ¾\²Ä¤Q¤K³¹¡A³o¨à²³æ§ã­nªº»¡¡A¹ï©ó MULN1 ¥u¶·³]©w MENUITEMINFO µ²ºcÅ餤ªº¤T­ÓÄæ¦ì§Y¥i¡G①§â cbSize Äæ¦ì¬° MENUITEMINFO µ²ºcÅ馳¦h¤Ö¦ì¤¸²Õ¡C②§â fMask Äæ¦ì¬° MIIM_STRING¡AWinInc ¯Ê¤Ö«Å§i¦¹±`¼Æ¤§­È¡A¦ý¬d¾\ºô¸ô¥i§ä¨ì¦¹¼Æ¬° 40h¡C③§â dwTypeData Äæ¦ì³]¬°­nÅܧó¤å¦rªº¦r¦ê¦ì§}¡A¦¹¦ì§}´N¬O buffer1 ªº¦ì§}¡ALoadString ¥Ñ¸ê·½¸ü¤Jªº¦r¦ê±N¦s©ó¦¹¦ì§}¡C³o¤T¨BÆJ¨£²Ä 53¡ã56¡A³]©w¦n¤§«á¡AMENUITEMINFO µ²ºcÅé´N¤£»Ý§ïÅÜ¡A§ïÅܪº¬O buffer1 ¤ºªº¦r¦ê¤º®e¡C

±q¸ê·½ªº¦r¦êªí¤¤¸ü¤Jªº¦r¦ê¡A¦s¤J buffer1 ¤º¡A³o¹Lµ{­n©I¥s LoadString¡CLoadString ªº²Ä¤G­Ó°Ñ¼Æ¬O¸ê·½¦r¦êªí¤¤ªº¦r¦êÃѧO½X¡A¥Î°Ï°ìÅÜ¼Æ id ªí¥Ü¡A¦b²Ä 57¡B58 ¨â¦æ¤w§â lng ¦s¤J id¡C

chg_lng »Ý­n§ïÅܪº¿ï¶µ¤å¦r¦³¤»¶µ¡A³o¤»¶µªº¦r¦êÃѧO½X±Æ¦¨³sÄòªº¥¿¾ã¼Æ¡A©Ò¥H¥u­nª¾¹D°_©lªº¦r¦êÃѧO½X¡A¨C³B²z§¹¤@­Ó¿ï¶µ«á¡A¨Ï id ¼W¥[¤@¡A´N¯à¸ü¤J¤U­Ó¦r¦ê¤F¡C¨£²Ä 59¡ã75 ¦æ¡C¦Ü©ó§ó´««ö¶s¤Wªº¤å¦r¡A¤]¬O¤@¼Ëªº¹D²z¡A´N¤£ÂØ­z¡C

MULN1 ´N¤¶²Ð¨ì³o¨à¡A©³¤U»¡©ú¦b MULN1 ¤¤·sªº«ü¥O©Î¨ç¦¡¡C

wcscat »P strcat

wcscat ¥\¥Î¬O¦X¨Ö¦r¦ê¡A¥¦¨Ã¤£¬O Win64 API¡A¦Ó¬O C »y¨¥µ{¦¡®w¤º«Øªº¼Ð·Ç¨ç¦¡¡A©Ò¥H¦pªGÀ³¥Îµ{¦¡¤¤­n©I¥s¥¦¡A­n¥ý¤Þ¤J MSVCRT.LIB ¨ç¦¡®w¡Cwcscat ¤¤ªº wc ¬O wide character ªº·N«ä¡A¥¦ªº­ì«¬¬O¡G

invoke  wcscat,\
        pDestination,\  ; Null-terminated destination string
        pSource         ; Null-terminated source string

pDestination ¬O¥Øªº¦r¦êªº¦ì§}¡ApSource ¬O¨Ó·½¦r¦êªº¦ì§}¡A³o¨â­Ó¦r¦ê³£¥²¶·¥H¹sµ²§À¡A¦Ó¥B¨ä¦r¤¸¤]³£¥²¶·¥H¸U°ê½X½s½X¡Cwcscat ·|¦b pDestination ¦ì§}¤Wªº¥Øªº¦r¦ê§ÀºÝ¡]µ²§Àªº¹s«eªº¤@­Ó¦ì§}¡^¡A¶ñ¤W¨Ó·½¦r¦ê¡A¹F¨ì¦X¨Ö¦r¦êªº¥\¯à¡C

strcat ¥Î¨Ó§â¨â­Ó¦r¦ê³s±µ°_¨Ó¡Astrcat ªº¨Ï¥Î¤è¦¡³£¸ò wcscat ¤@¼Ë¡A¥u¬O strcat ¬O ANSI ª©¥»¡A¤]´N¬O»¡ strcat ¥u¯à³B²z ASCII ¦r¤¸©Ò²Õ¦¨ªº¦r¦ê¡C©I¥s³o¨â­Ó¨ç¦¡¤§«e¡A¶·ª`·N pDestination ©Ò«ü¦ì§}¤Wªº¦r¦ê¤§«á¡A¥²¶·¦³¨¬°÷ªºªÅ¶¡¥i®e¯Ç¨Ó·½¦r¦ê¡A§_«h«Ü®e©öÂл\¨ä«áªº¸ê®Æ¡A¦Óµo¥Í¿ù»~¡AÄY­«¬Æ¦Ü¤Þµo·¸¦ì¿ù»~¡C

RV ¥¨¶°¨ç¦¡

RV ¬O UASM64 ¤º«Øªº¥¨¶°¨ç¦¡¡A¦]¬° Windows À³¥Îµ{¦¡¤¤ªº¥¨¶°¦WºÙ·|°Ï¤À¤j¤p¼g¡A©Ò¥H RV ¤]¥²¶·³£¥Î¤j¼g¡A§_«h·|µo¥Í¿ù»~¡CRV ¬O¦^¶Ç­È¡]return value¡^ªº·N«ä¡A¥¦¥Î©ó¦b©I¥s¨ç¦¡¤§«á¡A§â¦^¶Ç­È¦s©ó RAX ¼È¦s¾¹¤¤¡A¦Ó¥i¥Hª½±µ»P¥t¤@«ü¥O·f°t¡C¥¦ªº»yªk¬O¡G

RV(¨ç¦¡¦WºÙ, °Ñ¼Æ¦Cªí)

·íµM¶È¶È¦p¦¹ÁÙ¤£¬O§¹¾ãªº«ü¥O¡A¥u¬O«ü¥Oªº¤@³¡¥÷¡C·Ç½T¦a»¡¥²¶·§â¾ã­Ó¡uRV(¨ç¦¡¦WºÙ, °Ñ¼Æ¦Cªí)¡vµø¬° RAX ¹Bºâ¤¸¡A¦A»P«ü¥O¨ä¥L³¡¤À·f°t¡C¨Ò¦p­n¨ú±o¼Ò²Õ¥N½X¡A¥»¨Ó¬O¼g¦¨¤U­±ªº¼Ë¤l

invoke  GetModuleHandle,0
mov     hInst,rax

¦pªG¨Ï¥Î RV ¥¨¶°¨ç¦¡¡A¥i¥H¼g¦¨¤@¦æ¡A§â RV(GetModuleHandle,0) ¬Ý¦¨¬O RAX¡G

mov     hInst,RV(GetModuleHandle,0)

RV °£¤F»P x86 «ü¥O¡A¹³ MOV¡BADD¡K¡K·f°t¤§¥~¡A¤]¥i¥H¥Î¦b .if/.endif¡B.while/.endw¡K¡K©Î invoke °²«ü¥O¡C¨Ò¦p­n³]©wµøµ¡¼ÐÃDÄ楪Ã䪺¹Ï¥Ü¡A¤@¯ë¬O¼g¦¨¹³©³¤Uªºµ{¦¡¡A»Ý­n¨â¦æµ{¦¡½X¡G

invoke  LoadIcon,hInst,IDI_APPLICATION
invoke  SendMessage,hDlg,WM_SETICON,ICON_SMALL,rax

¦pªG§ï¥Î RV ¥¨¶°¡A´NÅܦ¨¤@¦æ¡A¦p¤U¡G

invoke  SendMessage,hDlg,WM_SETICON,ICON_SMALL,RV(LoadIcon,hInst,IDI_APPLICATION)

«á°O

¥»³¹´N¤¶²Ð¨ì³o¨à¡A¤w¸gªì¨B¤¶²Ð¤F¸U°ê½X¡A¥H¤Î¦p¦ó¦b²Õ¦X»y¨¥¤¤¡A¹ï¥Ñ­^¤å¡Bªü©Ô§B¼Æ¦r²Õ¦¨ªº¦r¤¸¥H¸U°ê½X¤è¦¡½s½X¡C¤U¤@³¹±N¤¶²Ð¨Ï¥Î¤¤¤åªº¸U°ê½X½s½X¤è¦¡²£¥Í¦r¦ê¡A³o¤]¥i¥HÂX¥R¦ÓÀ³¥Î¨ì¨ä¥L»y¨¥ªº¤å¦r¡C

«e¤@³¹¥H¤Î¥»³¹Á`¦@¤¶²Ð¤F¤T­Ó C »y¨¥ªº¼Ð·Ç¨ç¦¡¡Asprintf¡Bwcscat¡Bstrcat¡A¦A¥[¤W²Ä¥|³¹¤¶²Ðªº wsprintf¡A³o¥|­Ó¨ç¦¡³£¨S¦³­­©w½w½Ä°Ï¤j¤p¡A¬Y¨Ç±¡ªp·|¦³½w½Ä°Ï·¸¦ì¤Wªº¦w¥þ°ÝÃD¡A¦]¦¹³\¦h¤åÄm¡A¥]§t MSDN ³£«Øij¤£­n¨Ï¥Î³o¨Ç¨ç¦¡¡C·L³n¦­¤w·Ç³Æ¦n¤@¨Ç Win64 API ¨ç¦¡¥i¨Ñ¨Ï¥Î¡A¦ý»Ý­n¾ã²z¡Aµ¥¤p¤ì°¸¾ã²z¦n¦A²K¥[¨ì¬Y­Óªþ¿ý¤¤§a¡C