⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wimadll.bas

📁 对ima、imz压缩文件修改
💻 BAS
📖 第 1 页 / 共 3 页
字号:
' to know if an inject is possible but need replace
'  lpFn : contain the name of file to be injected
'  lpDwSize : will receive the size of old file with same name. Can be NULL
'  lpNameWhenInjected : if not NULL, contain a new name in the image
'  lpShortName : will receive the short (8) name of file in image. Can be NULL
'  lpShortExt  : will receive the short (3) ext of file in image. Can be NULL
'      (if the file must have another name when injected)
'BOOL WIMAAPI IfInjectPossibleButNeedReplace(HIMA hIma,LPSTR lpFn,
'         LPDWORD lpDwSize,LPSTR lpShortName,
'         LPSTR lpShortExt,LPSTR lpNameWhenInjected);
Declare Function IfInjectPossibleButNeedReplace Lib "wimadll.dll" (ByVal Ima As Long, ByVal lpFn As String, _
                    lpdwSize As Long, ByVal lpShortName As String, ByVal lpShortExt As String, _
                    ByVal lpNameWhenInjected As String) As Boolean

' RmDir : Remove a directory
'  unPosDir :  The uiPosInDir fields in DIRINFO structure that describe
'                  the file
'BOOL WIMAAPI RmDir(HIMA hIma,UINT uiPosDir);
Declare Function RmDir Lib "wimadll.dll" (ByVal Ima As Long, ByVal uiPosDir As Long) As Boolean

' DeleteFileNameExt
' Delete a file in the image
' BOOL WIMAAPI DeleteFileNameExt(HIMA hIma,LPSTR lpNom,LPSTR lpExt,BOOL fRealDel);
'     for filling lpNom and lpExt, use data obtained from GetDirInfo
'   lpNom : pointer to array of 8 chars (name of 8.3 name, use DIRINFO.nom)
'   lpExt : pointer to array of 3 chars (ext  of 8.3 name, use DIRINFO.ext)
'   fRealDel : TRUE to really delete, FALSE to only test if delete is possible
Declare Function DeleteFileNameExt Lib "wimadll.dll" (ByVal Ima As Long, ByVal lpNom As String, _
                                ByVal lpExt As String, ByVal fRealDel As Boolean) As Boolean

Public Const ERRINFO_MOVEFILE_DESTINATIONEQUALSOURCE = &H80000001
Public Const ERRINFO_MOVEFILE_DESTINATIONSUBFOLERDEPL = &H80000002

'BOOL WIMAAPI MoveFileToDir(HIMA hIma,LPCSTR lpName,LPCSTR lpExt,LPCSTR lpszDestDir,
'                           LPBOOL lpfReplaceNeeded,BOOL fDoRealMove,BOOL fDoReplaceIfNeeded,
'                           LPDWORD lpdwErrInfo);
Declare Function MoveFileToDir Lib "wimadll.dll" (ByVal Ima As Long, _
                                   ByVal lpName As String, ByVal lpExt As String, _
                                   ByVal lpszDestDir As String, lpfReplaceNeeded As Boolean, _
                                   ByVal fDoRealMove As Boolean,ByVal fDoReplaceIfNeeded As Boolean, _
                                   lpdwErrInfo As Long) As Boolean

' RenameFile :    Rename one file
'  uiPosDir :     The uiPosInDir fields in DIRINFO structure that describe
'                  the file
'  lpNewLongName: The new name of the file
' BOOL RenameFile(HIMA hIma,UINT uiPosDir,LPCSTR lpNewLongName);
Declare Function RenameFile Lib "wimadll.dll" (ByVal Ima As Long, ByVal uiPosDir As Long, _
                                               ByVal lpNewLongName As String) As Boolean

' ChangeDateAndAttribute :    Change the date and attribute of a File
'  uiPosDir :     The uiPosInDir fields in DIRINFO structure that describe
'                  the file
'  *lpbNewAttr:   Contain the new attribute of the file (or NULL to no change)
'  *lpNewDosDate,
'  *lpNewDosTime: Contain the Modified Date and Time (or NULL to no change)
'  *lpbNewdir_CreateMSec,*lpwNewdir_CreateTime,*lpwNewdir_CreateDate
'                 Contain the Created Date and Time (or NULL to no change)
'  *lpwNewdir_LastAccessDate : Contain the Last Access Date (or NULL...)
' BOOL ChangeDateAndAttribute(HIMA hIma,UINT uiPosDir,LPBYTE lpbNewAttr,
'                                     LPWORD lpNewDosDate,LPWORD lpNewDosTime,
'                                     LPBYTE lpbNewdir_CreateMSec,
'                                     LPWORD lpwNewdir_CreateTime,LPWORD lpwNewdir_CreateDate,
'                                     LPWORD lpwNewdir_LastAccessDate);
Declare Function ChangeDateAndAttribute Lib "wimadll.dll" (ByVal Ima As Long, ByVal uiPosDir As Long, _
                                     NewAttr As Byte, _
                                     NewDosDate As Integer, NewDosTime As Integer, _
                                     Newdir_CreateMSec As Byte, _
                                     lpwNewdir_CreateTime As Integer, Newdir_CreateDate As Integer, _
                                     lpwNewdir_LastAccessDate As Integer)

