Article View: pl.comp.lang.asm
Article #269Re: pobieranie danych z stosu
From: lemkat
Date: Thu, 25 May 2006 18:32
Date: Thu, 25 May 2006 18:32
72 lines
2550 bytes
2550 bytes
Witam
Problem juz rozwiazany, probelm byl z przydzialem pamieci, dawalem za
malo. Kompilator to C++ Builder system WIN XP
Pozdrawiam i dzieki za pomoc, ponizej zamieszczam dzialjaca funkcje:
//----------------------------
void __declspec(naked) custom_WSARecv(void)
{
SOCKET s;
LPWSABUF pWsa;
DWORD dwLen;
_asm // prolog
{
push ebp
mov ebp, esp
sub esp, 12
mov eax, [ebp + MAGIC_STACKFRAME_SIZE]
mov [s], eax
mov eax, [ebp + MAGIC_STACKFRAME_SIZE + 4]
mov [pWsa], eax
mov eax, [ebp + MAGIC_STACKFRAME_SIZE + 8]
mov [dwLen], eax
}
SendBuffor( pWsa->buf, pWsa->len, 5, &s );
_asm // epilog
{
mov esp, ebp
pop ebp
ret
}
};
//---------------------------
Remek napisał(a):
> Witam!
>
> Nie napisałeś jaki kompilator i system, ale to nie takie istotne.
> Chodzi o to, że z ciekawości bym skompilował i podejrzał
> w debuggerze. Na moje oko może wykładać się już tu:
>
> _asm
> {
> push ebp
> mov ebp, esp
> sub esp, 0x16
>
> mov eax, [ebp+8]
> mov s, eax
> mov eax, [ebp+8+4]
> mov buf, eax
> mov eax, [ebp+8+8]
> mov len, eax
> mov eax, [ebp+8+12]
> mov flags, eax
> ......
>
> Myślę, że tu już powinieneś uregulować stos. W następnej
> wstawce to samo, chociaż chyba już niekonieczne.
>
> Pozdrawiam
>
> --
> Remek
>
Technical Details
Message-ID:
<e54tc3$c1p$1@nemesis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!newsfeed.pionier.net.pl!newsfeed.silweb.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mailReferences:
<e4nh3a$lss$1@atlantis.news.tpi.pl> <e4r3js$qel$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!newsfeed.pionier.net.pl!newsfeed.silweb.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: lemkat <lemkat@eranet.pl> Newsgroups: pl.comp.lang.asm Subject: Re: pobieranie danych z stosu Date: Thu, 25 May 2006 20:32:36 +0200 Organization: tp.internet - http://www.tpi.pl/ Lines: 72 Message-ID: <e54tc3$c1p$1@nemesis.news.tpi.pl> References: <e4nh3a$lss$1@atlantis.news.tpi.pl> <e4r3js$qel$1@inews.gazeta.pl> NNTP-Posting-Host: ccc19.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: nemesis.news.tpi.pl 1148582083 12345 83.30.126.19 (25 May 2006 18:34:43 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Thu, 25 May 2006 18:34:43 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: pl, en-us, en In-Reply-To: <e4r3js$qel$1@inews.gazeta.pl> X-Antivirus: avast! (VPS 0621-3, 24-05-2006), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit