🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.asm
Article #2475

Re: naruszenie ochrony pamieci - dlaczego

#2475
From: panki
Date: Sat, 11 Jun 2011 21:27
66 lines
2457 bytes
On 11 Cze, 20:19, yesma <ye...@false.pl> wrote:
> panki pisze:> witam - probuje troche oswoic sobie assemblera i nie zabardzo wiem
> > gdzie popelnilem błąd w przykladowym kodzie. Bo po uruchomieniu tego
> > programu wypisuje ten napis i potem pisze naruszenie ochryny pamieci.
>
> [...]
>
> > [code]
> > section .text
>
> > global _start
>
> > _start:
>
> >    call pisz
>
> jmp short .end
> ;program sie wykladal bo to ponizej wykonywal jako kod>    db "qwerty",0; wypisz zmienna
>
> .end:
> >    mov eax,1
> >    int 80h
>
> > pisz:
> >    push ebp;ebp na stos
> >    mov ebp,esp
> >    pushfd
> >    push esi
> >    push eax
>
> >    mov esi,[ebp+4]
>
> add esi,2       ;w esi adres napisu. jmp short==2bajty
>
>
>
>
>
>
>
> >    mov [tmp],esi
>
> >    mov eax, 4
> >    mov ebx,1
> >    mov ecx, [tmp]
> >    mov edx,6
> >    int 80h
>
> >    pop eax
> >    pop esi
> >    popfd
> >    pop ebp
>
> >    ret
>
> > section .data
>
>   tmp dd 0
>
> --
> Pozdrawiam - Grzechu
> Linux x86_64

to dlaczego na tej stronie http://rudy.mif.pg.gda.pl/~bogdro/linux/linux08.html

tam jest dane są właśnie w sekcji kodu
Technical Details
Message-ID: <c540c835-33ea-4963-9fc6-7701e803ae62@16g2000yqy.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!postnews.google.com!16g2000yqy.googlegroups.com!not-for-mail
References: <9b70ec81-f1ce-4857-b679-c0d1498ae9ee@v8g2000yqb.googlegroups.com> <it0bs2$h1j$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!postnews.google.com!16g2000yqy.googlegroups.com!not-for-mail
From: panki <bartekn80@gmail.com>
Newsgroups: pl.comp.lang.asm
Subject: Re: naruszenie ochrony pamieci - dlaczego
Date: Sat, 11 Jun 2011 14:27:00 -0700 (PDT)
Organization: http://groups.google.com
Lines: 70
Message-ID: <c540c835-33ea-4963-9fc6-7701e803ae62@16g2000yqy.googlegroups.com>
References: <9b70ec81-f1ce-4857-b679-c0d1498ae9ee@v8g2000yqb.googlegroups.com> <it0bs2$h1j$1@inews.gazeta.pl>
NNTP-Posting-Host: 195.13.38.135
Mime-Version: 1.0
X-Trace: posting.google.com 1307827620 19085 127.0.0.1 (11 Jun 2011 21:27:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 11 Jun 2011 21:27:00 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 16g2000yqy.googlegroups.com; posting-host=195.13.38.135; posting-account=JRAzRQkAAAD5XoJzKjluGTDzABl8OkXy
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HUALESNKRC
X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1,gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit