?? 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 + -