I'd like to patch several bytes in an external file. How can I do that?
Assuming that bytes' values to be used to patch together with offsets are stored in a table named tblBytesToPatch and using the function from topic "Patch byte in an external file" you can write the following function to solve the problem of patching an external file:
Public Function PatchFile()
Dim dbs As Database
Dim rst As Recordset
Dim strFilePath As String
Dim strSql As String
Set dbs = CodeDb()
strSql = "select * from [tblBytesToPatch]"
strFilePath = "c:\daisytst\libraries\smslib.mdb"
Set rst = dbs.OpenRecordset(strSql, dbOpenDynaset)
While Not rst.EOF
PatchByte strtFilePath, rst![Offset], rst![ByteValue]
rst.MoveNext
Wend
End Function
| HOME TOPICS |
Copyright © 19981999 by Shamil Salakhetdinov.
|
| Last updated: June 7, 1999
Published also here at 4TOPS: Patch several bytes in external file |
|