Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 12:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Loading Offsets out of a string

Discussion on Loading Offsets out of a string within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2010
Posts: 2
Received Thanks: 0
Loading Offsets out of a string

Hi

I have a short question, I hope you guys have an answer for me

I have this sourcecode (delphi) :

Code:
Function GetMaxHP : Integer;
var
WndHandle, Pid, Pidhandle : integer;
Written: Cardinal;
begin
  WndHandle := FindWindow(nil,Pchar(Wintitle));
GetWindowThreadProcessId(WndHandle,@Pid);
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
ReadProcessMemory(Pidhandle, ptr(BaseAddr), @MaxHPPointer, Data, written);
MaxHPPointer := MaxHPPointer +$032;
ReadProcessMemory(Pidhandle, ptr(MaxHPPointer), @MaxHPPointer2, Data, written);
MaxHPPointer2 := MaxHPPointer2 + [B]maxhpoffset[/B];
ReadProcessMemory(Pidhandle, ptr(MaxHPPointer2), @MaxHP, Data, written);
closehandle(Pidhandle);
Result := MaxHP;
end;
is there any way to load the maxhpoffset out of s string? Or do I have to make it static , like this :

Code:
Function GetMaxHP : Integer;
var
WndHandle, Pid, Pidhandle : integer;
Written: Cardinal;
begin
  WndHandle := FindWindow(nil,Pchar(Wintitle));
GetWindowThreadProcessId(WndHandle,@Pid);
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
ReadProcessMemory(Pidhandle, ptr(BaseAddr), @MaxHPPointer, Data, written);
MaxHPPointer := MaxHPPointer +$032;
ReadProcessMemory(Pidhandle, ptr(MaxHPPointer), @MaxHPPointer2, Data, written);
MaxHPPointer2 := MaxHPPointer2 + [B]$33C[/B];
ReadProcessMemory(Pidhandle, ptr(MaxHPPointer2), @MaxHP, Data, written);
closehandle(Pidhandle);
Result := MaxHP;
end;

I tried

MaxHPPointer2 := MaxHPPointer2 + strtoint(maxhpoffset);

maxhpoffset was a string , containing $33C, but strtoint converted it to a decimal address without the ''$'' at the beginning of the offset, which I need to be able to add the offsets.

Any Ideas how I can load maxhpoffset out of a string?
xManuelax is offline  
Old 06/27/2010, 12:10   #2
 
elite*gold: 0
Join Date: Sep 2009
Posts: 21
Received Thanks: 4
Sry, I can´t Delphi but at C++ is a function for it.
It calls replace (). And will pass with the dot operator. (dot operator = Punkt Operator?!^^) (String.replace ())
Chaosduckman is offline  
Old 06/27/2010, 12:22   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 2
Received Thanks: 0
Hm, thank you but I need a delphi way of dooing it
xManuelax is offline  
Old 06/27/2010, 12:25   #4
 
elite*gold: 0
Join Date: Sep 2009
Posts: 21
Received Thanks: 4
Chaosduckman is offline  
Reply


Similar Threads Similar Threads
String.au3
09/11/2010 - AutoIt - 2 Replies
Hey, hat jemand die Datei für mich? Ich finde im Internet nichts (ich hoffe ich habe nichts übersehn) Mfg
[C++]Dev C++ string to int
08/06/2010 - C/C++ - 25 Replies
Schonwieder ich :P Also ich versuchs ma gut zu beschreiben. Ich habe nen string in dem steht 1 und bevor einer fragt warum ich nicht direkt int benutzte es würde dan nicht funktioniern. Also ich möchte den string in dem 1 steht in eine int variable umwandeln und danach irgendwan wieder zurück wie schaffe ich das? mit atoi habe ich es nicht hingekriegt und auch nicht mit strtoint
Englische String.txt?
05/27/2010 - Metin2 Private Server - 0 Replies
Gibt es eine Englische String.txt? Also wo alles englisch ist
C# String zum Key
05/05/2010 - .NET Languages - 7 Replies
Hallo liebe User, Ich habe seit langer Zeit ein Problem das mich ne Weile beschäftigt. Es geht um Hotkeys und Strings.. Was ich machen will: Ich habe jetzt diesen Code:
Getting ID String for RPE
07/15/2009 - Ragnarok Online - 0 Replies
Is there any way for getting ID String for account ID than using openkore ? openkore doesn't work on my server, I need to get the String ID so I can use RPE filter. Does anyone know the solution for this ?



All times are GMT +1. The time now is 12:38.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.