|
-
Dec 29th, 2004, 12:47 AM
#1
Thread Starter
Addicted Member
Memory/Process stuff
Hello. I recently got VB.net and wow, it's so much better than VB 6. Beyond compare!
I remember vb 6 couldn't multitask or handle processes or memory too well, it always crashed and stuff. VB.net seems to be better with that kind of stuff...
I have a question though. I'm into the whole memory string stuff (like ArtMoney). Is there a way I can search the memory of a process for a string or a number or something? This type of stuff really interests me and it's really the only thing I don't know much about.
Thanks,
Jake
P.S. I know i'm asking for probably a lot of code or something. If you can point me to some examples that would be great!
Thanks again .
-
Dec 29th, 2004, 01:18 AM
#2
Sleep mode
Start from this class , read about it on MSDN help:
System.Diagnostics.Process()
for the memory stuff , I don't think .NET Framework classes will be any better than APIs .
-
Dec 29th, 2004, 01:35 PM
#3
Thread Starter
Addicted Member
Re: Memory/Process stuff
Thanks . I just remember, VB 6 crashed with the APIs and stuff.
-
Dec 30th, 2004, 05:58 AM
#4
Re: Memory/Process stuff
Also System.Interop.Marshalling can be used here....
I have some of the VB6 debugger converted to .NET but it needs much work
-
Dec 30th, 2004, 09:43 PM
#5
Thread Starter
Addicted Member
Re: Memory/Process stuff
Hi, I don't seem to have any kind of System.Interop.Marshalling.. ..
-
Dec 31st, 2004, 04:03 AM
#6
Fanatic Member
Re: Memory/Process stuff
I think <Interop> specifier works only for the COM components that are being used in a .Net solution
-
Dec 31st, 2004, 05:29 AM
#7
Re: Memory/Process stuff
Could he have possibly meant:
System.Runtime.InteropServices
System.Runtime.InteropServices.Marshal
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
Dec 31st, 2004, 05:35 PM
#8
Thread Starter
Addicted Member
Re: Memory/Process stuff
I figure it's not going to be anything in the .NET framework. It's basically something you can only do in C++, (or by using API's written in C++), because VB.NET and C#.NET are managed code, which means they can't access memory outside of it's own variables. If you try to access an index of an array that is past the Upper bound in VB or C#, you get an index out of bounds exception, but not in C++. In C++ you will get random values from the memory. Some of C++'s methods (not the .NET framework) can read and write memory outside of it's own allocated space. It involves the risk of memory fragmentation/corruption, though that can be fixed with an easy reboot . Basically, you need to use API's in C# and VB to perform such tasks. Now, I just need to figure out what API's. Does anybody know of some examples for searching memory for strings or something like that? Thanks
-
Jan 1st, 2005, 08:38 PM
#9
Sleep mode
Re: Memory/Process stuff
 Originally Posted by xjake88x
I figure it's not going to be anything in the .NET framework. It's basically something you can only do in C++, (or by using API's written in C++), because VB.NET and C#.NET are managed code, which means they can't access memory outside of it's own variables. If you try to access an index of an array that is past the Upper bound in VB or C#, you get an index out of bounds exception, but not in C++. In C++ you will get random values from the memory. Some of C++'s methods (not the .NET framework) can read and write memory outside of it's own allocated space. It involves the risk of memory fragmentation/corruption, though that can be fixed with an easy reboot  . Basically, you need to use API's in C# and VB to perform such tasks. Now, I just need to figure out what API's. Does anybody know of some examples for searching memory for strings or something like that? Thanks 
Wrong! C#,specifically, can execute unmanaged code also like using pointers (in C\C++) using unsafe keyword .
-
Jan 1st, 2005, 10:27 PM
#10
Thread Starter
Addicted Member
Re: Memory/Process stuff
Well VB can execute unmanaged code thru APIs.. If C# can do it without API's then my MCSD .NET certification course is wrong .
-
Jan 1st, 2005, 10:33 PM
#11
Frenzied Member
Re: Memory/Process stuff
MemoryCopy api.
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
or search msdn for RTLMOVEMEMORY
:::`DISCLAIMER`:::
Do NOT take anything i have posted to be truthful in any way, shape or form.
Thank You!
--------------------------------
"Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
"Finaly I can look as gay as I want..." - NoteMe
Languages: VB6, BASIC, Java, C#. C++
-
Jan 1st, 2005, 10:36 PM
#12
Sleep mode
Re: Memory/Process stuff
I'm sorry . I wasn't clear enough . When I said "unmanaged" I meant pointers . I know VB.NET (or even old VB6) can use APIs . Here's what C# can do but not VB.NET : http://msdn.microsoft.com/library/de...clrfUnsafe.asp
-
Jan 1st, 2005, 10:38 PM
#13
Re: Memory/Process stuff
VB Code:
'Memory Copying
System.Runtime.InteropServices.Marshal.Copy
VB Code:
'Reading Memory
System.Runtime.InteropServices.Marshal.ReadByte()
System.Runtime.InteropServices.Marshal.ReadInt16()
System.Runtime.InteropServices.Marshal.ReadInt32()
System.Runtime.InteropServices.Marshal.ReadInt64()
'Writing
System.Runtime.InteropServices.Marshal.WriteByte()
System.Runtime.InteropServices.Marshal.WriteInt16()
System.Runtime.InteropServices.Marshal.WriteInt32()
System.Runtime.InteropServices.Marshal.WriteInt64()
Edit: Clarified
Last edited by <ABX; Jan 1st, 2005 at 10:42 PM.
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|