linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henio Paszczak <blurrpp@yahoo.com>
To: linux-assembly@vger.kernel.org
Subject: self modyfing code and GDT
Date: Sun, 18 Mar 2007 10:48:48 -0700 (PDT)	[thread overview]
Message-ID: <186179.43467.qm@web50310.mail.re2.yahoo.com> (raw)


> Hi.
> 1) I want to write self modyfing code. I'm using 125
> finction (sys_mprotect )
> 
> .section .text
>     
> .global _start
> _start:
> 	nop
> 	movl $125,%eax
> 	movl $smc_address,%ebx
> 	movl $4096,%ecx
> 	movl $7,%edx
> 	int $0x80
> 
> 	orl  %eax, %eax
> 	jnz .error	# if something wrong
> 
> 	movl $0xaabbccdd,smc_address
> 
> 	movl $0x0000000000,%eax
> .equ smc_address, .-4
> 
> 	# eax==0xaabbccdd
> 
>  .error:
> 	movl $1,%eax
> 	movl $0,%ebx
> 	int $0x80
> 
> but it doesn't work ( %eax=0 ). 
> Is there any other way by changing segment
> descriptor
> in GDT ?, and how to do this ( i have no rights to
> write it ).
> 
> 2) How to read 8-bytes of segment descriptor, how to
> get current segment selector and the same question
> about task-state segment ( selector is easy to
> obtain
> by 'str' instruction )
> Thank You in advice for help
> Lukas



 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

             reply	other threads:[~2007-03-18 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-18 17:48 Henio Paszczak [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-03-18 11:41 self modyfing code and GDT Henio Paszczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=186179.43467.qm@web50310.mail.re2.yahoo.com \
    --to=blurrpp@yahoo.com \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).