?
Solved

check if my process's code was changed in memory.

Posted on 2003-03-09
7
Medium Priority
?
120 Views
Last Modified: 2010-04-04
hey, lets say i have a function and i would like to check if it was changed inside the memory, how can i do this ?
0
Comment
Question by:wsock32_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 

Author Comment

by:wsock32_
ID: 8101434
increased points.. please, some help here..
0
 
LVL 9

Expert Comment

by:ITugay
ID: 8101479
seems you have to calc checksum of function code on programm startup and then compare it with stored value.

0
 

Author Comment

by:wsock32_
ID: 8101496
i know that, but how can i calc the checksum of the function, how can i fetch that data into a buffer? :/
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Expert Comment

by:ITugay
ID: 8101572
I saw sample about how to acces executable code in this topic area. Let me know if you didn't found it.
0
 

Author Comment

by:wsock32_
ID: 8101789
nope tried the google search, but its not here
0
 
LVL 9

Expert Comment

by:ITugay
ID: 8101818
ok, just a moment....
0
 
LVL 9

Accepted Solution

by:
ITugay earned 1200 total points
ID: 8101871
here is a sample.
Proc1 - procedure that must be checked.
DummyProc - place it just after Proc1 to calculate Proc1 size.



procedure Proc1(var M: Integer);
begin
  M := 1000;
end;

procedure DummyProc;
begin

end;



procedure TForm1.SpeedButton1Click(Sender: TObject);
var
  A: Pointer;
  L: Integer;
  CS: Integer;
begin
  // address of proc1
  A := @Proc1;  

  // size of procedure
  L := Integer(@DummyProc) - Integer(@Proc1);

  // check summ
  CS := 0;
  while L > 0 do
  begin
    CS := CS + Byte(A^);
    dec(L);
    A := Pointer(Integer(A) + 1);
  end;

  // show result
  ShowMessage(IntToStr(CS));
end;

-----
Igor


PS: if you need to copy code of proc1 to buffer, then use  A as pointer of area and L as length in bytes
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question