Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-25-2005, 08:56
Warren
 
Posts: n/a
help with visual basic and API

I'm creating a program through VB 6 that monitors file access (aka if someone's been messing with your stuff). Basically it involves choosing the files to be monitored, obtaining properties such as file size, last modified, last accessed, etc. and running that information through the md5 algorithm to create a default hash. The properties will be hashed every x minutes and compared to the default hashes, and if any differences occur a message box/email/phone message will be sent to the computer's administrator. I tried to use API calls but I'm lost. Here is what I have so far. It seems I can't run those calls even though I put in the code...its really frustrating.

Code:
Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type

Public Declare Function GetFileSize Lib "kernel32.dll" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long

Public Declare Function GetFileTime Lib "kernel32.dll" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As Long

Private Declare Function MakeMD5Digest _
Lib "di_MD5DLL.dll" _
(ByVal sData As String, ByVal sDigest As String) As Long

Public Function MD5HexDigest(sData As String) As String
Dim iRet As Long
Dim sDigest As String
' Set sDigest to be 32 chars
sDigest = String(32, " ")
iRet = MakeMD5Digest(sData, sDigest)
MD5HexDigest = Trim(sDigest)
End Function


Private Sub cmdRun_Click()

Dim FileInfo As String
Dim StandardComp As String
Dim Size As String
Dim lastacc As String

Size = GetFileSize(txtFolder.Text)
lastacc = GetFileTime(txtFolder.Text)
FileInfo = Size + lastacc
StandardComp = MD5HexDigest(FileInfo)

End Sub

Private Sub Command1_Click()
listFolders.AddItem txtFolder.Text
End Sub
'thats just to add file names to a list box.
I just want to make the md5 compare itself to StandardComp every x minutes and alert if they arent equal.

Help would be great from anyone.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual basic decompiler Zeocrack General Discussion 3 11-24-2022 04:38
[HELP] Visual Basic dll protection Maltese General Discussion 12 08-13-2005 19:05


All times are GMT +8. The time now is 04:54.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )