Register for your free account! | Forgot your password?

You last visited: Today at 18:53

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



help!

Discussion on help! within the AutoIt forum part of the Coders Den category.

Reply
 
Old 10/26/2013, 11:17   #16
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
@KDeluxe *your* base is exactly the same as the NomadMemory..

anyways;
Code:
#RequireAdmin

#include <NomadMemory.au3>

Func _MemoryModuleGetBaseAddress($iPID, $sModule)
    If Not ProcessExists($iPID) Then Return SetError(1, 0, 0)

    If Not IsString($sModule) Then Return SetError(2, 0, 0)

    Local $PSAPI = DllOpen("psapi.dll")

    ;Get Process Handle
    Local $hProcess
    Local $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020) ; CREATE_THREAD, QUERY_INFORMATION, VM_OPERATION, VM_READ, VM_WRITE

    If $iPID > 0 Then
        Local $hProcess = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $iPID)
        If $hProcess[0] Then
            $hProcess = $hProcess[0]
        EndIf
    EndIf

    ;EnumProcessModules
    Local $Modules = DllStructCreate("ptr[1024]")
    Local $aCall = DllCall($PSAPI, "int", "EnumProcessModules", "ptr", $hProcess, "ptr", DllStructGetPtr($Modules), "dword", DllStructGetSize($Modules), "dword*", 0)
    If $aCall[4] > 0 Then
        Local $iModnum = $aCall[4] / 4
        Local $aTemp
        For $i = 1 To $iModnum
            $aTemp = DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ptr", $hProcess, "ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
            If $aTemp[3] = $sModule Then
                DllClose($PSAPI)
                Return Ptr(DllStructGetData($Modules, 1, $i))
            EndIf
        Next
    EndIf

    DllClose($PSAPI)
    Return SetError(-1, 0, 0)

EndFunc

$proc = ProcessExists("League of Legends.exe")
$module = "League of Legends.exe"
$access = _MemoryOpen($proc)
$addr = _MemoryModuleGetBaseAddress($proc, $module) + 0x2A42A00
$result = _MemoryRead($addr, $access, "float")
ConsoleWrite($result & @CRLF)
_MemoryClose($access)
berkay2578 is offline  
Thanks
1 User
Old 10/26/2013, 12:26   #17
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
Quote:
Originally Posted by berkay2578 View Post
@KDeluxe *your* base is exactly the same as the NomadMemory..

anyways;
Code:
#RequireAdmin

#include <NomadMemory.au3>

Func _MemoryModuleGetBaseAddress($iPID, $sModule)
    If Not ProcessExists($iPID) Then Return SetError(1, 0, 0)

    If Not IsString($sModule) Then Return SetError(2, 0, 0)

    Local $PSAPI = DllOpen("psapi.dll")

    ;Get Process Handle
    Local $hProcess
    Local $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020) ; CREATE_THREAD, QUERY_INFORMATION, VM_OPERATION, VM_READ, VM_WRITE

    If $iPID > 0 Then
        Local $hProcess = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $iPID)
        If $hProcess[0] Then
            $hProcess = $hProcess[0]
        EndIf
    EndIf

    ;EnumProcessModules
    Local $Modules = DllStructCreate("ptr[1024]")
    Local $aCall = DllCall($PSAPI, "int", "EnumProcessModules", "ptr", $hProcess, "ptr", DllStructGetPtr($Modules), "dword", DllStructGetSize($Modules), "dword*", 0)
    If $aCall[4] > 0 Then
        Local $iModnum = $aCall[4] / 4
        Local $aTemp
        For $i = 1 To $iModnum
            $aTemp = DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ptr", $hProcess, "ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
            If $aTemp[3] = $sModule Then
                DllClose($PSAPI)
                Return Ptr(DllStructGetData($Modules, 1, $i))
            EndIf
        Next
    EndIf

    DllClose($PSAPI)
    Return SetError(-1, 0, 0)

EndFunc

$proc = ProcessExists("League of Legends.exe")
$module = "League of Legends.exe"
$access = _MemoryOpen($proc)
$addr = _MemoryModuleGetBaseAddress($proc, $module) + 0x2A42A00
$result = _MemoryRead($addr, $access, "float")
ConsoleWrite($result & @CRLF)
_MemoryClose($access)
true lol
fear-x is offline  
Old 10/27/2013, 23:11   #18
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
Quote:
Originally Posted by berkay2578 View Post
@KDeluxe *your* base is exactly the same as the NomadMemory..
You can compare the NomadMemory.au3 with my KDMemory.au3. Both are using the same functions from the Kernel32.dll but there are differences. You may be too ignorant to notice it. Don't say it's the same if you don't know it. It's not the same.
KDeluxe is offline  
Old 10/28/2013, 13:40   #19
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
Quote:
Originally Posted by KDeluxe View Post
You can compare the NomadMemory.au3 with my KDMemory.au3. Both are using the same functions from the Kernel32.dll but there are differences. You may be too ignorant to notice it. Don't say it's the same if you don't know it. It's not the same.
Pardon me? All you did was add pointer support to everything and use MSDN definitions instead of calling a modified one.. which is completely gibberish.
berkay2578 is offline  
Old 11/04/2013, 17:11   #20
 
