Click here to Skip to main content
15,904,877 members
Home / Discussions / C#
   

C#

 
GeneralRe: 'using' keyword question Pin
Giorgi Dalakishvili12-Oct-08 21:20
mentorGiorgi Dalakishvili12-Oct-08 21:20 
AnswerRe: 'using' keyword question Pin
Ashfield12-Oct-08 21:01
Ashfield12-Oct-08 21:01 
GeneralRe: 'using' keyword question Pin
Programm3r12-Oct-08 21:15
Programm3r12-Oct-08 21:15 
AnswerRe: 'using' keyword question Pin
Guffa12-Oct-08 21:20
Guffa12-Oct-08 21:20 
GeneralRe: 'using' keyword question Pin
Programm3r12-Oct-08 21:42
Programm3r12-Oct-08 21:42 
QuestionSending Keystroke To particular window of other application Pin
Sandeep Kalra12-Oct-08 20:39
Sandeep Kalra12-Oct-08 20:39 
AnswerRe: Sending Keystroke To particular window of other application Pin
Simon P Stevens12-Oct-08 22:29
Simon P Stevens12-Oct-08 22:29 
Questionwrite a structure to process memory using WriteProcessMemory() Pin
Xmen Real 12-Oct-08 20:10
professional Xmen Real 12-Oct-08 20:10 
i have developed an app that have 1 array of int type with 3 elements, assign their values on Load event. Assign a timer that keep write their values in a textbox. Next, i run that app and got the first element offset in kernel32.dll by using a software. Now i want to write new values to that array from another application by using that offset i got. for example
int[] Xarray = new int[3];
private void Form1_Load(object sender, EventArgs e)
{
    Xarray[0] = 61457899;
    Xarray[1] = 44527899;
    Xarray[2] = 832429;
}


i got address of first element(of Xarray) that is 0x1D52EF4 then the next element value i can find it on 0x1D52EF8 and third one on 0x1D52EFC

so if i write from another application like this
APIDecalaration.WriteProcessMemory(hProcess, (IntPtr)(0x1D52EF4), ref Newvalue, 4, 0);
APIDecalaration.WriteProcessMemory(hProcess, (IntPtr)(0x1D52EF8), ref Newvalue1, 4, 0);
APIDecalaration.WriteProcessMemory(hProcess, (IntPtr)(0x1D52EFC), ref Newvalue2, 4, 0);


//In APIDecalaration
[DllImport("kernel32")]
        public static extern int WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, ref int lpBuffer, long nSize, long lpNumberOfBytesWritten);


then it will write Newvalue successfully, but i cant do because here are only 3 elements what if i have 100. Therefore, i made a struct that have 3 int variables but when i try to write it nothing happens. Here is code

APIDecalaration.WriteProcessMemory(hProcess, (IntPtr)(0x1D52EF4), Xstruct_instance, 12, 0);


//In APIDecalaration
        [DllImport("kernel32")]
        public static extern Xstruct WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, Xstruct lpBuffer, ref long nSize, long lpNumberOfBytesWritten);


//Struct
[StructLayout(LayoutKind.Sequential)]
public struct Xstruct
{
    public int Newvalue;
    public int Newvalue1;
    public int Newvalue2;
}


anyidea guys to solve this ?

TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can

AnswerRe: write a structure to process memory using WriteProcessMemory() Pin
Guffa12-Oct-08 20:36
Guffa12-Oct-08 20:36 
GeneralRe: write a structure to process memory using WriteProcessMemory() Pin
Xmen Real 13-Oct-08 3:00
professional Xmen Real 13-Oct-08 3:00 
GeneralRe: write a structure to process memory using WriteProcessMemory() Pin
Guffa13-Oct-08 4:06
Guffa13-Oct-08 4:06 
GeneralRe: write a structure to process memory using WriteProcessMemory() Pin
Xmen Real 13-Oct-08 4:11
professional Xmen Real 13-Oct-08 4:11 
QuestionWindows Services Pin
Piyush Vaishnav12-Oct-08 20:00
Piyush Vaishnav12-Oct-08 20:00 
AnswerRe: Windows Services Pin
Jaffer Mumtaz12-Oct-08 20:53
Jaffer Mumtaz12-Oct-08 20:53 
GeneralRe: Windows Services Pin
Piyush Vaishnav12-Oct-08 21:56
Piyush Vaishnav12-Oct-08 21:56 
GeneralRe: Windows Services Pin
Giorgi Dalakishvili12-Oct-08 23:08
mentorGiorgi Dalakishvili12-Oct-08 23:08 
GeneralRe: Windows Services Pin
Piyush Vaishnav12-Oct-08 23:16
Piyush Vaishnav12-Oct-08 23:16 
GeneralRe: Windows Services Pin
Giorgi Dalakishvili12-Oct-08 23:20
mentorGiorgi Dalakishvili12-Oct-08 23:20 
Questionpaging control in C# windows application Pin
Member 398136612-Oct-08 19:02
Member 398136612-Oct-08 19:02 
AnswerRe: paging control in C# windows application Pin
Ashfield12-Oct-08 21:04
Ashfield12-Oct-08 21:04 
QuestionC# client-server application using xml file to transfer by http format Pin
pcbaby1512-Oct-08 18:28
pcbaby1512-Oct-08 18:28 
AnswerRe: C# client-server application using xml file to transfer by http format Pin
pcbaby1519-Oct-08 18:04
pcbaby1519-Oct-08 18:04 
GeneralRe: C# client-server application using xml file to transfer by http format Pin
pcbaby1530-Oct-08 22:38
pcbaby1530-Oct-08 22:38 
QuestionNEED HELP FOR FIND URL'S IN WEB PAGE Pin
Member 465028712-Oct-08 11:03
Member 465028712-Oct-08 11:03 
AnswerRe: NEED HELP FOR FIND URL'S IN WEB PAGE Pin
Garth J Lancaster12-Oct-08 11:17
professionalGarth J Lancaster12-Oct-08 11:17 

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.