' ReadData : Direct read data in image.
'  dwPos :  begin position
'  dwSize : number of byte to copy (size of buffer)
'  lpBuf :  buffer that will receive data
'BOOL WIMAAPI ReadData(HIMA hIma,DWORD dwPos,DWORD dwSize,LPSTR lpBuf);
Declare Function ReadData Lib "wimadll.dll" (ByVal Ima As Long, ByVal dwPos As Long, _
                                ByVal dwSize As Long, ByVal lpBuf As String) As Boolean

' WriteData : Direct write data in image. Be carreful, WI don't refresh dir!
'  dwPos :  begin position
'  dwSize : number of byte to copy (size of buffer)
'  lpBuf :  buffer that contain data
'BOOL WIMAAPI WriteData(HIMA hIma,DWORD dwPos,DWORD dwSize,LPSTR lpBuf);
Declare Function WriteData Lib "wimadll.dll" (ByVal Ima As Long, ByVal dwPos As Long, _
                                ByVal dwSize As Long, ByVal lpBuf As String) As Boolean


' To be added : DRIVEINFO, GetFatImaSizeFileName, GetDriveInfo


'//
'// GetFatImaSizeFileName : Get information about UNCOMPRESSED Fat image
'//   lpfn :          FileName
'//   lpdwSize :      Will receive the size of the image, 32 bits low part of 64 bit data
'//   lpdwSize!high : Will receive the size of the image, 32 bits high part of 64 bit data
'//   lpfIsBigFat :   Boolean pointer, will receive TRUE if this is a large image (>2.88MB), not floppy image
'//   lpdwPosInFile : Will receive the position of the image
'BOOL WIMAAPI GetFatImaSizeFileName(LPCSTR lpFn,LPDWORD lpdwSize,LPDWORD lpdwSizeHigh,LPBOOL lpfIsBigFat,LPDWORD lpdwPosInFile);
Declare Function GetFatImaSizeFileName Lib "wimadll.dll" (ByVal lpFn As String, lpdwSize As Long, lpdwSizeHigh As Long, _
                                                          lpfIsBigFat As Boolean, lpdwPosInFile As Long) As Boolean


'// GetDriveInfo : Get info about drive type
'//  bDrive : number of driver (0 = 'A:', 1 = 'B:')
'//  return the kind of drive
'DriveInfo return:
'      NO_FLOPPY=0,
'      FLOPPY_360=1,
'      FLOPPY_12M=2,
'      FLOPPY_720=3,
'      FLOPPY_144=4,
'      FLOPPY_288=5,
'      LDISK_REMOVABLE=6,
'      LDISK_HARDDISK=7,
'      LDISK_CDROM=8,
'      FLOPPY_LS120=9
'DRIVEINFO WIMAAPI GetDriveInfo(BYTE bDrive);
Declare Function GetDriveInfo Lib "wimadll.dll" (ByVal bDrive As Byte) As Long


'// Fill the ASPI Inquiry array.
'// if lpAspiCdRomInquityTab is NULL AND dwMaxNumberInArray==0, just return the number of ASPI CDrom Unit.
'//  lpAspiCdRomInquityTab : Will receive the Array of SCSI Unit
'//  dwMaxNumberInArray : size of array (in number of ASPIINQUIRYTAB)
'DWORD WIMAAPI WimLargeAspiCdromInquiryFillArray(ASPIINQUIRYTAB* lpAspiCdRomInquityTab,DWORD dwMaxNumberInArray);
Declare Function WimLargeAspiCdromInquiryFillArray Lib "wimadll.dll" (AspiInqTab As ASPIINQUIRYTAB, _
                                                                      ByVal dwMaxNumberInArray As Long) As Long

'// Create a CDRom Image fro ASPI Unit, using dwHost and dwTargetID from AspiCdromInquiy
'//   lpFn : Filename to create
'//   lpdwTotal : will receive the filesize
'// Note : I suggest using WimLargeReadAspiCDImageIgnoreError with fIgnoreError at FALSE
'BOOL WIMAAPI WimLargeReadAspiCDImage(HWND hWnd,DWORD dwHost,DWORD dwTargetID,LPSTR lpFn,LPDWORD lpdwTotal);
Declare Function WimLargeReadAspiCDImage Lib "wimadll.dll" (ByVal hWnd As Long, _
                              ByVal dwHost As Long, ByVal dwTarget As Long, _
                              ByVal lpFn As String, lpdwTotal As Long) As Boolean


'// Like WimLargeReadAspiCDImage
'// fIgnoreError :
'//    FALSE : if there is error ignore it only if the error is after ISO9660 size (suggested)
'//    TRUE : Ignore all ISO 9660 error
'BOOL WIMAAPI WimLargeReadAspiCDImageIgnoreError(HWND hWnd,DWORD dwHost,DWORD dwTargetID,LPSTR lpFn,LPDWORD lpdwTotal,BOOL fIgnoreError);
Declare Function WimLargeReadAspiCDImageIgnoreError Lib "wimadll.dll" (ByVal hWnd As Long, _
                               ByVal dwHost As Long, ByVal dwTarget As Long, _
                               ByVal lpFn As String, lpdwTotal As Long, _
                               ByVal fIgnoreError As Boolean) As Boolean

Declare Function WimLargeReadAspiCDImageIgnoreErrorCB Lib "wimadll.dll" (ByVal hWnd As Long, _
                               ByVal pEventNotifCallBack As Long, ByVal lpUsrParam As Long, _
                               ByVal dwHost As Long, ByVal dwTarget As Long, _
                               ByVal lpFn As String, lpdwTotal As Long, _
                               ByVal fIgnoreError As Boolean) As Boolean




'// return value != 0 if WimLargeReadLargeIma can be used with CDRom
'// (elsewhere, only hard disk partition)
'DWORD WIMAAPI WimLargeIsReadImaIsoPossible();
Declare Function WimLargeIsReadImaIsoPossible Lib "wimadll.dll" () As Long

'// Read Disk partition to image
'//  cDrive : disk letter ('C' for disk C:...)
'//  lpdwTotal : will receive number of byte processed
'//  caRead : USED, or ALL (ALL if you want read unused part of disk)
'BOOL WIMAAPI WimLargeReadLargeIma(HWND hWnd,char cDrive,LPSTR lpFn,LPDWORD lpdwTotal,CHOICEAPP caRead);
Declare Function WimLargeReadLargeIma Lib "wimadll.dll" (ByVal hWnd As Long, _
                               ByVal cDrive As Byte, _
                               ByVal lpFn As String, _
                               lpdwTotal As Long, _
                               ByVal caRead As Long) As Boolean

Declare Function WimLargeReadLargeImaCB Lib "wimadll.dll" (ByVal hWnd As Long, _
                               ByVal pEventNotifCallBack As Long, ByVal lpUsrParam As Long, _
                               ByVal cDrive As Byte, _
                               ByVal lpFn As String, _
                               lpdwTotal As Long, _
                               ByVal caRead As Long) As Boolean
'// Write Disk partition from image
'//  cDrive : disk letter ('C' for disk C:...)
'//  lpdwTotal : will receive number of byte processed
'//  caWrite : USED or ALL
'//  fCheckDiskBeforeWrite : if you want check disk is empty
'BOOL WIMAAPI WimLargeWriteLargeIma(HIMA hIma,HWND hWnd,char cDrive,LPDWORD lpdwTotal,
'                                   CHOICEAPP caWrite,BOOL fCheckDiskBeforeWriteThis);
Declare Function WimLargeWriteLargeIma Lib "wimadll.dll" (ByVal Ima As Long, _
                               ByVal hWnd As Long, _
                               ByVal cDrive As Byte, lpdwTotal As Long, _
                               ByVal caWrite As Long, ByVal fCheckDiskBeforeWriteThis As Boolean) As Boolean

Declare Function WimLargeWriteLargeImaCB Lib "wimadll.dll" (ByVal Ima As Long, _
                               ByVal hWnd As Long, _
                               ByVal pEventNotifCallBack As Long, ByVal lpUsrParam As Long, _
                               ByVal cDrive As Byte, lpdwTotal As Long, _
                               ByVal caWrite As Long, ByVal fCheckDiskBeforeWriteThis As Boolean) As Boolean


'// say if a letter if a CDRom
'BOOL WIMAAPI WimLargeIsIsoCDDrive(char cDrive);
Declare Function WimLargeIsIsoCDDrive Lib "wimadll.dll" (ByVal cDrive As Byte) As Boolean

'// Write the boot sector of an image
'BOOL WIMAAPI WriteSectBoot(HIMA hIma,const BYTE* lpBuf,DWORD dwSizeBuf);
Declare Function WriteSectBoot Lib "wimadll.dll" (ByVal Ima As Long, _
                     ByVal lpBuf As String, _
                     ByVal dwSizeBuf As Long) As Boolean

'// Read the boot sector of an image
'BOOL WIMAAPI GetSectBoot(HIMA hIma,LPBYTE lpBuf,DWORD dwSizeBuf,LPDWORD lpdwSizeBoot);
Declare Function GetSectBoot Lib "wimadll.dll" (ByVal Ima As Long, _
                     ByVal lpBuf As String, _
                     ByVal dwSizeBuf As Long, lpdwSizeBoot As Long) As Boolean



' // Get the total size of an image
' BOOL WIMAAPI GetImageSize(HIMA hIma,LPDWORD lpdwLow,LPDWORD lpdwHigh)
Declare Function GetImageSize Lib "wimadll.dll" (ByVal Ima As Long, _
                     lpdwLow As Long, lpdwHigh As Long) As Boolean

' // Get the free space in an image
' BOOL WIMAAPI GetFreeSpaceInImage(HIMA hIma,LPDWORD lpdwLow,LPDWORD lpdwHigh)
Declare Function GetFreeSpaceInImage Lib "wimadll.dll" (ByVal Ima As Long, _
                     lpdwLow As Long, lpdwHigh As Long) As Boolean

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -