storing offsets

storing offsets

Post by `G » Mon, 04 Mar 2002 01:00:29



hi. i'm trying to write a program that replicates a bit *LIKE* a virus
but not a virus. basically it just generates mutated copies of itself.
I was wondering if it is possible to do the following:

org 100h

.code

jmp start
 unit1offst dw ? ; offset to 1st unit
 unit2offst dw ? ; offset to 2nd unit
 unit3offst dw ? ; offset to 3rd unit
start: jmp unit1offst

would this be possible? if not, can someone point me in the right
direction??

thanks,
marc

 
 
 

1. Segment/Offset vs Selector/Offset.

Is this the correct way of dealing with es/di for a protected mode program.
The function retrives screen info via ISR 0x10/Service 0x1b.
You place the segment address of a buffer in es and the offset in di but with a
protected mode program you have offset/selector.

Can some one briefly explain offset/selector to me.
Is it similar to segment/offset where the high byte of an address is the segment
address and the low byte is the offset?

// Determines the height and width of the screen.
void WindowC::GetDimensions()
{
  // We need a 64 byte buffer for the display info returned by the interrupt
  // function.
  static unsigned char Buffer[64];

  Regs.w.bx=0x0;

  // Place the segment and offset into es:di.
  SegRegs.es=Seg(Buffer);
  Regs.w.di=Off(Buffer);

  // Call interrupt 0x10, service 0x1b.
  Regs.w.ax=0x1b<<8;
  ScreenCall();
  ScreenWidth=0;

  // The screen width is at offset 0x5 in the buffer (2 bytes).
  memmove(&ScreenWidth,&Buffer[0x5],2);
  ScreenHeight=0;

  // The screen height is at offset 0x22 in the buffer (1 byte).
  memmove(&ScreenHeight,&Buffer[0x22],1);

2. S/Key for Mac/PC

3. Storing ANY object in a STREAM like TCollection.Store

4. Theme Development

5. Screen Offset register + Gravity Force

6. Wireless Port Forwarding

7. Help: My structure members aren't getting the right offsets!

8. Business System Analyst with Enrollment exp - Tampa, FL

9. Device driver needs segment:offset info

10. HELP: How to get segment and offset from a buffer?

11. Segment & Offset

12. Read/Write to segment:offset adress

13. How to combine segment:offset to far pointer