Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2018, 03:37
allan allan is offline
Guest
 
Join Date: Nov 2017
Posts: 3
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 7
Thanks Rcvd at 0 Times in 0 Posts
allan Reputation: 0
What is the version of Delphi that you guys are using?
Reply With Quote
  #2  
Old 05-01-2018, 09:49
Agmcz Agmcz is offline
Friend
 
Join Date: Mar 2018
Posts: 16
Rept. Given: 0
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 15
Thanks Rcvd at 61 Times in 13 Posts
Agmcz Reputation: 4
Quote:
Originally Posted by allan View Post
What is the version of Delphi that you guys are using?
You can use delphi7 or a newer version.
Reply With Quote
The Following 3 Users Say Thank You to Agmcz For This Useful Post:
allan (05-08-2018), niculaita (05-01-2018), ontryit (05-02-2018)
  #3  
Old 05-01-2018, 22:26
Agmcz Agmcz is offline
Friend
 
Join Date: Mar 2018
Posts: 16
Rept. Given: 0
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 15
Thanks Rcvd at 61 Times in 13 Posts
Agmcz Reputation: 4
Check ASLR from Remote PEB

More..
Check ASLR from Remote PEB
Code:
unit uCheckASLR;

{************************************
* Coded by Agmcz                    *
* Date: 01-05-2018                  *
************************************}

interface

uses
  Windows;

function CheckASLRPEB32(hProcess: THandle): Boolean;

implementation

type
  PProcessBasicInformation = ^TProcessBasicInformation;
  TProcessBasicInformation = record
    ExitStatus: LongInt;
    PebBaseAddress: Pointer;
    AffinityMask: Cardinal;
    BasePriority: LongInt;
    UniqueProcessId: Cardinal;
    InheritedFromUniqueProcessId: Cardinal;
  end;

function NtQueryInformationProcess(ProcessHandle: THandle; ProcessInformationClass: DWORD {PROCESSINFOCLASS}; ProcessInformation: Pointer; ProcessInformationLength: ULONG; ReturnLength: PULONG): LongInt; stdcall; external 'ntdll.dll';
function NtReadVirtualMemory(ProcessHandle: THandle; BaseAddress: Pointer; Buffer: Pointer; BufferLength: ULONG; ReturnLength: PULONG): Longint; stdcall; external 'ntdll.dll';

function ImageDynamicallyRelocated(BitField: Byte): Boolean;
asm
  SHR AL, 2
  AND AL, 1
end;

function CheckASLRPEB32(hProcess: THandle): Boolean;
var
  PBI: TProcessBasicInformation;
  BitField: Byte;
begin
  Result := False;
  if (hProcess <> 0) and (hProcess <> INVALID_HANDLE_VALUE) then
  begin
    if NtQueryInformationProcess(hProcess, 0{ProcessBasicInformation = 0}, @PBI, SizeOf(TProcessBasicInformation), 0) = 0 then
    begin
      if NtReadVirtualMemory(hProcess, Pointer(DWORD(PBI.PebBaseAddress) + 3), @BitField{Peb.BitField}, SizeOf(Byte), 0) = 0 then
        Result := ImageDynamicallyRelocated(BitField);
    end;
  end;
end;

end.
Attached Files
File Type: rar uCheckASLR.rar (745 Bytes, 7 views)
Reply With Quote
The Following 2 Users Say Thank You to Agmcz For This Useful Post:
Insid3Code (05-02-2018), ontryit (05-02-2018)
  #4  
Old 06-11-2018, 09:09
Agmcz Agmcz is offline
Friend
 
Join Date: Mar 2018
Posts: 16
Rept. Given: 0
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 15
Thanks Rcvd at 61 Times in 13 Posts
Agmcz Reputation: 4
Update and publish to GitHub
Code:
https://github.com/Agmcz/CheckASLR
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Delphi] Loader shows how to patch PE protected with ASLR Sn!per X Source Code 1 11-28-2015 00:33
Help Me - CRC Check and FileSize Check byvs General Discussion 11 07-31-2003 13:32


All times are GMT +8. The time now is 10:53.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )