Sign in to follow this  
Followers 0
KaFu

General MemoryRead and MemoryWrite questions

6 posts in this topic

Hiho Forum :shifty:,

I recently started playing around with

The general scenario is to create a structure, spawn a child process with Run() and hand over the structure pointer to it via command-line, then let it create an own structure and let it write that pointer back to the main process's structure (as a back-channel). When this initialization is done let the child write to the calling process's memory and vice versa (work loop).

Now I've got some general questions on this topic:

  • Can anyone tell me if I might have to worry about memory access problems, e.g. because of user access restriction (non-privileged / non-admin accounts) in Windows XP or Win7? I tested it with a Guest account on my on computer, and I'll "assume" that there should be no problems because the spawned process is owned by the calling process :x, I would welcome any insights.
  • In the Nomad Memory UDF header notes there is this statement: "Also note that size ('char') for all 'char' types should be 1 greater than the actual size.". Can anyone tell me why :nuke:?
  • If I want to handle Unicode characters I guess I have to define wChar structure elements (at least that works in my tests :P). Does the statements above on Char elements also apply to wChar elements?

Best Regards

Share this post


Link to post
Share on other sites



Thanks for the info :x, found the answer to the last question here:

"Determine the size of string objects by counting the number of characters and adding 1 for the terminating '\0' or 2 for type wchar_t."

Share this post


Link to post
Share on other sites

You'll only need to worry about privilege level issues if you are running as a non-admin account and the spawned process requires a higher privilege mode. (ShellExecute() would be needed also, as Run() can't handle any process requiring those higher privileges). Since it seems like you are handling both the calling and receiving processes, I wouldn't think this is a concern.

On a side note - NomadMemory will only work on 32-bit systems unless someone fixes it. I personally think the whole module sucks because of its weird implementation. Of course, I could be biased since I wrote a complete Process manipulation suite :x

Share this post


Link to post
Share on other sites

Hi m8 :shifty:,

was looking at my download of your "Process, Thread, & DLL Functions UDFs" and only found some references to the memory functions but not the functions themselves... and then realized that I might not have the most recent copy :x. From the first look your functions seem to be better designed (64bit save :P ), I'll stick to those :nuke:. Thanks for your feedback!

Cheers

Share this post


Link to post
Share on other sites

Hmm, that reminds me - I've made a few changes to a few of those UDF's since my last update, I should finish up what I was last working on and upload them. One thing I've done is I've added 2 more memory read/write functions (for simple datatypes like pointers,ints, etc). The other stuff I need to experiment with a bit before I add the new update.

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