本帖最后由 sunkiss 于 2013-9-14 10:36 编辑
我的一个文件我压缩了,我不想要别人打开,我改了扩展名,但是打开winrar,用winrar还是能打开,我知道吧文件头换成000000,就打不开了,au3能做到吗?我知道FileOpen ( "c:\1.rar" , 17 ) ,这样只是以非只读的二进制模式打开了,但是怎么修改呢?我还希望以后再写程序把000000替换成526172,到这里不会了,求教啊,各位大大们,怎么写啊?文件时$sFile="c:\1.7z"时,MsgBox(0,"sdf",_WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), 4, $nBytes))提示的是1,换成了一个视频文件后提示是0。$sFile="c:\1.7z"
$tBuffer = DllStructCreate("byte[4]")
$hFile = _WinAPI_CreateFile($sFile, 2, 2)
_WinAPI_SetFilePointer($hFile, 0 )
MsgBox(0,"sdf",_WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), 4, $nBytes))
_WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), 4, $nBytes)
_WinAPI_CloseHandle($hFile)
$sText = BinaryToString(DllStructGetData($tBuffer, 1))
$sText = BinaryToString(DllStructGetData($tBuffer, 1))
ConsoleWrite('2) ' & $sText & @CRLF)
自己搞定了,贴出来给大家看看。$7z=FileOpen ( "c:\7.7z" , 16 )
$chars = FileRead($RFAVI)
$zf="0x00000000000000000000000000000000000000000000000000000000000000"
$charsok=$zf&StringTrimLeft($chars,64)
FileClose ($7z)
$a=FileOpen ( "D:\转换结果.7z", 18)
FileWrite($a,$charsok)
FileClose ($a)
|