Hello everyone, I have a simple question. How do you convert a 32-bit linear address into a segment:offset address?!? Or for that matter how do you dump memory given a linear address?!? Thanks, Newbie
How do you mean a linear address? Are you trying to convert a physical address (ie: video ROM at C0000h)? Or is it a device location (like a MAC or video RAM address)? Or is it a location in a process or thread?
Ok. Here is my example. I am trying to read the IDTR which points to the base location of the IDT and the limit of the IDT. The base location address pointed by the IDTR is a 32-bit linear address. Do you understand better what I am trying to do?? Newbie
If I'm not mistaken, the structure of the IDTR is a 16 bit limit, followed by the 32 bit address and a reserved word. I hope I'm right, because if I'm not, this wouldn't work too well. :) .data lpHeap dd 0 IDTR equ this qword Limit dw 0 Base dd 0 dw 0 .code start: sidt IDTR mov esi,Base invoke GetProcessHeap xor ecx,ecx mov cx,Limit shl ecx,3 push ecx invoke HeapAlloc,eax,NULL,ecx pop ecx mov edi,eax mov lpHeap,eax rep movsb ; And now you have the interrupt table (I hope anyway) and the ; base address based off the DS, ES, SS, and CS registers.