Get InternalName and OriginalName from DLL
;------------------------------------------------------------------------------------------------------------------------------------------
; Get InternalName and OriginalFilename from DLLs in WinBatch System folder.
;
; Detlev Dalitz.20051208
;------------------------------------------------------------------------------------------------------------------------------------------

BoxOpen ("", "")

sOut = StrCat (TimeYmdHms (), @LF, @LF)

sucOriginal = ChrStringToUnicode ("OriginalFilename")
shexOriginal = StrCat (ChrUnicodeToHex (sucOriginal), "0000") ; zero ending string.
iLenByteOriginal = StrLen (shexOriginal) / 2

sucInternal = ChrStringToUnicode ("InternalName")
shexInternal = StrCat (ChrUnicodeToHex (sucInternal), "0000") ; zero ending string.
iLenByteInternal = StrLen (shexInternal) / 2

sFolder = DirHome ()
sFile_Mask = "*.dll"

sFileList = FileItemize (StrCat (sFolder, sFile_Mask))
sFileList = ItemSort (sFileList, @TAB)
iCount = ItemCount (sFileList, @TAB)

For ii = 1 To iCount
   sFilename = ItemExtract (ii, sFileList, @TAB)
   sFilename = StrCat (sFolder, sFilename)
   iFileSize = FileSizeEx (sFilename)
   sFileDateTime = FileTimeGet (sFilename)
   sMsg = StrCat ("Filename: ", sFilename)
   sMsg = StrCat (sMsg, @LF, "FileSize: ", iFileSize)
   sMsg = StrCat (sMsg, @LF, "DateTime: ", sFileDateTime)
   BoxText (sMsg)

   iFilesize = FileSize (sFilename)
   If !iFilesize Then Return (@FALSE)

   hBB = BinaryAlloc (iFilesize)
   iBBsize = iFilesize + 0
   hBB = BinaryAlloc (iBBsize)

   iResult = BinaryRead (hBB, sFilename)

   iStart = BinaryIndexBin (hBB, BinaryEodGet (hBB) - 1, shexOriginal, @BACKSCAN, @FALSE)
   iStart = iStart + iLenByteOriginal
   sOriginalFilename = BinaryPeekStrW (hBB, iStart, 100)

   iStart = BinaryIndexBin (hBB, BinaryEodGet (hBB) - 1, shexInternal, @BACKSCAN, @FALSE)
   iStart = iStart + iLenByteInternal
   sInternalFilename = BinaryPeekStrW (hBB, iStart, 100)

   iResult = BinaryFree (hBB)

   sMsg = StrCat (sMsg, @LF, "Internal: ", sInternalFilename)
   sMsg = StrCat (sMsg, @LF, "Original: ", sOriginalFilename)
   BoxText (sMsg)

   sOut = StrCat (sOut, sMsg, @LF, @LF)

Next

sOut = StrCat (sOut, TimeYmdHms ())
sOut = StrReplace (sOut, @LF, @CRLF)
ClipPut (sOut)

BoxShut ()

Exit