Jump to content

Read/Write to memory


kjmarket
 Share

Recommended Posts

I need to be able to read and write memory. It can be done in C/C++...but can it be done in AutoIT? I need to be able to Find the window, Get the process ID, and read/write to memory. I have no problems except with reading/writing to memory. Can it be done in AutoIT?

Pink Floyd - The Wall
Link to comment
Share on other sites

I did search, but the search doesnt reallt return good results. I found nothing on this.

Don't mind Valik, if you read his posting history he's pretty much always an asshole.

http://www.autoitscript.com/forum/index.php?showtopic=19329

^This appears to be a library w0uter wrote for read from and writing to memory.

Edit: Drat, Marc beat me to it.

Edited by yutt
It is a waste of energy to be angry with a man who behaves badly, just as it is to be angry with a car that won't go. - Bertrand Russell
Link to comment
Share on other sites

Don't mind Valik, if you read his posting history he's pretty much always an asshole.

Yes, I am an asshole. I'm especially an asshole when somebody can't find something that's so simple to find. Unless the search terms were "horse cat fire", there's absolutely no excuse for not being able to find one of w0uter's threads or one of the numerous other threads where somebody asked the exact same question and was pointed to one of w0uter's threads.

By the way, I find it very ironic that you would go out of your way to call me an asshole. I find it ironic because of this rant you had earlier. As far as I know, I've never spoken to you in my life yet you come out of nowhere and call me an asshole not much more than 3 hours after you've went on a rant about people being rude. Maybe you need to learn to practice what you're preaching before trying to sell it to us.

Link to comment
Share on other sites

Yes, I am an asshole. I'm especially an asshole when somebody can't find something that's so simple to find. Unless the search terms were "horse cat fire", there's absolutely no excuse for not being able to find one of w0uter's threads or one of the numerous other threads where somebody asked the exact same question and was pointed to one of w0uter's threads.

By the way, I find it very ironic that you would go out of your way to call me an asshole. I find it ironic because of this rant you had earlier. As far as I know, I've never spoken to you in my life yet you come out of nowhere and call me an asshole not much more than 3 hours after you've went on a rant about people being rude. Maybe you need to learn to practice what you're preaching before trying to sell it to us.

Sorry, I'm not going to join this little clique of attacking new AutoIT users and/or people with innocent questions.

What exactly was the purpose of your making your response to the OP? Did it make your feel important to try and make someone else feel dumb on the Internet? How about you stop making snide comments, and then I'll reconsider my opinion of you?

You're particularly bad because you have a long history on the forums and are listed as a developer. You of all people should be setting a good example and trying to foster a friendly and helpful community. Instead you're making little sarcastic quips to new users asking simple questions.

Edit: I'm not going to search your entire post history, but here are some other great examples of your manner with people politely asking questions. Maybe you really are oblivious to your complete lack of tact, if so I am sorry.

http://www.autoitscript.com/forum/index.php?showtopic=32961

http://www.autoitscript.com/forum/index.ph...mp;#entry236329

Edited by yutt
It is a waste of energy to be angry with a man who behaves badly, just as it is to be angry with a car that won't go. - Bertrand Russell
Link to comment
Share on other sites

Just because I happen to know how to write code and I contribute code to AutoIt does not mean I am under any obligation what-so-ever to become a person I am not. You're stating that because I help develop this language that I have to abandon who I am and become some prototypical developer carrying roses and candies or some crap. Newsflash: I'm not that person. And it's unreasonable of you, or anybody else, to expect that just because I work on this project, I have to behave in a manner that is not who I am.

Don't come in here, call me an asshole then try to lecture me about how I should behave. Piss off if that's all you can do. I never said a word to you. If you don't like how I help people, get over it. You're not the first knave to bitch about my methods and you're not going to be the last.

Now, let me reference the three threads you're complaining about. In this particular thread, the OP asked a question I know has been answered with the same answer nearly a dozen times. I find it impossible to believe that a search for the words "read", "write", and "memory" would not yield productive results (Notice that the complex search terms I use are the title of this thread).

