All of lore.kernel.org
 help / color / mirror / Atom feed
* calculating byte
@ 2003-07-23 22:15 ssams
  2003-07-24  6:13 ` Anticipating a Reply
  2003-07-24  7:54 ` hp
  0 siblings, 2 replies; 7+ messages in thread
From: ssams @ 2003-07-23 22:15 UTC (permalink / raw)
  To: linux-assembly

hi all
if u have time, please answer my following question
i try to learn more about assembly. in a time i'found some 
article that explain about exploit, and i get this 
following code. My question is.. how to calculate byte at 
each line..?
thnaks before
regard
ssams
            .....
            ..... 
            movl %esi,array-offset(%esi) # 3 bytes
            movb $0x0,nullbyteoffset(%esi)# 4 bytes
            movl $0x0,null-offset(%esi) # 7 bytes
            movl $0xb,%eax # 5 bytes
            movl %esi,%ebx # 2 bytes
            leal array-offset,(%esi),%ecx # 3 bytes
            leal null-offset(%esi),%edx # 3 bytes
            int $0x80 # 2 bytes
            ....
            ....
===========================================================================================
"TELKOMNet Instan Divre VI Kalimantan memberikan DISKON PROGRESSIVE kepada para pengguna 
TELKOMNet-Instan hingga 50% mulai bulan Juli hingga September 2003." 
===========================================================================================

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calculating byte
  2003-07-23 22:15 calculating byte ssams
@ 2003-07-24  6:13 ` Anticipating a Reply
  2003-07-24  7:54 ` hp
  1 sibling, 0 replies; 7+ messages in thread
From: Anticipating a Reply @ 2003-07-24  6:13 UTC (permalink / raw)
  To: ssams, linux-assembly

Hi ,

  You can find this by looking at the 
Machine Opcodes required for each instruction .
  
Bye 

 --- ssams <ssams@telkom.net> wrote: > hi all
> if u have time, please answer my following question
> i try to learn more about assembly. in a time
> i'found some 
> article that explain about exploit, and i get this 
> following code. My question is.. how to calculate
> byte at 
> each line..?
> thnaks before
> regard
> ssams
>             .....
>             ..... 
>             movl %esi,array-offset(%esi) # 3 bytes
>             movb $0x0,nullbyteoffset(%esi)# 4 bytes
>             movl $0x0,null-offset(%esi) # 7 bytes
>             movl $0xb,%eax # 5 bytes
>             movl %esi,%ebx # 2 bytes
>             leal array-offset,(%esi),%ecx # 3 bytes
>             leal null-offset(%esi),%edx # 3 bytes
>             int $0x80 # 2 bytes
>             ....
>             ....
>
===========================================================================================
> "TELKOMNet Instan Divre VI Kalimantan memberikan
> DISKON PROGRESSIVE kepada para pengguna 
> TELKOMNet-Instan hingga 50% mulai bulan Juli hingga
> September 2003." 
>
===========================================================================================
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
http://vger.kernel.org/majordomo-info.html 

________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calculating byte
  2003-07-23 22:15 calculating byte ssams
  2003-07-24  6:13 ` Anticipating a Reply
@ 2003-07-24  7:54 ` hp
  2003-07-25 13:38   ` switching to real mode? Wolfgang Huber
  1 sibling, 1 reply; 7+ messages in thread
From: hp @ 2003-07-24  7:54 UTC (permalink / raw)
  To: ssams, linux-assembly

ssams am Mittwoch, 23. Juli 2003 23:15:
> hi all
> if u have time, please answer my following question
> i try to learn more about assembly. in a time i'found some
> article that explain about exploit, and i get this
> following code. My question is.. how to calculate byte at
> each line..?

for a rough calculation, as a rule of thumb:

	simple opcode			1 byte	(very few such opcodes, e.g. push/pop)
	opcode w. addressing modifier	2 bytes
	mov immediate data		+ 4 bytes
	signed byte displacement	+ 1 byte

	'other' addressing size		+ 1 byte	(16/32bit)
	'other' data item size		+ 1 byte	(word/dword)

	'exotic operations praefix'	+ 1byte	(e.g. "0F")


hp

-- 
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
	FAQ(s) + DOCs at http://linuxassembly.org
  pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* switching to real mode?
  2003-07-24  7:54 ` hp
