首页
社区
课程
招聘
[旧帖] [求助]如何设置节属性可写 0.00雪花
发表于: 2008-5-5 15:43 3534

[旧帖] [求助]如何设置节属性可写 0.00雪花

2008-5-5 15:43
3534
在VC++6.0编译器中可指定参数/section:.text,RWE 来指定程序代码段可写,请问MASM8.0汇编器如何指定类似参数?

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 207
活跃值: (10)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
2
PE编辑工具直接改段属性
2008-5-5 15:47
0
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
对汇编工具不熟悉
只知道在程序运行过程中可以设置,参考以下程序
start:

  mov esi, (ProgramEnd-start)
  invoke VirtualProtect, 401000h, esi, PAGE_EXECUTE_READWRITE, ADDR oldProt ; enable write to code section
  test eax, eax
  jnz _patch
      invoke MessageBox, NULL, szErr, szErr, MB_OK   ; error, show it and quit
      jmp _end

_patch:
  lea edi, _change
  mov al, 0e8h      ; call opcode
  stosb
  mov eax, 00000008h ; Will be 08 00 00 00 when written to memory 
  stosd

  invoke VirtualProtect, 401000h, esi, oldProt, ADDR oldProt  ; restore the old protection settings

_msgBox:  push NULL
      push offset szTitle
      push offset szText
      push NULL
_change:  nop      ; here will be inserted 'call MessageBox'
      nop
      nop
      nop
      nop
_end:    invoke ExitProcess, NULL
ProgramEnd:

end start
2008-5-5 21:11
0
游客
登录 | 注册 方可回帖
返回
//