Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Barabajagal on February 22, 2008, 02:14 PM

Title: I feel stupid
Post by: Barabajagal on February 22, 2008, 02:14 PM
Private Declare Function CheckRevisionB Lib "CheckRevision.dll" (ByVal GameEXE As String, ByVal GameStorm As String, ByVal GameBattle As String, ByVal CRevRequest As String, ByRef EXEVersion As Long, ByRef Checksum As Long, ByVal CRevResult As String, ByVal CRevDLL As String) As Long

Public Sub TestCRev()
Dim sGameEXE    As String
Dim sGameStorm  As String
Dim sGameBattle As String
Dim sCRevReq    As String
Dim sDLLName    As String
Dim lEXEVer     As Long
Dim lChecksum   As Long
Dim sCrevRet    As String
Dim CRet        As Long
    sGameEXE = "C:\Program Files\Diablo II\Game.exe"
    sGameStorm = "C:\Program Files\Diablo II\Bnclient.dll"
    sGameBattle = "C:\Program Files\Diablo II\D2client.dll"
    sCRevReq = "A=166443184 B=361259356 C=197717253 4 A=A-S B=B-C C=C+A A=A+B"
    sDLLName = "ver-IX86-7.dll"
    CRet = CheckRevisionB(sGameEXE, sGameStorm, sGameBattle, sCRevReq, lEXEVer, lChecksum, sCrevRet, sDLLName)
    Debug.Print CRet & ": " & Hex$(lEXEVer) & " " & Hex$(lChecksum) & " " & sCrevRet
End Sub

Every time I run this, it crashes, saying
"AppName: vb6.exe    AppVer: 6.0.97.82    ModName: checkrevision.dll
ModVer: 1.0.0.5    Offset: 00004a69r"

I can't figure out what's wrong for the life of me.
Title: Re: I feel stupid
Post by: brew on February 22, 2008, 02:37 PM
/me wonders if the dll likes writing to 0 length strings
Title: Re: I feel stupid
Post by: Barabajagal on February 22, 2008, 02:41 PM
Oh... Duh. I knew I was gonna hate myself for not knowing this.
Title: Re: I feel stupid
Post by: UserLoser on February 24, 2008, 02:58 PM
checkrevision export is stdcall?
Title: Re: I feel stupid
Post by: Barabajagal on February 24, 2008, 03:10 PM
(This is Rob's DLL)