Article View: pl.comp.lang.asm
Article #511Re: Funkcje systemowe Win32
From: Bogdan (bogdro)
Date: Mon, 14 Aug 2006 15:34
Date: Mon, 14 Aug 2006 15:34
49 lines
2446 bytes
2446 bytes
Remek napisał(a): > Witam! > > Czy poniższy zestaw funkcji wykona się jednym "ciągiem"? > Tzn. gdzie wraca program po wykonaniu takiej instukcji? > W debuggerze widzę, że nie wraca w miejsce skąd funkcja została > wywołana. > > ..... > > invoke SetWindowTextA, hEdit4, addr Bufor1 > invoke SetWindowTextA, hEdit5, addr Bufor2 > invoke SetWindowTextA, hEdit6, addr Bufor3 > > ...... Oczywiście, że nie wraca do wywołującej instrukcji, tylko zaraz za nią. Powyższy ciąg instrukcji z punktu widzenia programu wykona się jednym ciągiem (pomijamy przerwania sprzętowe). Używając debugera może zostałeś zaskoczony przez jakieś PUSHe. Jak wiemy, nie ma instrukcji procesora 'invoke'. To, co jest powyżej, zostaje przez kompilator rozłożone na z grubsza coś takiego: push dword offset Bufor1 push dword [hEdit4] call [SetWindowTextA] push dword offset Bufor2 push dword [hEdit5] call [SetWindowTextA] push dword offset Bufor3 push dword [hEdit6] call [SetWindowTextA] a jeśli te zmienne są lokalne, to jeszcze lepiej - każdy PUSH wyglądać będzie jak np.: lea eax, [ebp-xx] push eax ; push offset push dword [ebp-yy] ; push [] lub z użyciem ESP zamiast EBP (raczej wątpliwe). -- Pozdrawiam, Bogdan (Linux i FreeDOS) Kurs assemblera x86 (DOS i Linuks): http://rudy.mif.pg.gda.pl/~bogdro Grupy dyskusyjne o asm: pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32 Prawdziwy, bezpieczny komunikator: www.JabberPL.org
Technical Details
Message-ID:
<ebq56r$22l$1@atlantis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mailReferences:
<ebpvnm$lcu$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "Bogdan (bogdro)" <bogdan@bogdan.pl> Newsgroups: pl.comp.lang.asm Subject: Re: Funkcje systemowe Win32 Date: Mon, 14 Aug 2006 17:34:28 +0200 Organization: tp.internet - http://www.tpi.pl/ Lines: 49 Message-ID: <ebq56r$22l$1@atlantis.news.tpi.pl> References: <ebpvnm$lcu$1@inews.gazeta.pl> NNTP-Posting-Host: actu187.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: atlantis.news.tpi.pl 1155569691 2133 83.11.74.187 (14 Aug 2006 15:34:51 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Mon, 14 Aug 2006 15:34:51 +0000 (UTC) User-Agent: Thunderbird 1.5.0.5 (X11/20060719) In-Reply-To: <ebpvnm$lcu$1@inews.gazeta.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit