Click here to Skip to main content
15,915,848 members
Home / Discussions / C#
   

C#

 
GeneralRe: Combo Box slected index changed Pin
darkelv21-Feb-08 13:06
darkelv21-Feb-08 13:06 
GeneralRe: Combo Box slected index changed Pin
DaveyM6921-Feb-08 23:36
professionalDaveyM6921-Feb-08 23:36 
GeneralObject Serialization Pin
geekfromindia21-Feb-08 8:09
geekfromindia21-Feb-08 8:09 
GeneralRe: Object Serialization Pin
TheGreatAndPowerfulOz21-Feb-08 8:26
TheGreatAndPowerfulOz21-Feb-08 8:26 
GeneralRe: Object Serialization Pin
geekfromindia21-Feb-08 8:52
geekfromindia21-Feb-08 8:52 
GeneralRe: Object Serialization Pin
TheGreatAndPowerfulOz21-Feb-08 9:18
TheGreatAndPowerfulOz21-Feb-08 9:18 
GeneralRe: Object Serialization Pin
Not Active21-Feb-08 9:22
mentorNot Active21-Feb-08 9:22 
GeneralVery weird kernel32 memory reading results. Pin
Jitse21-Feb-08 7:05
Jitse21-Feb-08 7:05 
I'm making a memory reading application, but after some programming I noticed I actually get the same result for no matter which process. WTF | :WTF: I'll give a very clear example of my problem. This piece of code opens three processes, and reads their memory at position 0x0000FFFF. The processes can be whatever I want (as long as they're running, obviously), but for this example I took Firefox, TeaTimer (background process of Spybot) and Nexcal (a calculator program).

<br />
        public static void Test()<br />
        {<br />
            IntPtr bytesRead = new IntPtr();<br />
<br />
            // firefox<br />
            IntPtr firefox = OpenProcess(PROCESS_ALL_ACCESS, 0, (uint)Process.GetProcessesByName("firefox")[0].Id);<br />
            byte[] firefoxBuffer = new byte[3];<br />
            Trace.WriteLine("Firefox reading success: " + ReadProcessMemory(firefox, new IntPtr(65536), firefoxBuffer, (uint)3, out bytesRead));<br />
            foreach (byte b in firefoxBuffer)<br />
            {<br />
                Trace.WriteLine(b.ToString());<br />
            }<br />
            CloseHandle(firefox);<br />
<br />
            // teatimer<br />
            IntPtr tea = OpenProcess(PROCESS_ALL_ACCESS, 0, (uint)Process.GetProcessesByName("TeaTimer")[0].Id);<br />
            byte[] teaBuffer = new byte[3];<br />
            Trace.WriteLine("TeaTimer reading success: " + ReadProcessMemory(tea, new IntPtr(65536), teaBuffer, (uint)3, out bytesRead));<br />
            foreach (byte b in teaBuffer)<br />
            {<br />
                Trace.WriteLine(b.ToString());<br />
            }<br />
            CloseHandle(tea);<br />
<br />
            // nexcal<br />
            IntPtr nex = OpenProcess(PROCESS_ALL_ACCESS, 0, (uint)Process.GetProcessesByName("Nexcal")[0].Id);<br />
            byte[] nexBuffer = new byte[3];<br />
            Trace.WriteLine("Nexcal reading success: " + ReadProcessMemory(nex, new IntPtr(65536), nexBuffer, (uint)3, out bytesRead));<br />
            foreach (byte b in nexBuffer)<br />
            {<br />
                Trace.WriteLine(b.ToString());<br />
            }<br />
            CloseHandle(nex);<br />
        }<br />


Now here's the output of this code:

Firefox reading success: 1
61
0
58
TeaTimer reading success: 1
61
0
58
Nexcal reading success: 1
61
0
58

I even used different buffers just so I won't make a mistake with accidentally just printing the previous result again. Anyways, it explicitly says it succeeded reading that certain process at that certain position of their memory, but it still returns exactly the same result for the three processes. Now I was thinking this might be an absolute memory location I'm reading. But that wouldn't explain why I'd have to pass a process handle to the kernel32 functions. And it would make it all very complicated and quite useless.
GeneralRe: Very weird kernel32 memory reading results. Pin
TheGreatAndPowerfulOz21-Feb-08 8:44
TheGreatAndPowerfulOz21-Feb-08 8:44 
GeneralRe: Very weird kernel32 memory reading results. Pin
Jitse21-Feb-08 10:03
Jitse21-Feb-08 10:03 
QuestionEmail application Pin
N4D33M21-Feb-08 6:28
N4D33M21-Feb-08 6:28 
GeneralRe: Email application Pin
TheGreatAndPowerfulOz21-Feb-08 7:01
TheGreatAndPowerfulOz21-Feb-08 7:01 
GeneralRe: Email application Pin
N4D33M21-Feb-08 8:16
N4D33M21-Feb-08 8:16 
GeneralRe: Email application Pin
TheGreatAndPowerfulOz21-Feb-08 8:22
TheGreatAndPowerfulOz21-Feb-08 8:22 
GeneralRe: Email application Pin
Christian Graus21-Feb-08 10:52
protectorChristian Graus21-Feb-08 10:52 
GeneralRe: Email application Pin
N4D33M22-Feb-08 1:45
N4D33M22-Feb-08 1:45 
QuestionQuestion about a TextBox with the MultiLine property set to True Pin
blakey40421-Feb-08 5:11
blakey40421-Feb-08 5:11 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
J4amieC21-Feb-08 5:21
J4amieC21-Feb-08 5:21 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
blakey40421-Feb-08 5:43
blakey40421-Feb-08 5:43 
JokeRe: Question about a TextBox with the MultiLine property set to True Pin
Le centriste21-Feb-08 5:54
Le centriste21-Feb-08 5:54 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
blakey40421-Feb-08 6:04
blakey40421-Feb-08 6:04 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
Dave Kreskowiak21-Feb-08 5:38
mveDave Kreskowiak21-Feb-08 5:38 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
blakey40421-Feb-08 5:49
blakey40421-Feb-08 5:49 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
Dave Kreskowiak21-Feb-08 5:52
mveDave Kreskowiak21-Feb-08 5:52 
GeneralRe: Question about a TextBox with the MultiLine property set to True Pin
blakey40421-Feb-08 6:09
blakey40421-Feb-08 6:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.