Regarding the AutoIt for Linux thread, the user asked a question that had been answered politely, rudely and in flame-war fashion. The question was covered multiple times in that one thread alone. Not to mention countless other threads on the same subject. Anybody having that much information available in the thread where they are posting and still asking the same question deserves more than just harassment from me.

The bug report is particularly annoying and likely not just to me. A user filed a bug report for user-error. They tried to blame 6-hours of lost work on an "AutoIt" bug that was not a bug at all but user-error. I don't know about anybody else but I know I don't like it when things I work on are said to be faulty when the only faulty lies behind the keyboard. Incidentally, while you may consider that an example of how "bad" I am, I did help the user as they got the point.

All-in-all, I'd say you could have found better examples of me being a prick than that.

Link to comment
Share on other sites

Don't mind Valik, if you read his posting history he's pretty much always an asshole.

http://www.autoitscript.com/forum/index.php?showtopic=19329

^This appears to be a library w0uter wrote for read from and writing to memory.

Edit: Drat, Marc beat me to it.

yutt,

I found this post way out of line. Valik suggested to use the help section first. That's all.

Maybe he didn't say "pretty please", but just a reminder that the "help section" is there

for a reason.

BTW- You haven't read enought of Valiks posts to justify that remark, OR were you just baiting.

I'm not defending anyone, I'm just stating a fact.

ViM

Link to comment
Share on other sites

BTW- You haven't read enought of Valiks posts to justify that remark, OR were you just baiting.

Mostly just frustrated with people fostering a community of arrogance and discourtesy. People generally come to a "Support" forum because they need help, not to be belittled by Internet bullies. Edited by yutt
It is a waste of energy to be angry with a man who behaves badly, just as it is to be angry with a car that won't go. - Bertrand Russell
Link to comment
Share on other sites

The first step to getting help is to help one's self. I knew for a fact there were multiple threads on the subject. A simple search using the title of this thread would have produced results.

By the way, please spare us all your opinion on what constitutes discourtesy. Did it occur to you that I could take it as discourteous that you come out of nowhere calling me an asshole? Did it occur to you that the forum regulars may take it as discourteous having a user ask a question that's been answered repeatedly? Did it occur to you that any time you state something in the public, you are opening yourself up to anything?

If you want to live in a little sheltered world where everybody says "please" and "thank you" then don't venture out into a world where people don't abide by the same courtesies you do.

Edit: Changed a word.

Edited by Valik
Link to comment
Share on other sites

Thanks for the random pseudo-philosophy lecture, but there are generally accepted protocols for not-being-a-prick that any intelligent person is aware of.

For some reason the RTFM Internet sub-culture has decided asking other knowledgeable humans for help is unacceptable, and you should instead waste hours searching through documentation, forums, and search engines. I see you are an adherent to this view. I am not.

Basically, if you don't have a desire to help others, why are you read and responding to a support forum? Beyond your juvenile desire to make yourself feel superior, that is.

It is a waste of energy to be angry with a man who behaves badly, just as it is to be angry with a car that won't go. - Bertrand Russell
Link to comment
Share on other sites

I wasnt looking to cause a problem, guys. I dont make a post without searching first. I spent a lot of time looking throug the help file. I also searched on here. Sometimes searching isn't as easy as some people think without knowing the exact way to word it, nor when a lot of woprds arent allowed. For example, read memory returned no results of interest, thought it did return like 10 pages of useless hits. write memory returned a few, but most were old threads stating that due to updates, they no longer worked. I did find wouters stuff, but after a long time of searching. This search isnt the best you know. In short, I was just asking for some help, to be pointed in the right direction. Let's not blow this out of proportion. I know he called you an asshole, but true or not, it shouldnt have been said. You could be a little more understanding though... :)

Pink Floyd - The Wall
Link to comment
Share on other sites

Thanks for the random pseudo-philosophy lecture, but there are generally accepted protocols for not-being-a-prick that any intelligent person is aware of.

How many of those protocols did you break calling me an asshole out of the blue? Your philosophy, by the way, is just as "pseudo" as mine is. Don't even think for a second you can act like you're right and I'm wrong and get away with it. You're just as "wrong" as I am or I'm just as "right" as you are. Also, I wouldn't make the assumption that I'm not intelligent enough to know about said protocols. I just think most of them are a load of shit and far too much emphasis in placed on them. Now, if you don't mind, think you could get off your high horse and shut the hell up for awhile? I'm not going to listen to you any more than I'm going to listen to the hunderd other people who have said the exact same thing.

For some reason the RTFM Internet sub-culture has decided asking other knowledgeable humans for help is unacceptable, and you should instead waste hours searching through documentation, forums, and search engines. I see you are an adherent to this view. I am not.

So you're a lazy bastard, then? While I am a lazy bastard as well, I at least learned a very long time ago that if I wanted the answer to a question, I should find it myself. Otherwise, if I can't find the answer on my own, maybe I'm not really interested after all?

Basically, if you don't have a desire to help others, why are you read and responding to a support forum? Beyond your juvenile desire to make yourself feel superior, that is.

So calling somebody an asshole who's never been an asshole to you is not juvenille? Again, please practice what you're going to preach or just shut up.

I wasnt looking to cause a problem, guys. I dont make a post without searching first. I spent a lot of time looking throug the help file. I also searched on here. Sometimes searching isn't as easy as some people think without knowing the exact way to word it, nor when a lot of woprds arent allowed. For example, read memory returned no results of interest, thought it did return like 10 pages of useless hits. write memory returned a few, but most were old threads stating that due to updates, they no longer worked. I did find wouters stuff, but after a long time of searching. This search isnt the best you know. In short, I was just asking for some help, to be pointed in the right direction. Let's not blow this out of proportion. I know he called you an asshole, but true or not, it shouldnt have been said. You could be a little more understanding though... :)

kjmarket, the problem is, your thread title contains the exact search terms you needed to search for. If you would have searched for "read write memory" you would have gotten a crap-load of results. Too many, in fact. Your next step should have been to look at the very basic "advanced usage" of the search engine to narrow the results. You'll quickly see that you need to add + to each word to use an AND search instead of OR. Thus, searching for "+read +write +memory" will produce at least two threads within the first 40 by w0uter with the answer you seek. And those search terms I know you know because that is the title you gave this thread. If you had shown no knowledge of the correct search terms, I wouldn't have said anything or at least provided you with the correct terms. But you did know the exact terms you needed because you put them in the title of the thread.
Link to comment
Share on other sites

Excuse me for not being an expert on the search feature...

As for my problem..I am using wouters script, but it works funny. I use a simple line with his mem.au3 file and it writes it to memory, but it's not the correct value, and then the value is changed back to the original value. For instance, the value I want to change is 1250. I want to change it to 1700, so I use this line...

$v_Read = _MemWrite($OpenProcess, $HPMem, $var, 1)

$HEMem is the memory address, which is working fine. $var is the entered value I want to change the adresses value to. Say It changes it to 1190 instead of 1700, then begins rapidly counting by one until it hits the original number.

Here is woters function for writing to memory

Func _MemWrite($i_hProcess, $i_lpBaseAddress, $v_Inject, $i_nSize, $v_lpNumberOfBytesRead = '')
    Local $v_Struct = DllStructCreate ('byte[' & $i_nSize & ']')
    DllStructSetData ($v_Struct, 1, $v_Inject)
    $i_Call = DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $i_hProcess, 'int', $i_lpBaseAddress, 'int', DllStructGetPtr ($v_Struct, 1), 'int', $i_nSize, 'int', $v_lpNumberOfBytesRead)
    $v_Struct=0
    Return $i_Call[0]
EndFunc;==> _MemWrite()

I'm not going to pretend to understand all of this, though I do understand some. IS it the code or the game thats overwriting the value once I change it? I've used other programs that change the value fine without it being altered.

Edited by kjmarket
Pink Floyd - The Wall
Link to comment
Share on other sites

Anyone?

I'm not familiar with MemWrite, but I saw something about types to be written.

You defined to write 1 byte of data, so byte is 0-255 and your value 1700 is bigger,

so maybe you need to write more than 1 byte and also some "typecast" must be done...

Try search for modified versions of _mem.au3 UDF and examples of using it.

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...