Adam Caudill

Security Leader, Researcher, Developer, Writer, & Photographer

  • ZipSight 2004.1 Released

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. Imspire’s smallest product has just received an update. After a couple days of implementing a new registration system and cleaning up the code, the latest ZipSight is ready for public review.


  • Simple INI API

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. While storing settings in a INI file is no longer in vogue, so developers (including myself) still find value in this old method of save a program’s settings. The advantages of using INI files instead of the system registry may be numerous, one of the main reasons I use it is portability, by saving a single file I can move the entire settings for my program to any other computer.

    Read more…

  • Get CPU Speed

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. This was created as a request on a forum I’m on, it queries the registry for the speed of the first CPU, adjusting for multiple CPU support would be simple. Option Explicit Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" ( _ ByVal hKey As Long, _ ByVal lpSubKey As String, _ phkResult As Long _ ) As Long Private Declare Function RegQueryValueEx Lib "advapi32.

    Read more…

  • Get Default Mail Client

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. This is another code example made by request for a forum member, it simply retrieves the default value from HKEY_CLASSES_ROOT\mailto\shell\open\command which should be the default mail client. Option Explicit Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" ( _ ByVal hKey As Long, _ ByVal lpSubKey As String, _ phkResult As Long _ ) As Long Private Declare Function RegQueryValueEx Lib "advapi32.

    Read more…

  • Simple String Hashing

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. This is a very basic form of hashing algorithm, mainly created to use as an example, and it shouldn’t be considered secure, while it should be virtually impossible to reverse, if you are looking for a truly secure hashing algorithm for production use, look at using a SHA family hash, as they have been exhaustively tested and proven to work.

    Read more…

  • APISettings

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. Visual Basic provides a less than elegant method of saving data in the Windows registry, the GetSetting & SaveSetting functions. These functions store setting in HKEY_CURRENT_USER\Software\VB and VBA Program Settings\<AppName>\<Section> not very pretty is it? The APISettings module is a drop-in replacement using pure Win32 API for its processing power and increased stability. The reason for developing this and for making it drop-in compatible is to all those new to the Win32 API to add its functionality with minimal difficulty.

    Read more…

  • Conexant (formerly Rockwell) Softmodem HSF Modem

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. I was actually rather lucky to have this brand of WinModem, as the good people over at Linuxant.com offer a very high quality driver that makes installation a breeze! But, they have recently changed their marketing methods and charge $15 for the driver, so these really lives no viable, free alternative (a rarity to say the least for linux).

    Read more…

  • IsOnline

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. This is a simple function that checks to see if you’re online… API: Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" Alias "InternetGetConnectedStateExA" ( _ lpdwFlags As Long, _ lpszConnectionName As Long, _ dwNameLen As Long, _ ByVal dwReserved As Long) As Long Function: Public Function IsOnline() As Boolean Dim lNameLen As Long Dim lRetVal As Long Dim lConnectionFlags As Long Dim LPTR As Long Dim lNameLenPtr As Long Dim sConnectionName As String sConnectionName = Space$(256) lNameLen = 256 LPTR = StrPtr(sConnectionName) lNameLenPtr = VarPtr(lNameLen) lRetVal = InternetGetConnectedStateEx(lConnectionFlags, ByVal LPTR, ByVal lNameLen, 0& ) IsOnline = (lRetVal <> 0) End Function Returns true if you’re online, otherwise returns false.

    Read more…

  • PageSource

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. Here is a quick little function to retrieve the source code of a web page, it’s pure API, so no Internet Transfer control required. API: Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" ( _ ByVal sAgent As String, _ ByVal lAccessType As Long, _ ByVal sProxyName As String, _ ByVal sProxyBypass As String, _ ByVal lFlags As Long) As Long Private Declare Function InternetOpenUrl Lib "wininet.

    Read more…

  • SetFocusByCaption

    This post was imported from an old blog archive, and predates the creation of AdamCaudill.com. This is a simple function really, it just sets the focus to a window based on its caption. API: Private Declare Function SetForegroundWindow Lib "user32" ( _ ByVal hwnd As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As Any, _ ByVal lpWindowName As Any) As Long Function: Public Function SetFocusByCaption(strCaption As String) As Boolean Dim lngHandle As Long Dim lngResult As Long lngHandle = FindWindow(vbNullString, strCaption) If lngHandle <> 0 Then lngResult = SetForegroundWindow(lngHandle) If lngResult = 0 Then SetFocusByCaption = False Else SetFocusByCaption = True End If Else SetFocusByCaption = False End If End Function Returns True/False based on success.

    Read more…