is this right? menu

User Tag List

Results 1 to 4 of 4
  1. #1
    joshww's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    is this right?

    ok first off let me start by saying this is my first attempt at messing with memory for wow... and im doing for a friend that is trying to learn.

    that being said.. im trying to do a basic function to get the base address.

    here is my module with the functions and such iv made.
    iv done this all blinded (meaning im just going from the knowledge i have )
    iv done this sorta stuff in other games


    Code:
    Option Explicit
    Private Const TH32CS_SNAPMODULE As Long = &H8
    Private Type MODULEENTRY32W
    dwSize As Long
    th32ModuleID As Long
    th32ProcessID As Long
    GlblcntUsage As Long
    ProccntUsage As Long
    modBaseAddr As Long
    modBaseSize As Long
    hModule As Long
    szModule(511) As Byte
    szExePath(519) As Byte
    End Type
    
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
    Private Declare Function Module32FirstW Lib "kernel32" (ByVal hSnapshot As Long, ByRef uModule As Any) As Long
    Private Declare Function Module32NextW Lib "kernel32" (ByVal hSnapshot As Long, ByRef uModule As Any) As Long
    Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
    Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
    Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
    Private Const GW_HWNDNEXT = 2
    Private Const GW_CHILD = 5
    
    Public Function GetModule(proc As String, szDllName As String)
    Dim hWnd As Long
    Dim dwPid As Long
    Dim uModule As MODULEENTRY32W, lModuleSnapshot&
    Dim Module As String
    
    hWnd = FindWindowLike(proc)
    GetWindowThreadProcessId hWnd, dwPid
    lModuleSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwPid)
    uModule.dwSize = LenB(uModule)
    
    If lModuleSnapshot > 0 Then
    If Module32FirstW(lModuleSnapshot, uModule) <> 0 Then
    Do
    Form1.Text1.Text = uModule.szModule
    If Form1.Text1.Text = szDllName Then
    GetModule = Hex(uModule.modBaseAddr)
    Exit Function
    End If
    Loop Until Module32NextW(lModuleSnapshot, uModule) = 0
    End If
    
    'Close handle of the snapshot
    CloseHandle lModuleSnapshot
    End If
    End Function
    
    Function FindWindowLike(strPartOfCaption As String) As Long
    Dim hWnd As Long
    Dim strCurrentWindowText As String
    Dim r As Integer
    
    hWnd = GetForegroundWindow
    
    Do Until hWnd = 0
    strCurrentWindowText = Space$(255)
    r = GetWindowText(hWnd, strCurrentWindowText, 255)
    strCurrentWindowText = Left$(strCurrentWindowText, r)
    'hWnd = GetWindow(hWnd, GW_CHILD)
    If InStr(1, LCase(strCurrentWindowText), LCase(strPartOfCaption)) <> 0 Then GoTo Found
    hWnd = GetWindow(hWnd, GW_HWNDNEXT)
    Loop
    
    Exit Function
    Found:
    FindWindowLike = hWnd
    End Function
    
    
    
    Public Function LongToHex(plngValue As Long) As String
        Dim a As String, b As String, c As Long, d As Long
        a = Hex$(plngValue)
        c = Len(a)
        If c < 8 Then
            d = 8 - c
            b = String$(d, "0") & a
        Else
            b = a
        End If
        LongToHex = "&H" & b
    End Function
    '&H041E3AD0
    with that being said here is my call

    Code:
    Dim test As Long
    test = GetModule("World of Warcraft", "dbghelp.dll")
    Text2 = LongToHex(test)
    now this is returning "&H041E3AD0" as the base witch does not look right to me but i could be wrong.. again im doing this blindly with out looking else where.

    now i shall address the flaming that may come, yes i know easyer in c++ and if it where for me it would be. it is for a friend and he only knows the basics right now he is learning.

    tbh iv not coded anything that messed with memory in a few years.

    Thanks for the help, nice community btw wish there was something like this when i was mucking about ages ago! Cheers

    is this right?
  2. #2
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shitstorm coming up

  3. #3
    joshww's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i fixed it i think i should not of been making it convert to hex?
    Last edited by joshww; 03-28-2011 at 09:15 AM.

  4. #4
    maclone's Avatar / Authenticator enabled
    Reputation
    2420
    Join Date
    Nov 2007
    Posts
    8,726
    Thanks G/R
    0/1029
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by joshww View Post
    ok first off let me start by saying this is my first attempt at messing with memory for wow... and im doing for a friend that is trying to learn.
    Your first attempt. And then you want to teach your friend how it's done. Right.
    This section is for advanced users. Read the section rules.


    Originally Posted by miceiken View Post
    Shitstorm coming up
    Declined.
    Zomfg. And no, don't ask. - Dombo did it.

Similar Threads

  1. I wanted to make sure I had this right..
    By Dashara in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 03-28-2008, 01:56 AM
  2. This just doesnt looks right
    By svstoned in forum World of Warcraft General
    Replies: 8
    Last Post: 11-04-2007, 07:33 PM
  3. Painful Moments (Right Section This Time)
    By goider in forum Community Chat
    Replies: 3
    Last Post: 08-24-2007, 04:44 PM
  4. this is a private server for wow right?
    By Dmoney in forum World of Warcraft General
    Replies: 2
    Last Post: 01-28-2007, 04:35 PM
All times are GMT -5. The time now is 06:31 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search