Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2003-03-09
7
Medium Priority
?
121 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_
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

578 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