1
0
kolibrios/data/rus/docs/STACK_RU.TXT
CleverMouse f28b4ac95f data for build system
git-svn-id: svn://kolibrios.org@1737 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-17 12:21:18 +00:00

379 lines
13 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

—â® ®áãé¥á⢫¥­®
==================
‘«¥¤ãî騥 ®á®¡¥­­®á⨠¯à¨áãâáâ¢ãîâ ¢ ª®¤¥ TCP/IP á⥪ :
“஢¥­ì IP.
ICMP.
“஢¥­ì TCP.
“஢¥­ì UDP.
‹®ª «ì­ë© ¢®§¢à â 横« .
Realtek 8029 ¨­â¥à䥩ᮢ á¥â¨ áâ ­¤ àâ  Ethernet PCI.
Realtek 8139 ¨­â¥à䥩ᮢ á¥â¨ áâ ­¤ àâ  Ethernet PCI.
Intel i8255x PCI ¨­â¥à䥩á á¥â¨ áâ ­¤ àâ  Ethernet.
„¨­ ¬¨ç¥áª ï â ¡«¨æ  ¯à®â®ª®«  ®¯à¥¤¥«¥­¨ï  ¤à¥á®¢.
Point-to-point ¯à®â®ª®«(PPP)
ˆ á«¥¤ãî騥 ˆ­â¥à­¥â ¯à®£à ¬¬ë:
HTTP á¥à¢¥à
POP ª«¨¥­â
Telnet
DNS Name resolver
Mp3 á¥à¢¥à
TFTP ª«¨¥­â
IRC ª«¨¥­â
FTP ª«¨¥­â
PPP - §¢®­¨«ª 
…áâì àï¤ íªá¯¥à¨¬¥­â «ì­ëå ¯à¨«®¦¥­¨© ¤«ï ¯à®¨£à뢠­¨ï ¯®â®ª®¢®© ¬ã§ëª¨ ¨
¢ë¯®«­¥­¨ï ¢§ ¨¬®¤¥©áâ¢¨ï ¯à®æ¥áᮢ ç¥à¥§ ᮪¥âë. ’ ª¦¥ ¥áâì ¯à®á⥭쪨©
¡à ã§¥à, ¯®§¢®«ïî騩 « §¨âì ¯® ¢á¥¬¨à­®© ¯ ã⨭¥(WWW).
—â® ­¥ ®áãé¥á⢫¥­®
===================
“஢¥­ì IP ­¥ ®¡à ¡ â뢠¥â ®¯æ¨¨ § £®«®¢ª .
“஢¥­ì IP ­¥ ¯®¤¤¥à¦¨¢ ¥â ¬ àèàã⨧ æ¨î.
”à £¬¥­â æ¨ï ¯ ª¥â  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï.
Š®­ä¨£ãà æ¨ï PPP ¢ Š®«¨¡à¨
===========================
‘¬®âà¨â¥ ppp.txt(¨«¨ ppp_rus.txt á àãá᪨¬ ¯¥à¥¢®¤®¬)
Š ª ᪮­ä¨£ãà¨à®¢ âì Š®«¨¡à¨ ¤«ï «®ª «ì­®© á¥â¨
==============================================
„«ï ­ ç «  ã ¢ á ¤®«¦­  ¡ëâì á¥â¥¢ ï ª àâ  áâ ­¤ àâ  Ethernet ¨«¨, ¥á«¨ ¥ñ ­¥â,
¢áâ஥­­ãî ¢ ¢ èã á¨á⥬­ãî ¯« âã. …᫨ ¢ë, ­¥ §­ ¥â¥, ¥áâì «¨ ã ¢ á á¥â¥¢ ï
ª àâ , â® ¯à®¡ã©â¥ ᪮­ä¨£ãà¨à®¢ âì á⥪. …᫨ ®­  ¥áâì ¨ ¯®¤¤¥à¦¨¢ ¥âáï, â®
ᬮ¦¥â¥ ¨á¯®«ì§®¢ âì ¥ñ.
“áâ ­®¢ª  â ¡«¨æë ¯à®â®ª®«  ®¯à¥¤¥«¥­¨ï  ¤à¥á®¢
-----------------------------------------------
’ ¡«¨æ  ¯à®â®ª®«  ®¯à¥¤¥«¥­¨ï  ¤à¥á®¢ ¢ Š®«¨¡à¨ 㦥 ¤¨­ ¬¨ç¥áª¨ ᮧ¤ ­  ¨
᪮­ä¨£ãà¨à®¢ ­­ . ‚ë ¬®¦¥â¥ ¯®á¬®âà¥âì, á ª ª¨¬¨ ª®¬¯ìîâ¥à ¬¨ Š®«¨¡à¨ à ¡®â ¥â,
¢ë¯®«­¨¢ ¯à¨«®¦¥­¨¥ ARPSTAT.
<EFBFBD>®¤ª«î祭¨¥ ª «®ª «ì­®© á¥â¨
---------------------------
‡ £à㧨⥠Š®«¨¡à¨, § â¥¬ ¢ë¡¥à¨â¥ STACKCFG(ª®­ä¨£ãà æ¨ï á⥪ ) ¢ ¬¥­î NET(á¥âì).
<EFBFBD> ¦¬¨â¥ Š­®¯ªã '—⥭¨ï', § â¥¬ ¢ë¡¥à¨â¥ '„à ©¢¥à <20> ª¥â '.
<EFBFBD> ¦¬¨â¥ "Change"(¢ë¡®à) à冷¬ á  ¤à¥á®¬ IP, ¨ ¢¢¥¤¨â¥ ­ã¦­ë© IP, ª®â®àë© ¢ë
å®â¨â¥ ¨á¯®«ì§®¢ âì. “¤®á⮢¥àìâ¥áì, çâ® ®­ ­ å®¤¨âáï ¢ ⮩ ¦¥ á ¬®© ¯®¤á¥â¨,
çâ® ¨ á ¬  «®ª «ì­ ï á¥âì, ª ª®â®à®© ¢ë ¯®¤ª«î祭ë. <20> ¦¬¨â¥ "Apply"(¯à¨¬¥­¨âì)
¤«ï ¯®¤â¢¥à¦¤¥­¨ï ¨§¬¥­¥­¨©.
‡ ªà®©â¥ ¯à®£à ¬¬ã.
‘⥪ ᪮­ä¨£ãà¨à®¢ ­ ¨ § ¯ã饭. ‚ë ¬®¦¥â¥ ¯à®¢¥à¨âì ¥£® à ¡®âã, ¯à®¯¨­£®¢ ¢
Š®«¨¡à¨ á 㤠«¥­­®£® ª®¬¯ìîâ¥à .
‘ ¬ë© ¯à®á⮩ ᯮᮡ ¯®¤ª«îç¨âì ¤¢  PC ¢¬¥á⥠- íâ® ¨á¯®«ì§®¢ âì ­ã«¥¢®¥
¬®¤¥¬­®¥ ᮥ¤¨­¥­¨¥. <20>â® ®¡ëç­®¥ ᮥ¤¨­¥­¨¥ ª®¬¯ìîâ¥à®¢ ¯®á।á⢮¬ ª ¡¥«ï. Ž­¨
¬®£ãâ ¡ëâì ªã¯«¥­ë ¢¬¥áâ¥ á ¯ ¬ïâìî ¨«¨ ¯à®á⮠ᤥ« ­ë. <20>®¤à®¡­®á⨠¬®¦­® ­ ©â¨
¢ ˆ­â¥à­¥â¥. ˆé¨â¥ ­  ¯®¨áª®¢¨ª å, (­ ¯à¨¬¥à www.gogle.ru) ¢¢¥¤ï ¢ áâபã
¯®¨áª : '®à£ ­¨§ æ¨ï ᮥ¤¨­¥­¨ï ª®¬¯ìîâ¥à®¢ á ¯®¬®éìî ª ¡¥«ï' ¨«¨ ¯®¤®¡­ë¥.
Š ª ¨á¯®«ì§®¢ âì TCP/IP ¡¥§ ¯®¤ª«î祭¨ï ª á¥â¨
=============================================
Š®«¨¡à¨ ¯®¤¤¥à¦¨¢ ¥â ä®à¬ã «®ª «ì­®£® ¢®§¢à â  横« ,   íâ® §­ ç¨â, çâ®
¯à¨«®¦¥­¨ï ­  ®¤­®¬ ¨ ⮬ ¦¥ á ¬®¬ PC ¬®£ãâ ®¡é âìáï ¤àã£ á ¤à㣮¬ ç¥à¥§
᮪¥âë, ª ª ¥á«¨ ¡ë ®­¨ ­ å®¤¨«¨áì ­  㤠«ñ­­ëå ª®¬¯ìîâ¥à å. —⮡ë ᮥ¤¨­ïâìáï
á ¯à¨«®¦¥­¨¥¬ ­  «®ª «ì­®© ¬ è¨­¥, ®¯à¥¤¥«¨â¥ «®ª «ì­ë©  ¤à¥á IP ª ª  ¤à¥á
­ §­ ç¥­¨ï. ‚ë ¤ ¦¥ ­¥ ¤®«¦­ë ª®­ä¨£ãà¨à®¢ âì á⥪ ¤«ï á¥â¨ áâ ­¤ àâ  Ethernet,
«®ª «ì­ë© ¢®§¢à â 横«  ¡ã¤¥â à ¡®â âì ¡¥§ «î¡ëå á¥â¥¢ëå,  ¯¯ à â­ëå á।áâ¢.
•®à®è® ¯®¤å®¤¨â ¤«ï ¯à®¢¥àª¨ ¨ ®â« ¤ª¨ á¥â¥¢ëå ¯à¨«®¦¥­¨©.
<EFBFBD>ਪ« ¤­®© ¯à®£à ¬¬­ë© ¨­â¥à䥩á
================================
<EFBFBD> §à ¡®â稪 ¬®¦¥â ®¡à â¨âìáï ª á⥪ã ç¥à¥§ ¯à¥à뢠­¨¥ 0x40, ä㭪樨 53. ” ©«
TFTPC.ASM - å®à®è¨© ¯à¨¬¥à ⮣®, ª ª ¬®¦­® ¨á¯®«ì§®¢ âì ¯à®£à ¬¬­ë© ¨­â¥à䥩á
(¯® ªà ©­¥© ¬¥à¥, ¤«ï UDP), ­® ª ª á¥â¥¢ ï ª®¬¬ã­¨ª æ¨ï, ¤®¢®«ì­® á«®¦¥­. Ÿ ¤ ¬
ªà âª¨© ®¡§®à.
‘®ª¥âë
=======
<EFBFBD>ਫ®¦¥­¨ï ᮥ¤¨­ïîâáï ¤àã£ á ¤à㣮¬ ¨ ¯¥à¥¤ îâ ¨­ä®à¬ æ¨î ¬¥¦¤ã ᮡ®© ç¥à¥§
¬¥å ­¨§¬, ­ §¢ ­­ë© '᮪¥â®¬'. ‘®ª¥âë - ®ª®­¥ç­ë¥ â®çª¨ ¤«ï ª®¬¬ã­¨ª æ¨¨. „«ï
ª ¦¤®£® ­ã¦­®£® á¥â¥¢®£® ¯à¨«®¦¥­¨ï ¤®«¦¥­ ¡ëâì ®âªàëâ å®âï ¡ë ®¤¨­ ᮪¥â.
ˆá¯®«ì§®¢ ­¨¥ ᮪¥â®¢ ­¥¬­®£® ¯®å®¤¨â ­  ¨á¯®«ì§®¢ ­¨ï ä ©«®¢ ¢ Ž‘. ‚ë
®âªà뢠¥â¥, ç¨â ¥â¥ ¨ ¯¨è¥â¥ ¢ ­¨å, § â¥¬ § ªà뢠¥â¥. …¤¨­á⢥­­ ï ¢¥éì,
ª®â®à ï ¤¥« ¥â ¦¨§­ì ­¥¬­®£® ¡®«¥¥ á«®¦­®© - íâ® â®, çâ® ¢ ®â«¨ç¨¥ ®â à ¡®âë á
ä ©« ¬¨, ã ¢ á ¯®ï¢¨âáï âà㤭®á⨠á à ¡®â®© ᮪¥â®¢ (­ ¯à¨¬¥à, ­¥ § å®ç¥â
§ ªà뢠âìáï)
<EFBFBD>®§­ ª®¬¨¬áï á â¥à¬¨­®«®£¨¥© ¯à¥¦¤¥, 祬 ¬ë ¯®©¤ñ¬ ¤ «ìè¥.
*‘®ª¥â “­¨ª «ì­ë© ¨¤¥­â¨ä¨ª â®à, ¨á¯®«ì§ã¥¬ë© ¯à¨«®¦¥­¨¥¬ ¤«ï
ª®¬¬ã­¨ª æ¨¨.
*‹®ª «ì­ë© ¯®àâ —¨á«®, ª®â®à®¥ ¨¤¥­â¨ä¨æ¨àã¥â ­ã¦­®¥ ¯à¨«®¦¥­¨¥ ­ 
«®ª «ì­®¬ ª®¬¯ìîâ¥à¥. <20>®àâë - ᯮᮡ, ¯®§¢®«ïîé¨å ¬­®¦¥á⢠¬ ¯à¨«®¦¥­¨©
®¡é âìáï á ¤à㣨¬¨ ª®¬¯ìîâ¥à ¬¨, ¡« £®¤ àï 祬㠭¥â ¯ãâ ­¨æë ¢ ¯¥à¥¤ ¢ ¥¬ëå
¤ ­­ëå (’¥å­¨ç¥áª®¥ ®¯à¥¤¥«¥­¨¥ '¬ã«ì⨯«¥ªá­ë¥'). —¨á«® ¯®àâ  - 16 ¡¨â.
*“¤ «ñ­­ë© ¯®àâ —¨á«®, ª®â®à®¥ ¨¤¥­â¨ä¨æ¨àã¥â ¯à¨«®¦¥­¨¥ ­  㤠«ñ­­®¬
ª®¬¯ìîâ¥à¥, ª ª®â®à®¬ã ¬ë ®¡à é ¥¬áï. <20>  㤠«ñ­­®¬ ª®¬¯ìîâ¥à¥ - íâ® '«®ª «ì­ë©
¯®àâ'. —¨á«® ¯®àâ  - 16 ¡¨â.
*€¤à¥á IP <20>â® 32 ¡¨â­®¥ ç¨á«®, ª®â®à®¥ ¨¤¥­â¨ä¨æ¨àã¥â 㤠«ñ­­ë© PC,
á ª®â®àë¬ ¬ë ®¡é ¥¬áï.
*<2A> áᨢ­ë© ०¨¬ <20>⮠०¨¬, ¢ ª®â®à®¬ ᮪¥â ®âªàëâ,   «®ª «ì­ë© PC ¦¤ñâ
ᮥ¤¨­¥­¨ï.
*€ªâ¨¢­ë© ०¨¬ <20>⮠०¨¬, ¢ ª®â®à®¬ ᮪¥â ®âªàëâ,   «®ª «ì­ë© PC ¯ëâ ¥âáï
ᮥ¤¨­¨âìáï á 㤠«ñ­­ë¬ PC.
‘®¥¤¨­ïïáì á ᮪¥â®¬ ­  㤠«¥­­®¬ PC, ¢ë ¤®«¦­ë ­¥ ⮫쪮 ®¯à¥¤¥«¨âì IP  ¤à¥á,
­® ¨ ¯®«­®áâìî ª¢ «¨ä¨æ¨à®¢ âì ¥£®, â.¥. ®¯à¥¤¥«¨âì IP  ¤à¥á ¨ ç¨á«® ¯®àâ .
ˆ­ ç¥ á⥪ ­  㤠«ñ­­®¬ PC ­¥ ¡ã¤¥â §­ âì, ª ª®¬ã ¯à¨«®¦¥­¨î ¯à¥¤­ §­ ç îâáï
¯®á« ­­ë¥ ¤ ­­ë¥. ‚®â ­¥¡®«ì让 ¯à¨¬¥à:
192.168.1.10:80 ;Œë ¯à¨á®¥¤¨­ï¥¬áï ª ª®¬¯ìîâ¥àã á IP  ¤à¥á®¬ 192.168.1.10 ª
80 ¯®àâã.
—¨á«  ¯®àâ  ï¢«ïîâáï ¢ ¦­ë¬¨. <20>¥ª®â®àë¥ '¨§¢¥áâ­ë' ¨ ®¡¥á¯¥ç¨¢ îâ ¤®áâ㯠ª
®¡é¨¬ ¯à¨«®¦¥­¨ï¬. <20> ¯à¨¬¥à, ¯®àâ 80 ¨á¯®«ì§ã¥âáï á¥à¢¥à ¬¨ £¨¯¥à⥪á⮢®£®
â࠭ᯮàâ­®£® ¯à®â®ª®« (HTTP). ’ ª¨¬ ¯ãâñ¬ ï ¬®£ã ᮥ¤¨­¨âìáï á ¢¥¡á¥à¢¥à®¬ ­ 
­ã¦­®¬ ª®¬¯ìîâ¥à¥ ¡¥§ ­¥®¡å®¤¨¬®á⨠㧭 ¢ âì ¯à®á«ã訢 ¥¬ë© ¯à¨«®¦¥­¨¥¬ ­®¬¥à
¯®àâ .
Š ª ¢ë §­ ¥â¥, ¥áâì ¤¢  ०¨¬ : <20> áᨢ­ë© ¨ €ªâ¨¢­ë©. ‚¥¡á¥à¢¥à ®âªàë«
¯ áᨢ­ë© ᮪¥â, ¯®áª®«ìªã ®­ ¦¤¥â ¢å®¤ïé¨å § ¯à®á®¢ ­  ¯®¤ª«î祭¨¥.
Web-¡à®ã§¥à ®âªàë«  ªâ¨¢­ë© ᮪¥â, ¯®â®¬ã çâ® ®­ ¯ëâ ¥âáï ᮥ¤¨­¨âìáï á
㪠§ ­­ë¬ 㤠«ñ­­ë¬ ª®¬¯ìîâ¥à®¬.
„®áâ㯠ª ¯à®£à ¬¬¨à®¢ ­¨î ¨­â¥à䥩á 
====================================
<EFBFBD> §à ¡®â稪 ®¡à é ¥âáï ª äã­ªæ¨ï¬ á⥪  ç¥à¥§ ¯à¥à뢠­¨¥ 0x40, ä㭪樨 53. Š
­¥ª®â®àë¬ äã­ªæ¨ï¬ ¬®¦­® ®¡à â¨âìáï ç¥à¥§ äã­ªæ¨î 52, ­® ®­¨ £« ¢­ë¬ ®¡à §®¬
¯à¥¤­ §­ ç¥­ë ¤«ï ª®­ä¨£ãà æ¨¨ á⥪ .
‚®â ä㭪権, ª®â®àë¥ ¢ë ¬®¦¥â¥ ¨á¯®«ì§®¢ âì:
<EFBFBD>®«ãç ¥¬ «®ª «ì­ë© IP  ¤à¥á
---------------------------
eax = 52
ebx = 1
IP  ¤à¥á ¢®§¢à â¨«áï ¢ eax (¢ ¢¨¤¥ ¡ ©â®¢, ¨§ ª®â®àëå á®á⮨⠈­â¥à­¥â  ¤à¥á)
‡ ¯¨áì ¤«ï à á¯®«®¦¥­¨ï ¢ á⥪¥ ¢å®¤­®© ®ç¥à¥¤¨
-----------------------------------------------
eax = 52
ebx = 6
edx = ç¨á«® ¡ ©â®¢ ¤«ï § ¯¨á¨
esi = 㪠§ â¥«ì ­  ¤ ­­ë¥ (¢ ¯à¨ª« ¤­®¬ ¯à®áâà ­á⢥)
<EFBFBD>® ¢®§¢à é¥­¨î, ¢ eax ᮤ¥à¦¨âáï 0, ¥á«¨ OK, ¨«¨ 0xFFFFFFFF, ¥á«¨ ®è¨¡ª .
<EFBFBD>â®â ¨­â¥à䥩á - ⮫쪮 ¤«ï ¬¥¤«¥­­ëå á¥â¥¢ëå ¤à ©¢¥à®¢ (PPP, SLIP)
—⥭¨¥ ¤ ­­ëå ¨§ á¥â¥¢®© ®ç¥à¥¤¨ ¢ë¢®¤ 
---------------------------------------
eax = 52
ebx = 8
esi = 㪠§ â¥«ì ­  ¤ ­­ë¥ (¢ ¯à¨ª« ¤­®¬ ¯à®áâà ­á⢥)
<EFBFBD>® ¢®§¢à é¥­¨î, eax áç¨â ¥â ç¨á«® ¡ ©â®¢ ¯¥à¥¤ ­­ë¬.
<EFBFBD>â®â ¨­â¥à䥩á - ⮫쪮 ¤«ï ¬¥¤«¥­­ëå á¥â¥¢ëå ¤à ©¢¥à®¢ (PPP, SLIP)
Žâªà뢠¥¬ UDP ᮪¥â
-------------------
eax = 53
ebx = 0
ecx = «®ª «ì­ë© ¯®àâ
edx = 㤠«¥­­ë© ¯®àâ
esi = 㤠«¥­­ë© ip  ¤à¥á (¢ ¢¨¤¥ ¡ ©â®¢, ¨§ ª®â®àëå á®á⮨⠈­â¥à­¥â  ¤à¥á)
<EFBFBD>®¬¥à ᮪¥â  ¢®§¢à éñ­ ¢ eax.
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥ 0xFFFFFFFF ®§­ ç ¥â, ç⮠᮪¥âë ­¥ ®âªà뫨áì.
Žâªà뢠¥¬ TCP ᮪¥â
-------------------
eax = 53
ebx = 5
ecx = «®ª «ì­ë© ¯®àâ
edx = 㤠«¥­­ë© ¯®àâ
esi = 㤠«¥­­ë© ip  ¤à¥á (¢ ¢¨¤¥ ¡ ©â®¢, ¨§ ª®â®àëå á®á⮨⠈­â¥à­¥â  ¤à¥á)
edi = ०¨¬: SOCKET_PASSIVE ¨«¨ SOCKET_ACTIVE (®¯à¥¤¥«ñ­ ¢ stack.inc)
<EFBFBD>®¬¥à ᮪¥â  ¢®§¢à é ¥âáï ¢ eax.
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥ 0xFFFFFFFF ®§­ ç ¥â, ç⮠᮪¥âë ­¥ ®âªà뫨áì.
‡ ªàë⨥ ᮪¥â  (’®«ìª® UDP)
----------------------------
eax = 53
ebx = 1
ecx = ­®¬¥à ᮪¥â 
<EFBFBD>® ¢®§¢à é¥­¨î, ¢ eax ᮤ¥à¦¨âáï 0, ¥á«¨ OK, ¨«¨ 0xFFFFFFFF, ¥á«¨ ®è¨¡ª .
‡ ªàë⨥ ᮪¥â  (’®«ìª® TCP)
----------------------------
eax = 53
ebx = 8
ecx = ç¨á«® ᮪¥â 
<EFBFBD>® ¢®§¢à é¥­¨î, ¢ eax ᮤ¥à¦¨âáï 0, ¥á«¨ OK, ¨«¨ 0xFFFFFFFF, ¥á«¨ ®è¨¡ª .
Ž¯à®á ᮪¥â 
-------------
eax = 53
ebx = 2
ecx = ­®¬¥à ᮪¥â 
<EFBFBD>® ¢®§¢à é¥­¨î, eax á®åà ­ï¥â ç¨á«® ¡ ©â®¢ ¢ ¢®§¢à éñ­­®¬ ¡ãä¥à¥.
—⥭¨¥ ¤ ­­ëå á ᮪¥â 
----------------------
eax = 53
ebx = 3
ecx = ç¨á«® ᮪¥â 
<EFBFBD>® ¢®§¢à é¥­¨î, eax ᮤ¥à¦¨â ç¨á«® á®åà ­ñ­­ëå ¡ ©â, bl ᮤ¥à¦¨â ¡ ©â ¤ ­­ëå.
‡ ¯¨áì ¢ ᮪¥â (’®«ìª® UDP)
---------------------------
eax = 53
ebx = 4
ecx = ç¨á«® ᮪¥â 
edx = ç¨á«® ¡ ©â®¢ ¤«ï § ¯¨á¨
esi = 㪠§ â¥«ì ­  ¤ ­­ë¥ (¢ ¯à¨ª« ¤­®¬ ¯à®áâà ­á⢥)
<EFBFBD>® ¢®§¢à é¥­¨î, ¢ eax ᮤ¥à¦¨âáï 0, ¥á«¨ OK, ¨«¨ 0xFFFFFFFF, ¥á«¨ ®è¨¡ª .
‚®§¢à é¥­¨¥ á®áâ®ï­¨ï ᮪¥â  (’®«ìª® TCP)
-----------------------------------------
eax = 53
ebx = 6
ecx = ­®¬¥à ᮪¥â 
<EFBFBD>® ¢®§¢à é¥­¨î, ¢ eax ᮤ¥à¦¨âáï á®áâ®ï­¨¥ TCP ᮪¥â®¢.
<EFBFBD>â  äã­ªæ¨ï ¬®¦¥â ¨á¯®«ì§®¢ âìáï, çâ®¡ë ®¯à¥¤¥«¨âì, ª®£¤  ᮪¥â ä ªâ¨ç¥áª¨
ᮥ¤¨­¨«áï á ¤à㣨¬ ᮪¥â®¬. ‚®®¡é¥, ¤ ­­ë¥ ­¥ ¬®£ãâ ¡ëâì § ¯¨á ­ë ¢ ᮪¥â,
¯®ª  ¯®¤ª«î祭¨¥ ­¥ ãáâ ­®¢«¥­® (TCB_ESTABLISHED). ‘®áâ®ï­¨ï ᮪¥â®¢ ®¯à¥¤¥«¥­ë
¢ ä ©«¥ stack.inc, ª ª TCB_
‡ ¯¨áì ¢ ᮪¥â (’®«ìª® TCP)
---------------------------
eax = 53
ebx = 7
ecx = ­®¬¥à ᮪¥â 
edx = ç¨á«® ¡ ©â, ­ã¦­ëå ¤«ï § ¯¨á¨
esi = 㪠§ â¥«ì ­  ¤ ­­ë¥ (¢ ¯à¨ª« ¤­®¬ ¯à®áâà ­á⢥)
<EFBFBD>® ¢®§¢à é¥­¨î, ¢ eax ᮤ¥à¦¨âáï 0, ¥á«¨ OK, ¨«¨ 0xFFFFFFFF, ¥á«¨ ®è¨¡ª .
<EFBFBD>஢¥àª  ­®¬¥à  ¯®àâ 
---------------------
eax = 53
ebx = 9
ecx = ­®¬¥à ¯®àâ 
<EFBFBD>â  äã­ªæ¨ï ¨á¯®«ì§ã¥âáï, çâ®¡ë ®¯à¥¤¥«¨âì, ¨á¯®«ì§ã¥âáï «¨ ­®¬¥à ¯®àâ  ª ª¨¬¨
- «¨¡® ᮪¥â ¬¨. ‹®ª «ì­ë© ­®¬¥à ¯®àâ  ®¡ëç­® ã­¨ª «¥­.
<EFBFBD>® ¢®§¢à é¥­¨î, eax = - 1 ¤«ï ­®¬¥à  ¯®àâ , ª®â®àë© ¨á¯®«ì§ã¥âáï, ¨­ ç¥
¢®§¢à é ¥âáï 0.
Žâªàë⨥ TCP ᮪¥â  ¢ Š®«¨¡à¨
=============================
…áâì ¤¢  ᯮᮡ  ®âªàëâ¨ï ᮪¥â  - <20> áᨢ­ë© ¨«¨ €ªâ¨¢­ë©.
<EFBFBD>ਠ<20> áᨢ­®¬ ¯®¤ª«î祭¨¨, ¯à¨«®¦¥­¨¥ 'á«ãè ¥â' ¢å®¤ï騥 § ¯à®áë ®â 㤠«¥­­ëå
¯à¨«®¦¥­¨©. Ž¡ëç­® ¢ë íâ® ¤¥« ¥â¥, ®áãé¥á⢫ïï ®¯¥à æ¨î ª«¨¥­â - á¥à¢¥à. Ž­ 
¯®§¢®«ï¥â «î¡®¬ã ¤à㣮¬ã ¯à¨«®¦¥­¨î ᮥ¤¨­ïâìáï á ¤ ­­ë¬. „«ï í⮣® ­ã¦­®
®¯à¥¤¥«¨âì '¨§¢¥áâ­ë©' ­®¬¥à «®ª «ì­®£® ¯®àâ  (80 ¤«ï ‚¥¡-á¥à¢¥à ), ¯®áâ ¢¨âì
㤠«¥­­ë© IP ¨ 㤠«¥­­®¥ ­®¬¥à ¯®àâ  à ¢­ë¬ 0(㪠§ë¢ ¥â, çâ® «î¡®¥ 㤠«¥­­®¥
¯à¨«®¦¥­¨¥ ¬®¦¥â ᮥ¤¨­¨âìáï).
Š ª ⮫쪮 ᮪¥â ¡ã¤¥â ®âªàëâ, ¯à¨¤ñâáï ¦¤ âì ¢å®¤ï饣® ¯®¤ª«î祭¨ï ¯¥à¥¤
¢ë¯®«­¥­¨¥¬ 祣® - «¨¡®. <20>â® ¬®¦¥â ¡ëâì ¯à®¢¥àª®© á®áâ®ï­¨ï ࠧꥬ  ¤«ï
TCB_ESTABLISHED ¨«¨ ®¦¨¤ ­¨¥¬ ¤ ­­ëå ¢ ¯®«ãç î饬áï ¡ãä¥à¥.
<EFBFBD>  €ªâ¨¢­®¬ ¯®¤ª«î祭¨¨ ¢ë ᮥ¤¨­ï¥â¥áì á 㪠§ ­­ë¬ 㤠«¥­­ë¬ ¯®à⮬. “¤ «¥­­ë©
IP ¨ 㤠«¥­­ë¥ ¯ à ¬¥âàë ¯®àâ  ¤®«¦­ë ¡ëâì ¯¥à¥¢¥¤¥­ë ¢ ­¥­ã«¥¢ë¥ §­ ç¥­¨ï¬¨
(¨­ ç¥, á 祬 ᮥ¤¨­ïâáï?). ’ ª¦¥, ®¯à¥¤¥«¨â¥ ã­¨ª «ì­ë© ­®¬¥à «®ª «ì­®£®
¯®àâ , â ª ç⮡ë 㤠«¥­­®¥ ¯à¨«®¦¥­¨¥ ¬®£«® ­ ©â¨ ­ã¦­ãî ¯à®£à ¬¬ã ¨ ãáâ ­®¢¨âì
á ­¥© ᮥ¤¨­¥­¨¥. ‚¥¤ì, ¬®£ãâ ¡ëâì ­¥áª®«ìª® ¯à®£à ¬¬ ­  ¢ è¥© ¬ è¨­¥,
¯®¤ª«î祭­ë¥ ª ®¤­®¬ã ¨ ⮬㠦¥ 㤠«ñ­­®¬ã ª®¬¯ìîâ¥àã.
<EFBFBD>¨¦¥ ­ ¯¨á ­®, ª ª ­ ©â¨ ã­¨ª «ì­ë© ­®¬¥à ¯®àâ .
Š ª ­ å®¤¨âì ­¥¨á¯®«ì§®¢ ­­ë© ­®¬¥à «®ª «ì­®£® ¯®àâ 
====================================================
‘®§¤ ¢ ï  ªâ¨¢­®¥ ¯®¤ª«î祭¨¥ á 㤠«¥­­ë¬ ᮪¥â®¬, ã ¢ á ¬®¦¥â ¯®ï¢¨âìáï
¦¥« ­¨¥ ¢ë¡à âì ã­¨ª «ì­ë© ­®¬¥à «®ª «ì­®£® ¯®àâ . Ž¡ëç­®, ­®¬¥à  «®ª «ì­®£®
¯®àâ  ­ ç¨­ îâáï á 1000. ‘«¥¤ãî騩 ª®¤ ¬®¦¥â ¨á¯®«ì§®¢ âìáï, çâ®¡ë ¯®«ãç¨âì
­¥¨á¯®«ì§®¢ ­­ë© ­®¬¥à ¯®àâ  ¤® ᮧ¤ ­¨ï ᮪¥â .
mov ecx, 1000 ; Ž¯à¥¤¥«ï¥¬ «®ª «ì­ë© ¯®àâ, ­ ç¨­ ¥¬ á 1000
getlp:
inc ecx
push ecx
mov eax, 53
mov ebx, 9
int 0x40
pop ecx
cmp eax, 0 ; íâ®â «®ª «ì­ë© ¯®à⠨ᯮ«ì§ã¥âáï?
jz getlp ; ¤  - ¯à®¤®«¦ ¥¬ ¯¥à¥¡¨à âì
; ecx ᮤ¥à¦¨â ­®¬¥à ᢮¡®¤­®£® «®ª «ì­®£® ¯®àâ 
‡ ¯¨áì ¤ ­­ëå ¢ ᮪¥â
=====================
…áâì ¤¢¥ ä㭪樨, § ¢¨áï騥 ®â ⮣®, ¡ë« «¨ ࠧꥬ ®âªàëâ ¤«ï ¯à®â®ª®«  TCP ¨«¨
UDP. ¯ à ¬¥âàë § ¯à®á  - â® ¦¥ á ¬®¥ ª ª ¡ë â® ­¨ ¡ë«®. Š®£¤  ᮪¥â ®âªà뢠¥âáï
¤«ï TCP, ¨á¯®«ì§ã©â¥ äã­ªæ¨î á®áâ®ï­¨ï, çâ®¡ë ®¯à®á¨âì ¤«ï ¯®¤ª«î祭¨ï - ¤ ­­ë¥
­¥ ¬®£ãâ ¡ëâì ¯¥à¥¤ ­ë ᮪¥âã, ¯®ª  ¤à㣮© ­¥ ᮥ¤¨­¨«áï á í⨬. ‘®áâ®ï­¨¥
᮪¥â  - TCB_ESTABLISHED.
Š®£¤  ¢ë ¯®áë« ¥â¥ ¤ ­­ë¥, ¯à®¨á室¨â ᮧ¤ ­¨¥ ¨ ®â¯à ¢ª  ®¤­®£® IP ¯ ª¥â . €
íâ® §­ ç¨â, çâ® ¯®«ì§®¢ â¥«ì᪮¥ ¯à¨«®¦¥­¨¥ ®â¢¥ç ¥â §  à §¬¥à ¯¥à¥¤ ¢ ¥¬ëå
¯ ª¥â®¢. ‘®åà ­ï¥âáï ¬¥­¥¥ 祬 768 ¡ ©â®¢ à §¬¥à  ¯ ª¥â . …᫨ ¢ë ¯¨è¥â¥
®ª®­ç¥­­ãî ¯à®£à ¬¬ã (â ªãî, ª ª telnet), â® ¬®¦¥â¥ § å®â¥âì ®â¯à ¢«ïâì ¯ ª¥â
§  ª ¦¤®¥ (­¥íä䥪⨢­®¥) ­ ¦ â¨¥ ª« ¢¨è¨. Œ®¦­® ¨á¯®«ì§®¢ âì â ©¬¥à, ç⮡ë
®â¯à ¢«ïâì ¤ ­­ë¥ ¯¥à¨®¤¨ç¥áª¨ (᪠¦¥¬, ª ¦¤ãî ᥪ㭤ã).
—⥭¨¥ ¤ ­­ëå ¨§ ᮪¥â 
=======================
…áâì ®¤­  äã­ªæ¨ï ¤«ï ç⥭¨ï ¤ ­­ëå ¨§ ᮪¥â , ¢®§¢à é îé ï ¤ ­­ë¥ ¢ ¡ãä¥à. <20>â 
äã­ªæ¨ï ®¤­®¢à¥¬¥­­® ¢®ááâ ­ ¢«¨¢ ¥â ®¤¨­ ¡ ©â. ‚ë ¬®¦¥â¥ ¨á¯®«ì§®¢ âì äã­ªæ¨î
®¯à®á , çâ®¡ë ¯à®¢¥à¨âì ¯®«ãç î騩áï ¡ãä¥à ­  ¤ ­­ë¥.
‡ ªàë⨥ ᮪¥â 
================
<EFBFBD>à®áâ® ¢ë§®¢¨â¥ ᮮ⢥âáâ¢ãîéãî äã­ªæ¨î (¤«ï TCP ¨«¨ UDP, ᮮ⢥âá⢥­­®).
‡ ªà뢠ï TCP ᮪¥â, ­¥ § ¡ã¤ìâ¥, çâ® ­  ¤à㣮© ª®­æ¥ ᮥ¤¨­¥­¨ï, ᮪¥â ¬®¦¥â
¯à®¤®«¦¨âì ®â¯à ¢«ïâì ¤ ­­ë¥, â ª çâ® ®­ ®áâ ñâáï  ªâ¨¢­ë¬ ¢ â¥ç¥­¨¥ ­¥áª®«ìª¨å
ᥪ㭤 ¯®á«¥ ¢ è¥£® § ¯à®á .
…᫨ ã ¢ á ¥áâì ¢®¯à®áë ¨«¨ ¯à¥¤«®¦¥­¨ï ¯® ã«ãç襭¨î í⮣® ¤®ªã¬¥­â , â®
¯®è«¨â¥ ¬­¥ ¯¨á쬮 ­  mikeh@oceanfree.net.
<EFBFBD>¥à¥¢ñ« ¤®ªã¬¥­â Hex.
…᫨ ¥áâì ¢®¯à®áë ¨«¨ ¯à¥¤«®¦¥­¨ï ¯® ᮤ¥à¦ ­¨î, â® ¯à®áì¡  ­ ¯¨á âì ¬­¥ ­ 
mestack@yandex.ru ¨«¨ ­  ­ è ä®àã¬: http://meos.sysbin.com