📄 fileio.inc
字号:
.code
;Include file ring-3 InputOutput functions
;(c) necr0mancer
;
; necr0mancer2001@hotmail.com
;-------------------------------
;Input:edx=offset of filename
fopen proc
pushad
xor ebx,ebx
push ebx
push FILE_ATTRIBUTE_NORMAL
push OPEN_EXISTING
push ebx
push FILE_SHARE_READ + FILE_SHARE_WRITE
push GENERIC_READ + GENERIC_WRITE
push edx
call CreateFile
inc eax ;eax=-1?
jz fopen_exit
dec eax
fopen_exit:
mov [esp+4*7], eax
popad
retn
fopen endp
;-------------------------------
;Input:ebx=handle
fclose proc
pushad
push ebx
call CloseHandle
popad
retn
fclose endp
;-------------------------------
;Input:ebx=handle file
; ecx=count of bytes to read
; edx=offset of bufer
fread proc
pushad
push 0
push esp
push ecx
push edx
push ebx
call ReadFile
mov [esp+4*7], eax
popad
retn
fread endp
;-------------------------------
;Input:ebx=handle file
; ecx=count of bytes to move
fseek proc
pushad
push FILE_BEGIN
push 0
push ecx
push ebx
call SetFilePointer
mov [esp+28],eax;eax-new pos
popad
retn
fseek endp
;-------------------------------
;Input:ebx=handle file
; ecx=count of bytes to write
; edi=offset of bufer
fwrite proc
pushad
push 0
push esp
push ecx
push edi
push ebx
call WriteFile
popad
retn
fwrite endp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -