Results 1 to 1 of 1
  1. #1
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,221
    Thanks
    211
    Thanked 2,224 Times in 289 Posts
    Rep Power
    10

    [Snippet] Write bytes to memory

    Made this little function because WriteProcessMemory was getting detected in a game hack I was making
    // Write Bytes to Address Method
    Function WriteIt(pAddress: Pointer; Bytes: Array of Byte): Boolean;
    var
    OldProtect, DummyProtect: DWord;
    begin
    if VirtualProtect(pAddress, SizeOf(Bytes), PAGE_EXECUTE_READWRITE, @OldProtect) then
    begin
    Move(Bytes, pAddress^, Length(Bytes));
    VirtualProtect(pAddress, SizeOf(Bytes), OldProtect, @DummyProtect);
    Result := True
    end
    else
    Result := False;
    end;

    Great for when you Dll is injected into a process, you can use it like this... Example]Const
    //NoReLoad
    AddressReload = $374B1826;
    PatchReload : Array[0..7] of byte = ($90,$90,$90,$90,$90,$90,$90,$90);
    OriginalReload : Array[0..7] of byte = ($81,$44,$24,$04,$1C,$00,$00,$00);

    .......
    //Apply new bytes
    WriteIt(ptr(AddressReload),PatchReload);

    //Restore Old bytes
    //WriteIt(ptr(AddressReload),OriginalReload);[/delphi]
    by Departure
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

Visitors found this page by searching for:

delphi virtualprotect

virtualprotect delphi

delphi write bytedelphi send byte bufferdelphi write memory viewdelphi blockwrite arraydelphi enviar un buytedelphi write memorywrite byte virtualprotectdelphi write bytesFunction WriteIt(pAddress: Pointer; Bytes: Array of Byte): Boolean;delphi writememdelphi enviar byte #memory hack protection delphidelphi WriteBytesthread dll delphi virtualprotectget virtual protect delphimem write byte delphidelphi blockwrite to memoryVirtualProtect(pAddress SizeOf(Bytes) OldProtect @DummyProtect);delphi virtualprotect protectionvirtualprotect move bytes delphidelphi byte array dll injectiongame memory hack arrary of bytedelphi write all bytes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •