Jump to content
Sign in to follow this  
goldenix

Does it really take 136 Hours to loop 3144108000 times?

Recommended Posts

goldenix

So Hire it is, my personal memory scanner sample. If I use CE to do the first scan it takes 1 second, at worst 10 seconds.

With this scanner hire, 136+ Hours.

Now the question is: did I screw up with the time difference & conversion from KB to bytes.? The wiki says 1KB = 1000 & 1 KB = 1024. so witch is it?

And if I want to convert my memory into bytes its Memory *100 tight?

CTRL+F & search for TimerInit & MemGetStats

#cs ----------------------------------------------------------------------------
 AutoIt Version: 3.3.6.0
 Author:         goldenix

    Script Function:    Scan Memory
    Remarks:            Hit ALT+ ESC to abort scan, show array & exit

                        Total Memory in Bytes 3144108000
#ce ----------------------------------------------------------------------------
#include <NomadMemory.au3>
#include <Array.au3>

HotKeySet("!{esc}", "_exit")    ; Alt ESC to exit
;~ ------------------------------------------------------------

;## Create 2 Arrays
Dim $avArray_1[2][2] ;2 Rows & 2 columns at the beginning
;~ ------------------------------------------------------------
Global $iv_Pid      = ProcessExists ( "firefox.exe" )
Global $MemoryOpen  = _MemoryOpen($iv_Pid)

Global $mem         = MemGetStats()
Global $Bytes       = stringreplace($mem[1]*1000,'.','')

ConsoleWrite('Total Memory in Bytes: ' & $Bytes & @CRLF)

Global $xxx = 1
Global $i
;~ ------------------------------------------------------------


For $i = 1 to $Bytes ; until total memory is scanned probably....

$begin = TimerInit(); check how long will it take to scan memory
;~  ---------------------------------------------------------------------
    $Address = _DecimalToHex($i,8)

    $Value = _MemoryRead('0x' & $Address, $MemoryOpen)

    $filter = _Flter($Value) ; 1=put to array, 0 Skip $Mem_Read value

    If $filter = 1 Then __ArrayAdd($Address, $Value)
;~  ---------------------------------------------------------------------
$dif = TimerDiff($begin)
ConsoleWrite('Time to scan memory in Hours:' & $dif/1000*$Bytes/60/60 & @CRLF)
_exit()

Next
_ArrayDisplay($avArray_1, "$avArray")


;~ ==================================
;## First scan
;~ ==================================
Func __ArrayAdd($Address, $Value)

    $iRow = UBound($avArray_1)      ;Get array lenght
    $iCol = UBound($avArray_1, 2)   ;Need this line to redim the colums

    $avArray_1[$xxx][0] = $Address
    $avArray_1[$xxx][1] = $Value

;~  ConsoleWrite($Address & ' ' & $Value & @CRLF)
    ReDim $avArray_1[$iRow + 1][$iCol]  ; add more rows +1

    $xxx = $xxx +1
EndFunc


;~ ==================================
;## Filter out values we are looking for
;~ ==================================
Func _Flter($Value)
    If $Value > 1 And $Value < 300  Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc


Func _exit()
    _MemoryClose($MemoryOpen)
     _ArrayDisplay($avArray_1, "$avArray")
    Exit
EndFunc


; #FUNCTION# ==============================================================
; Function Name..: _DecToHex ( expression [, length] )
; Description ...: Returns a string representation of an integer converted to hexadecimal.
; Parameters ....: expression   - The integer to be converted to hexadecimal.
;                               - [optional] Number of characters to be returned (no limit).
;                                 If no length specified, leading zeros will be stripped from result.
; Return values .: Success      - Returns a string of length characters representing a hexadecimal expression, zero-padded if necessary.
;                  Failure      - Returns "" (blank string) and sets @error to 1 if expression is not an integer.
; Author ........: jennico (jennicoattminusonlinedotde)
; Remarks .......: Output format "FFFF".
;               The function will also set @error to 1 if requested length is not sufficient - the returned string will be left truncated.
;               Be free to modify the function to be working with binary type input - I did not try it though.
;               current AutoIt Hex() limitation: 0xFFFFFFFF (4294967295).
; Related .......: Hex(), Dec(), _HexToDec()
; =======================================================================
Func _DecimalToHex($hx_dec, $hx_length = 21)

    Local $HX_REF="0123456789ABCDEF"

    If IsInt($hx_dec) = 0 Then
        SetError(1)
        MsgBox(0,"Error","Wrong input, try again ...")
        Return ""
    EndIf
    Local $ret = "", $Ii, $hx_tmp, $hx_max
    If $hx_dec < 4294967296 Then
        If $hx_length < 9 Then Return Hex($hx_dec, $hx_length)
        If $hx_length = 21 Then
            $ret = Hex($hx_dec)
            While StringLeft($ret, 1) = "0"
                $ret = StringMid($ret, 2)
            WEnd
            Return $ret
        EndIf
    EndIf
    For $Ii = $hx_length - 1 To 0 Step -1
        $hx_max = 16 ^ $Ii - 1
        If $ret = "" And $hx_length = 21 And $hx_max > $hx_dec Then ContinueLoop
        $hx_tmp = Int($hx_dec/($hx_max+1))
        If $ret = "" And $hx_length = 21 And $Ii > 0 And $hx_tmp = 0 Then ContinueLoop
        $ret &= StringMid($HX_REF, $hx_tmp+1, 1)
        $hx_dec -= $hx_tmp * ($hx_max + 1)
    Next
    $ret=String($ret)
    If $hx_length < 21 And StringLen($ret) < $hx_length Then SetError(1)
    Return $ret
EndFunc  ;==>_DecToHex()
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
somdcomputerguy

While K (short for kilo) stands for 1000, there is actually 1024 bytes in a kilobyte (KB).

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
darkjohn20

You're doing it wrong. You can't scan every address, or it will take ages. You must scan large chunks and evaluate those. Call MemoryRead as LITTLE as possible.

Here's a post of mine that may help.

http://forum.cheatengine.org/viewtopic.php?t=484818

Share this post


Link to post
Share on other sites
trancexx

NomadMemory.au3 is one of the stupidest things I saw written in AutoIt.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
darkjohn20

Really? I find it extremely useful.

Share this post


Link to post
Share on other sites
JohnOne

I tried doing this once and wound up with the same old scabby problem of it taking ages, afterreading, it seemed you need to create some sort of buffer, load a bucket full off addresses into it and process it like that.

Anyway, to shorten my story, It was way over my head, so I just automated cheat engine :idea:


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
trancexx

Really? I find it extremely useful.

You wouldn't be the only one. That file is obviously very well known.

I just can't figure why? What's so special about it? It's for example badly written and it's also completely unnecessary.

Enigma.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
evilertoaster

You wouldn't be the only one. That file is obviously very well known.

I just can't figure why? What's so special about it? It's for example badly written and it's also completely unnecessary.

Enigma.

It was based on w0uter's functions which where inherently a bit hack-ish since native language support for doing it easier didn't exist, (DLLCall and DLLStruct functions were still a little buggy). Being the (one of the) first counts for a lot, even if it aint the best.

Share this post


Link to post
Share on other sites
trancexx

It was based on w0uter's functions which where inherently a bit hack-ish since native language support for doing it easier didn't exist, (DLLCall and DLLStruct functions were still a little buggy). Being the (one of the) first counts for a lot, even if it aint the best.

We are talking about programming here, not having sex.

Being the first one means nothing. If there are better ways, don't use bad ways.

Though, I'm sure majority of the people using NomadMemory.au3 wouldn't understand what I just said. Never mind, I'll just say it few more times.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
martin

We are talking about programming here, not having sex.

Being the first one means nothing. If there are better ways, don't use bad ways.

Though, I'm sure majority of the people using NomadMemory.au3 wouldn't understand what I just said. Never mind, I'll just say it few more times.

Why be so cryptic trancexx? If you want to persuade people you need to give some reasoning. I have used Nomadmemory myself and what I remember about it is that it worked. To me, that is the first requirement of a tool. The second requirement is that it is reliable and safe, the third that it is easy to use, the forth that it is easy to change. If it meets those tests then it how it's written is not so important, and if it meets those tests then why is it so stupid? Presumably because you see some fault which can cause problems. So we need to know don't we?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
trancexx

Why be so cryptic trancexx? If you want to persuade people you need to give some reasoning. I have used Nomadmemory myself and what I remember about it is that it worked. To me, that is the first requirement of a tool. The second requirement is that it is reliable and safe, the third that it is easy to use, the forth that it is easy to change. If it meets those tests then it how it's written is not so important, and if it meets those tests then why is it so stupid? Presumably because you see some fault which can cause problems. So we need to know don't we?

You said if it meets those.

If we are talking about the same file then:

  • It may work an it may not work. Too many things are left to influence that.
  • It is not reliable. It's not safe.
  • It's made hard to change considering how it could have been made.

I wouldn't know about easy usage. I never tried it.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
martin

You said if it meets those.

If we are talking about the same file then:

  • It may work an it may not work. Too many things are left to influence that.
  • It is not reliable. It's not safe.
  • It's made hard to change considering how it could have been made.

I wouldn't know about easy usage. I never tried it.

Ok, but can you tell us why it's not reliable or safe?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
trancexx

Ok, but can you tell us why it's not reliable or safe?

You are playing psychology with me.

In that manner the answer would be, because it's written that way.

You should use standard _Winapi... functions for safety.

For reliability you would write functions yourself.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Juvigy

You say there is a better way - please educate us.

90% of the people that use it dont know there is a better way.

Share this post


Link to post
Share on other sites
AndyG

 

90% of the people that use it dont know there is a better way.

Are you joking? 90% of people who use it know anything about it!

Yes, it´s one of the quick´n dirty tools, mostly used by some "kiddies" to write Gamebot Scripts. And that's the reason why questions like the topic are written. 

Btt: trancexx gave you more then one hint....

Edited by AndyG

Share this post


Link to post
Share on other sites
Juvigy

Yes , i got him , but dont understand why he doesnt give examples and exact information

instead of hints and tricky pointers.If he post some examples and exact info we can compare

the nomadmemory and the other methods and say: "this is 5 times faster" , "this is so much easier to use" etc.

This is not only used by kids for bots.Unfortunately i havent used nor nomadmemory nor other methods yet so i cant post any examples.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×