Jump to content

new _Mem functions


w0uter
 Share

Recommended Posts

Do I have to write it as a hex though? I would like to have a GUI Input Ctrl with a number And just do:

_MemWrite( $Mem, 0x000000,_MemCreate(GuiCtrlRead($Input1)))

How am i supposed to do that? Do I need to convert the number to something first? I'm confused :o

Hallman

yes, i think you have to convert it to hex. it seems that _MemCreate accepts only strings or a sequence of bytes.

i think this would work:

$in = 2000
$h = hex( $in, 8 )
dim $arrBytes[4]
$i = 0
while $i < UBound( $arrBytes )
    $arrBytes[$i] = Int( '0x' & StringLeft( $h, 2 ) ); int() to make sure it won't be passed to _MemCreate as string
    $h = StringTrimLeft( $h, 2 )
    $i += 1
wend
_MemWrite( $mem, $addr, _MemCreate( $arrBytes[0], $arrBytes[1], $arrBytes[2], $arrBytes[3] ) )

i'm not too sure about the byte order though. if it doesn't work, try passing $arrBytes[3]->$arrBytes[0] to _MemCreate.

Link to comment
Share on other sites

yes, i think you have to convert it to hex. it seems that _MemCreate accepts only strings or a sequence of bytes.

i think this would work:

$in = 2000
$h = hex( $in, 8 )
dim $arrBytes[4]
$i = 0
while $i < UBound( $arrBytes )
    $arrBytes[$i] = Int( '0x' & StringLeft( $h, 2 ) ); int() to make sure it won't be passed to _MemCreate as string
    $h = StringTrimLeft( $h, 2 )
    $i += 1
wend
_MemWrite( $mem, $addr, _MemCreate( $arrBytes[0], $arrBytes[1], $arrBytes[2], $arrBytes[3] ) )

i'm not too sure about the byte order though. if it doesn't work, try passing $arrBytes[3]->$arrBytes[0] to _MemCreate.

Yep Works Good. You do need to switch the order of the bytes the other way 'round for it to work.

Thanks Alot, Iv'e been waiting for this a long time :o

Hallman

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • Moderators

These codes dont work for me inAutoIt 3.1.1.

undefined functions DllStructDelete and DllStructCreate

Those are AutoIt Beta Options... If you look in the realeased help file, you won't find them, Here is the link to download Beta: http://www.autoitscript.com/forum/index.php?showtopic=19717

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Those are AutoIt Beta Options.....

Thanks I'm further along now, i can read just fine.

I want to inject code like: 0x89, 0x08, 0x89, 0x0D, 0x60, 0x08, 0x01, 0x00, 0x50, 0x8B, 0xCE

how do i use _MemWrite+_MemCreate for these hex values? or do i not use _memcreate at all? send an array? i'm slightly confused.

this did not seem to work as expected: _MemWrite( $h_open, 0x108A0, _MemCreate(0x89, 0x08, 0x89, 0x0D, 0x60, 0x08, 0x01, 0x00, 0x50, 0x8B, 0xCE ) )

Edited by Ster
Link to comment
Share on other sites

_MemWrite( $h_open,0x108A0, _MemCreate(0x89, 0x08, 0x89, 0x0D, 0x60, 0x08, 0x01, 0x00, 0x50, 0x8B, 0xCE ) )

The one in Bold, doesn't look like a proper address. So you would (Probably) do 0x000108A0, i'm not sure though, because once i done it (less then 8 chars), it didn't work.

Edited by NegativeNrG

[size=20]My File Upload[/size]Register at my site and upload.

Link to comment
Share on other sites

This is an absolutely necessary function for us gamers.

Being able simply to read values from a client program is an indispensable function. Although finding the values to read is a tedious process, having a macro know exactly how many HP you have and how much life your target has left... these are very cool things.

_memRead at least should be included in the next release.

Link to comment
Share on other sites

_MemWrite( $h_open,0x108A0, _MemCreate(0x89, 0x08, 0x89, 0x0D, 0x60, 0x08, 0x01, 0x00, 0x50, 0x8B, 0xCE ) )

The one in Bold, doesn't look like a proper address. So you would (Probably) do 0x000108A0, i'm not sure though, because once i done it (less then 8 chars), it didn't work.

Okay i found out it's wrong hex vales, so does that mean i used the _MemCreate function correctly if only i had good data?

--------

EDIT -- IT ALL WORKS, TY!

Edited by Ster
Link to comment
Share on other sites

edit: Basically what I'm doing is writing a game bot that reads HP from targets. I have the hotkeys set up, the memory values hacked, now it's just a matter of writing a function for each action in game and a basic AI to control those actions.

Figured out what I was looking for

Edited by Jrowe
Link to comment
Share on other sites

  • 3 weeks later...

Quick question for you all... I understand the _memread i've already put it to use.. but does anyone have a working example of how you'd write to a adress

after you've read it?

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Func Health()
    $h_open = _MemOpen($pid)
    $currentHealth = Int(_MemRead($h_open,IniRead("SLB.ini","memory","currentHealth",0),4))
    $maxHealth = Int(_MemRead($h_open,IniRead("SLB.ini","memory","maxHealth",0),4))
    $Healthpercent = $currentHealth/$maxHealth*100
    _MemClose($h_open)
    
    Return $Healthpercent
EndFunc

Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...