إجراء MemoryPatch لعمل Loader
#1
السلام عليكم
كتبت بالأمس إجراء يقوم بعمل Patch لموضع محدد من ذاكرة ملف أثناء تشغيله:
PHP كود :
uses
  Windows
;

procedure MemoryPatch(sExecutableFilePath :string; Patch: Byte; BaseAddress: Integer; nSize, BytesCount: Cardinal);
var
   
ProcessInfo: TProcessInformation;
   
StpInfo: TStartupInfo;
   
buf: PChar;
begin
   buf 
:= nil;
   
FillMemory(@StpInfo, sizeof( StpInfo ), 0 );
   
StpInfo.cb := sizeof( StpInfo );
   if 
not CreateProcess(Nil, PChar( sExecutableFilePath ),
                  
Nil, Nil, False, NORMAL_PRIORITY_CLASS,
                  
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);
  
end;
   
CloseHandle( ProcessInfo.hProcess );
   
CloseHandle( ProcessInfo.hThread );
end; 
الإجراء لا شيء فيه جديد غير أنه سهل الاستخدام، ربما يفيد من يستخدمه بكثرة
يصلح لعمل Loader لبرنامجك، أو أحيانا لبرنامج آخر :bones:
مثال Aimersoft Video Converter Ultimate v3.2.0.3ـ:
كود :
MemoryPatch('VideoConverterUltimate.exe', $DE, $0050F44D, 1, 1);
لأجل:
كود :
http://www.aimersoft.com/video-converter-ultimate.html
تحياتي.
اللهم احقن دماء المسلمين، لا تنسوهم بالدعاء...
الرد


الردود في هذا الموضوع
إجراء MemoryPatch لعمل Loader - بواسطة kachwahed - 10-02-2010, 11:06 PM
إجراء MemoryPatch لعمل Loader - بواسطة Ahmed18 - 11-02-2010, 03:57 AM
إجراء MemoryPatch لعمل Loader - بواسطة kachwahed - 11-02-2010, 07:20 AM
إجراء MemoryPatch لعمل Loader - بواسطة kachwahed - 19-03-2010, 02:24 PM
إجراء MemoryPatch لعمل Loader - بواسطة kachwahed - 10-10-2010, 02:43 PM

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


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