You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
First of all, Thanks for managing this project.
I tested on assessing the capability of the Windows Defender as VBA on EXCEL. and this project was the most helpful to me. but I found some issues with PE file validation.
The validation routine was perfect but when parsing the file to memory I saw an error occurred.
Fortunately, given my efforts, I was able to resolve the issues. so let me show you my code could you give me PR authority?
The text was updated successfully, but these errors were encountered:
' --------------------------------------------------------------------------------' Method: FileToByteArray' Desc: Reads a file as a Byte array' Arguments: strFilename - Fullname of the file as a String (ex:' 'C:\Windows\System32\cmd.exe')' Returns: The content of the file as a Byte array' --------------------------------------------------------------------------------PrivateFunctionFileToByteArray(strFilename AsString) AsByte()
' File content to StringDim strFileContent AsStringDim iFile AsInteger: iFile = FreeFile
Open strFilename For Binary Access Read As #iFile
strFileContent = Space(FileLen(strFilename))
Get #iFile, , strFileContent
Close #iFile
' String to Byte arrayDim baFileContent() AsByte
baFileContent = StrConv(strFileContent, vbFromUnicode)
FileToByteArray = baFileContent
End Function
Here is where the problem occurs, invisible characters cannot be accurately restored to binary data, you can try to read binary data directly. I have never written vb before, the code is for reference purposes only.
PrivateFunctionFileToByteArray(strFilename AsString) AsByte()
Dim baFileContent() AsByteDim iFile AsInteger: iFile = FreeFile
Open strFilename For Binary Access Read As #iFile
ReDim baFileContent(0To LOF(iFile) - 1)
Get #iFile, , baFileContent
Close #iFile
FileToByteArray = baFileContent
End Function
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
First of all, Thanks for managing this project.
I tested on assessing the capability of the Windows Defender as VBA on EXCEL. and this project was the most helpful to me. but I found some issues with PE file validation.
The validation routine was perfect but when parsing the file to memory I saw an error occurred.
Fortunately, given my efforts, I was able to resolve the issues. so let me show you my code could you give me PR authority?
The text was updated successfully, but these errors were encountered: