Sign in to follow this  
Followers 0
Cyberworld

Help with Autoit Plugin...

7 posts in this topic

#1 ·  Posted (edited)

I want to add a command to my plugin that returns an int from a memory address. I use AU3_GetInt32/AU3_SetInt32 to get/return the values, but I have not been able to make it return the actual contents of the specific address. I need to make a cast but how should that look like? The compiler just complain about all my attempts to do any :P

The command is supposed to work like this:

$file = FileOpen("Data.dat", 0)

$buffer = FileRead($file)

FileClose($file)

$data = GetInt($buffer+4)

Lets say my file contains the data: "TEST12345678". After executing of my command [GetInt(adress)]

$data is supposed to be equal to 0x12345678.

Edited by Cyberworld

Share this post


Link to post
Share on other sites



Think that code through. You open a file, read it's contents as a string into a variable and close the file. Then you add 4 to the contents of the string mathematically. In most casts that's going to produce the value 4. At any rate, whatever the calculated value is, it's passed to your GetInt() function. But you claim your GetInt() function is expecting an address.

Are you sure you're ready to be writing plugins? Are you sure you're ready to be reading raw memory addresses arbitrarily?

Share this post


Link to post
Share on other sites

Are you sure you're ready to be writing plugins? Are you sure you're ready to be reading raw memory addresses arbitrarily?

and I'm "almost" sure that the ASCII string "12345678" will not be equal to 0x12345678. I'm not 100% sure, but the compiler keeps complaining :P

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

I'm surprised this user knows how to read memory addresses. Can you tell us what you are reading for?

Share this post


Link to post
Share on other sites

and I'm "almost" sure that the ASCII string "12345678" will not be equal to 0x12345678. I'm not 100% sure, but the compiler keeps complaining :P

Cheers

Kurt

The test12345678 was just an example. It's not an ascii string. The file contains header $52494431(RID1) and then the number of entries $0001766e... etc followed by some other datafields...

Share this post


Link to post
Share on other sites

Think that code through. You open a file, read it's contents as a string into a variable and close the file. Then you add 4 to the contents of the string mathematically. In most casts that's going to produce the value 4. At any rate, whatever the calculated value is, it's passed to your GetInt() function. But you claim your GetInt() function is expecting an address.

Are you sure you're ready to be writing plugins? Are you sure you're ready to be reading raw memory addresses arbitrarily?

Yes you are correct in that case. I just add 4 to the string. But if I read my data to the string are there any way to get the pointer to the memory area that the string occupies? I could alloc some memory and read the file directly from my plugin (The filehandling are already there for other things like streaming of data to the CRC32 routine & for a precompressor) but I since I want to return several values in this case do I think it would easier to handle this from AutoIt directly.

Share this post


Link to post
Share on other sites

Yes you are correct in that case. I just add 4 to the string. But if I read my data to the string are there any way to get the pointer to the memory area that the string occupies? I could alloc some memory and read the file directly from my plugin (The filehandling are already there for other things like streaming of data to the CRC32 routine & for a precompressor) but I since I want to return several values in this case do I think it would easier to handle this from AutoIt directly.

You are adding 4 to an ASCII string is their point. Adding 4 to a string, is not going to get you the "address" in memory. I don't know what made you think that, and quite frankly don't care due to the incorrectness of the information.

The question(s) still beg's to be answered by you: Why do you need to be playing with the memory address? What are you trying to accomplish?

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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  
Followers 0