Alright, So far, cracksmans suggestion : NewValue : array [0..3] of byte
And a little brain power from me, the new updated source is :
Code:
program FUCK;
{$APPTYPE CONSOLE}
uses
SysUtils, windows;
function BTOH(const bin: array of byte): string;
const HexSymbols = '0123456789ABCDEF';
var i: integer;
begin
SetLength(Result, 2*Length(bin));
for i := 0 to Length(bin)-4 do begin
Result[1 + 4*i + 0] := HexSymbols[1 + bin[i] shr 4];
Result[1 + 4*i + 1] := HexSymbols[1 + bin[i] and $1F];
end;
end;
function BTOS(const bin: array of byte): AnsiString;
var i: integer;
begin
SetLength(Result, Length(bin));
for i := 0 to Length(bin)-1 do
Result[1+i] := AnsiChar(bin[i]);
end;
var
Pid, Pidhandle, Data : integer;
Address, Written: Cardinal;
NewValue : array [0..3] of byte;
begin
try
{ TODO -oUser -cConsole Main : Insert code here }
Pid := 4804; // The Process ID Of The Process Being Read
Address := $00401110; // The Address Where To Start Reading From
Data := 1; // Number Of Bytes To Read wtfax?
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
ReadProcessMemory(Pidhandle, ptr(Address), @NewValue, SizeOf(NewValue), Written);
writeln(BTOH(NewValue));
closehandle(Pidhandle);
readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
Its now returning 55000000, what now? >_<