HOOK几个文件API的脚本
本来想用SoftSnoop监视CreateFile/OpenFile/ReadFile/SetFilePointer,后来发现太难用了。于是自己写了个脚本,把程序运行中上面几个API的执行信息记录下来,供自己分析用。
不知有没有人需要,发个玩玩。
=============================================
var x1,x2,x3,x4,x5
gpa "CreateFileA", "kernel32.dll"
mov x1,$RESULT
bp $RESULT
gpa "OpenFile", "kernel32.dll"
mov x2,$RESULT
bp $RESULT
gpa "SetFilePointer","kernel32.dll"
mov x3,$RESULT
bp $RESULT
gpa "ReadFile","kernel32.dll"
mov x4,$RESULT
bp $RESULT
mov x,0
run
WWWWW:
mov x5,eax
mov eax,x1
cmp eip,eax
jne next_1
log "hFile:"
log
log "OffsetLo"
log
log "pOffsetHi"
log
log "Origin"
log
next_1:
mov eax,x2
cmp eip,eax
jne next_2
log "FileName:"
log
log "Access"
log
log "ShareMode"
log
log "pSecurity"
log
log "Mode"
log
log "hTemplateFile"
log
next_2:
mov eax,x3
cmp eip,eax
jne next_3
log "FileName:"
log
log "pOfstruct"
log
log "Mode"
log
next_3:
mov eax,x4
cmp eip,eax
jne next_4
log "hFile:"
log
log "Buffer"
log
log "BytesToRead"
log
log "pBytesRead"
log
log "pOverlapped"
log
next_4:
mov eax,x5
run
cmp x,0
je WWWWW
================================
膜拜大牛... {:1_931:}
不错的脚本,下来研究一下 感谢楼主,收下了 Good script. Thanks alot. 很好的,收下测试 感谢楼主,收下了 灰常需要,感谢楼主。
页:
[1]