elite*gold: 0
Join Date: Sep 2012
Posts: 40
Received Thanks: 25
and the offset, for example minesweeper.exe + AAA38
offset = 0x120
DrexonPl2 is offline  
Old 11/05/2013, 16:46   #21
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
Code:
#RequireAdmin

#include <NomadMemory.au3>

Func _MemoryModuleGetBaseAddress($iPID, $sModule)
    If Not ProcessExists($iPID) Then Return SetError(1, 0, 0)

    If Not IsString($sModule) Then Return SetError(2, 0, 0)

    Local $PSAPI = DllOpen("psapi.dll")

    ;Get Process Handle
    Local $hProcess
    Local $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020) ; CREATE_THREAD, QUERY_INFORMATION, VM_OPERATION, VM_READ, VM_WRITE

    If $iPID > 0 Then
        Local $hProcess = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $iPID)
        If $hProcess[0] Then
            $hProcess = $hProcess[0]
        EndIf
    EndIf

    ;EnumProcessModules
    Local $Modules = DllStructCreate("ptr[1024]")
    Local $aCall = DllCall($PSAPI, "int", "EnumProcessModules", "ptr", $hProcess, "ptr", DllStructGetPtr($Modules), "dword", DllStructGetSize($Modules), "dword*", 0)
    If $aCall[4] > 0 Then
        Local $iModnum = $aCall[4] / 4
        Local $aTemp
        For $i = 1 To $iModnum
            $aTemp = DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ptr", $hProcess, "ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
            If $aTemp[3] = $sModule Then
                DllClose($PSAPI)
                Return Ptr(DllStructGetData($Modules, 1, $i))
            EndIf
        Next
    EndIf

    DllClose($PSAPI)
    Return SetError(-1, 0, 0)

EndFunc

$proc = ProcessExists("minesweeper.exe")
$module = "minesweeper.exe"
$access = _MemoryOpen($proc)
$addr = _MemoryModuleGetBaseAddress($proc, $module) + 0xAAA38
$result = _MemoryRead($addr, $access) + 0x120
ConsoleWrite($result & @CRLF) ;or Hex($result, 8)
_MemoryClose($access)
berkay2578 is offline  
Old 11/06/2013, 07:16   #22
 
elite*gold: 0
Join Date: Sep 2012
Posts: 40
Received Thanks: 25
and last:
0x0048C212 (type:long)
DrexonPl2 is offline  
Old 11/06/2013, 17:58   #23
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
Nope, not doing it. I gave you 2 examples already..
berkay2578 is offline  
Old 11/07/2013, 06:15   #24
 
elite*gold: 0
Join Date: Sep 2012
Posts: 40
Received Thanks: 25
not work:
DrexonPl2 is offline  
Old 11/07/2013, 14:48   #25
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
Maybe because your code makes absolutely no sense at all?
*sigh*

Code:
$proc = ProcessExists("S4Client.exe")
$module = "S4Client.exe"
$access = _MemoryOpen($proc)
$addr = _MemoryModuleGetBaseAddress($proc, $module) + 0x48C212
; I have no idea why are you using a while *infinite* loop but to hell with it..
While 1
	ToolTip((_MemoryRead($addr, $access)), 0, 0)
	Sleep(100)
WEnd

Func _Exit()
	_MemoryClose($access)
	Exit
EndFunc
berkay2578 is offline  
Old 11/08/2013, 13:31   #26
 
elite*gold: 0
Join Date: Sep 2012
Posts: 40
Received Thanks: 25
address: 0x0048C212
DrexonPl2 is offline  
Old 11/08/2013, 17:07   #27
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
Quote:
Originally Posted by DrexonPl2 View Post
address: 0x0048C212
you do know that the two 0's at start doesn't matter, right?
berkay2578 is offline  
Old 11/08/2013, 17:09   #28
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
berkay2578, I don't understand why you're posting every stuff for him that he could do by himself. It doesn't take a lot of time to change that script.
Try to teach people how to do it and don't do it for them. Next time they won't need your help then.
alpines is offline  
Old 11/09/2013, 08:25   #29
 
elite*gold: 0
Join Date: Sep 2012
Posts: 40
Received Thanks: 25
but it shows the value of 0 and a good address.
DrexonPl2 is offline  
Old 11/09/2013, 09:24   #30
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
Quote:
Originally Posted by alpines View Post
berkay2578, I don't understand why you're posting every stuff for him that he could do by himself. It doesn't take a lot of time to change that script.
Try to teach people how to do it and don't do it for them. Next time they won't need your help then.
I know these kind of people, they don't want to learn they just want the code..
berkay2578 is offline  
Thanks
1 User
Reply




All times are GMT +1. The time now is 18:53.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.