تغيير قيمة معينة فى ملف عن طريق دالة معينة
#1
السلام عليكم

اخوانى كيف اغيير قيمة معينة فى ملف تنفيدى لاكن بشرط ... استعمال هده الدالة .
المشكل هو كيف الحصول على BaseAddress لهده القيمة (برمجيا).
PHP كود :
procedure MemoryPatch(sExecutableFilePath :string; Patch: Byte; BaseAddress: Integer; nSize, BytesCount: Cardinal);
var
  
ProcessInfo: TProcessInformation;
  
StpInfo: TStartupInfo;
  
buf: PChar;
begin
  FillChar
(StpInfo,SizeOf(TStartupInfo), #0);
  
FillChar(ProcessInfo,SizeOf(TProcessInformation), #0);

  
if not CreateProcess(PChar(sExecutableFilePath),
                       
Nil, Nil, Nil, False, CREATE_SUSPENDED,
                       
Nil, Nil, StpInfo, ProcessInfo)
  
then
    MessageBox
(0, 'Program not found!', '', MB_OK + MB_ICONWARNING)
  else
  
begin
    GetMem
(buf, 1);
    
buf^ := Chr(Patch);
    
WriteProcessMemory(ProcessInfo.hProcess, Ptr(BaseAddress), buf, nSize, BytesCount);
    
FreeMem(buf);
    
ResumeThread(ProcessInfo.hThread);
  
end;
end; 

--- يوجد فى المنتدى كيفية استثمار هده الدالة ---

مثلا هده القيمة .
[صورة: 1270473925.jpg]
الرد


الردود في هذا الموضوع
تغيير قيمة معينة فى ملف عن طريق دالة معينة - بواسطة hanipino - 05-04-2010, 01:19 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم