|
新人报道请跟此帖,勿另发主题帖
旧人报道 |
|
[求助]调用门格式中的32位offset
今天用虚拟机远程调试了一下, 入口地址仍然跟我想的一样是gdt偏移, 不过终于弄清楚 mov ecx, 03e0h ;调用门 -> 索引是7c, 偏移是03e0, RPL是3, 选择子是03e3, DPL是3. 的意图所在, 顺便提一句kanxue狠令我失望 |
|
[求助]调用门格式中的32位offset
我把那篇代码贴这了,加上了自己的注释 ;------------------------------------------------------------------------------------------------------- .586p .model flat, stdcall option casemap: none .code start: pushfd pushad push edx push dx sgdt fword ptr[esp] pop cx pop edx mov eax, edx mov ecx, 03e0h ;调用门 -> 索引是7c, 偏移是03e0, RPL是3, 选择子是03e3, DPL是3. .if dword ptr[edx + ecx + 2] != 0ec0003e8h mov byte ptr [edx], 0c3h ;不懂?? mov word ptr [edx + ecx], ax shr eax, 16 mov word ptr[edx + ecx + 6], ax ; -> offset == gdt偏移地址 mov dword ptr[edx + ecx + 2], 0ec0003e8h ;类型 == ec00, 选择子 == 03e8 mov dword ptr[edx + ecx + 8], 0000ffffh ;Base:Limit == 00000000:FFFF mov dword ptr[edx + ecx + 12], 00cf9a00h ;属性:粒度为4k, 使用32位代码段, limit为ffff, DPL为0 .endif ;DT为1(存储段描述符), TYPE:未访问, 存储段可写, 高端扩展, 是代码段. popad popfd xor eax, eax ret 8 end start ;------------------------------------------------------------------------------------------------------- 在自己程序中ring0调用方法 ;------------------------------------------------------------- call 3e3:00000000 ;机器码 9A 00 00 00 00 E3 03 ;此时已经进入RING0,CS=3E8,跟着要切换堆栈 mov eax,esp mov esp,[esp+4] push eax ;这里加入你要在RING0里执行的代码 ;准备返回RING3 pop esp push offset ring3 retf ring3: ;此时回到RING3 ;------------------------------------------------------------- 这是在我的机子上用icesword保存的gdt: GDT Base:0xF7723160 , GDT Limit:0x3FF 000 Reserved 008 Mem 00000000:FFFFFFFF(Base:Limit) P 0(DPL) 1011 010 Mem 00000000:FFFFFFFF(Base:Limit) P 0(DPL) 0011 ...... 3D0 Reserved 3D8 Reserved 3E3 Gate 03E8:F7723160(Selector:Offset) P 3(DPL) C(type) 0(Count) 3E8 Mem 00000000:FFFFFFFF(Base:Limit) P 0(DPL) 1010 3F0 Reserved 3F8 Reserved 大虾门,给小弟指点一二啊 >>>>为什么offset要用这个值F7723160(GDT Base), Mem 00000000:FFFFFFFF(Base:Limit)为什么这么定义啊?!!!! >>>>call 3e3:00000000的含义是什么?调用门中指定了call的入口地址吗,本例中好像入口地址就是call的下一条指令嘛 |
|
[求助]调用门格式中的32位offset
你的那篇文章我看了,我的问题是: 我始终不明白 http://bbs.gxsky.com/thread-264626-1-1.html 这篇文章里的意思, 他里面调用门描述符的offset == gdt内存偏移地址 == 8003F000, 代码段描述符的base == 00000000, 那么入口地址应该为base + offset == 8003F000== gdt内存偏移地址, 事实上这可能吗,麻烦谁能认真看一下我给的那篇文章啊,困惑我好几天了! |
|
[求助]调用门格式中的32位offset
谢谢,offset字段果然是代码偏移,但是我之前看的一篇文章http://bbs.gxsky.com/thread-264626-1-1.html里面, offset是gdt在内存的偏移-????,而且建了一个0级32位代码段Base:Limit == 00000000:FFFF, 粒度:4k, 完全看不懂 百度+google很久了,很疑惑啊 |
|
[求助]一个区段的属性问题
谢谢,已经修改了代码基址, |
|
|
|
|
|
|
|
[求助][求助]小白请教大家,对一个已经打开的文本,如何写入数据?
你的Data是个什么东东,不会是个无效指针吧 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值