@ 2003-07-25 13:38   ` Wolfgang Huber
  2003-07-25 16:55     ` hp
  2003-07-25 17:20     ` Maciej Hrebien
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Huber @ 2003-07-25 13:38 UTC (permalink / raw)
  To: linux-assembly

Hi!

I know this question sounds a bit silly...
How would one switch to real mode in Linux, are there any caveats?

Wolfgang




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: switching to real mode?
  2003-07-25 13:38   ` switching to real mode? Wolfgang Huber
@ 2003-07-25 16:55     ` hp
  2003-07-25 17:20     ` Maciej Hrebien
  1 sibling, 0 replies; 7+ messages in thread
From: hp @ 2003-07-25 16:55 UTC (permalink / raw)
  To: Wolfgang Huber, linux-assembly

Wolfgang Huber am Freitag, 25. Juli 2003 14:38:
> Hi!
>
> I know this question sounds a bit silly...

indeed...

> How would one switch to real mode in Linux, are there any caveats?

none - if you can.


DA =>	FAQ(s) + DOCs at http://linuxassembly.org

hp.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: switching to real mode?
  2003-07-25 13:38   ` switching to real mode? Wolfgang Huber
  2003-07-25 16:55     ` hp
@ 2003-07-25 17:20     ` Maciej Hrebien
  2003-07-25 19:42       ` switching to real mode Rick A. Hohensee
  1 sibling, 1 reply; 7+ messages in thread
From: Maciej Hrebien @ 2003-07-25 17:20 UTC (permalink / raw)
  To: linux-assembly

Wolfgang Huber wrote:
> 
> Hi!
> 
> I know this question sounds a bit silly...
> How would one switch to real mode in Linux, are there any caveats?
> 
> Wolfgang

For what purpose you need it? From linux x86 users point of view: you
just can't, or am i wrong? ;) Generally once you switch to protected
mode you don't need real one and if you want to run some code written
for real mode you just run it in vm86 mode rather than switching it back
(as i remember dosemu does something like this). If you are interested
in "hard" switch i suggest to read ie. intel's "software developers
manual vol. 3, system programming", chapter 8 "processor management and
initialization", point 8 "mode switching" (1999 version).

Correct me linux-assemblers if i'm wrong!

-- 
Maciej Hrebien


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: switching to real mode
  2003-07-25 17:20     ` Maciej Hrebien
@ 2003-07-25 19:42       ` Rick A. Hohensee
  0 siblings, 0 replies; 7+ messages in thread
From: Rick A. Hohensee @ 2003-07-25 19:42 UTC (permalink / raw)
  To: m_hrebien; +Cc: linux-assembly

Linux has support for V86 mode, which switches to something closely
resembling Real Mode on IRET, and switches to pmode on an interrupt, so
that 8086 code can be run on a pmode paged OS, and the V86 task can be
paged, which allows numerous V86 tasks to think they have the low meg.

Otherwise, switching to Real Mode = Leaving Linux, or any other unix-alike.
You could do that too, and alternate between Linux and Real Mode, maybe.
Doing so would be a more twisted hack than Al Viro's namespaces.

Rick Hohensee



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-07-25 19:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-23 22:15 calculating byte ssams
2003-07-24  6:13 ` Anticipating a Reply
2003-07-24  7:54 ` hp
2003-07-25 13:38   ` switching to real mode? Wolfgang Huber
2003-07-25 16:55     ` hp
2003-07-25 17:20     ` Maciej Hrebien
2003-07-25 19:42       ` switching to real mode Rick A. Hohensee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.