Results 1 to 2 of 2
  1. #1
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks
    211
    Thanked 2,225 Times in 290 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

  2. #2
    LittleRAT
    LittleRAT is offline
    Guest
    Join Date
    2019 Oct
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Write exact value to address

    Hello there i'v been researching game hacking in delphi for a while now, I'v gotten to the point were i can inject and change a value yet when using the function above i try set example $821 it comes with a different value? how to resolve this issue & i change the bytes to a UInt64 value.

Visitors found this page by searching for:

delphi virtualprotect

virtualprotect delphi

delphi write bytedelphi WriteBytesdelphi write byteswrite byte virtualprotectdelphi write memorydelphi write memory viewdelphi send byte bufferdelphi writememdelphi enviar un buyteFunction WriteIt(pAddress: Pointer; Bytes: Array of Byte): Boolean;memory hack protection delphidelphi enviar byte #delphi blockwrite arraydelphi blockwrite to memorythreads virtualprotect delphimem write byte delphi델파이 메모리쓰기get virtual protect delphisearch array of byte in game delphi VirtualProtect(pAddress SizeOf(Bytes) OldProtect @DummyProtect);writebyte virtualprotect delphidelphi virtualprotect protectionvirtualprotect move bytes delphi

Posting Permissions

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