Çàùèòà èãð îò âçëîìà

         

ïðèìåð ïðîãðàììû, âûçûâàþùèé ôóíêöèè ïî óêàçàòåëþ


 èñõîäíîì òåñòå âñå ïîíÿòíî. Ôóíêöèÿ main âûçûâàåò ôóíêöèþ demo, ïåðåäàâàÿ åé óêàçàòåëè íà sub_demo è sub_demo, êîòîðûå ïîî÷åðåäíî âûçûâàþò äðóã äðóãà, êàæäûé ðàç óìåíüøàÿ ñ÷åò÷èê íà åäèíèöó. Êîðî÷å, ìû èìååì öèêë. Íî êàêîé! Âû òîëüêî ïîñìîòðèòå íà åãî äèçàññåìáëåðíûé êîä! Õâîñò îòñîõíåò!

.text:00401000 loc_401000:                      ; DATA XREF: _maino

.text:00401000             mov    ecx, [esp+4]

.text:00401004             dec    ecx

.text:00401005             jz     short loc_401018

.text:00401007             mov    eax, [esp+0Ch]

.text:0040100B             push   eax

.text:0040100C             mov    eax, [esp+0Ch]

.text:00401010             push   eax

.text:00401011             push   ecx

.text:00401012             call   eax

.text:00401014             add    esp, 0Ch

.text:00401017             retn



.text:00401020

.text:00401020 loc_401020:                      ; DATA XREF: _main+5o

.text:00401020             mov    ecx, [esp+4]

.text:00401024             dec    ecx

.text:00401025             jz     short loc_401038

.text:00401027             mov    eax, [esp+0Ch]

.text:0040102B             mov    edx, [esp+8]

.text:0040102F             push   eax

.text:00401030             push   edx

.text:00401031             push   ecx

.text:00401032             call   eax

.text:00401034             add    esp, 0Ch

.text:00401037             retn

.text:00401040

.text:00401060 _main proc near                  ; CODE XREF: start+AFp

.text:00401060             push   offset loc_401000

.text:00401065             push   offset loc_401020

.text:0040106A             push   69h

.text:0040106C             call   sub_401040

.text:00401071             add    esp, 0Ch

.text:00401074             retn

.text:00401074 _main endp



Ñîäåðæàíèå ðàçäåëà