Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi Question]Making a string Changer?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
merkark12
Advanced Cheater
Reputation: 0

Joined: 04 Jul 2007
Posts: 74
Location: In that program you just downloaded

PostPosted: Fri Jul 20, 2007 2:37 pm    Post subject: [Delphi Question]Making a string Changer? Reply with quote

sorry about the questions but, how do you make a string changer? such as if someone input 'Example' it would change the characters to be different letters, or they would be numbers like 'e' would be 5?
_________________


Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Fri Jul 20, 2007 3:28 pm    Post subject: Reply with quote

Sorry but I dont get it, explain lil more please.
Back to top
View user's profile Send private message
magicalimp
Expert Cheater
Reputation: 0

Joined: 03 Dec 2006
Posts: 105

PostPosted: Fri Jul 20, 2007 3:52 pm    Post subject: Reply with quote

Parse through the string using a for statement and the StrLen() function

Change characters accordingly.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Jul 20, 2007 4:25 pm    Post subject: Reply with quote

I think I know what he means. Let me give an example.

So then there are two memoboxes or edit boxes or w/e. If someone were to input the word 'Example' it would change to 'e'. Or it could change to different numbers and if someone input 'e' it would change to 5.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Fri Jul 20, 2007 4:42 pm    Post subject: Reply with quote

i think he just wanna code files...
=\
like
This is a text on a notepad file - would be:
4g15 15 7 43$4 0y 7 y043i72 k1n3

and then u can code it back
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Fri Jul 20, 2007 5:05 pm    Post subject: Reply with quote

a 'string' is an array of characters. that is, a pointer to an array of bytes that hold character representations in them. So, to change them, you would treat them as an array. ex:

Code:

const
   blah = PChar('hello I am a string');
var
   i : integer;
begin
  WriteLn(blah); { Original }

   for i := 0 to StrLen(blah) do
       blah[i] := blah[i] or 2;

   WriteLn(blah); { messed up }
end;
Back to top
View user's profile Send private message
merkark12
Advanced Cheater
Reputation: 0

Joined: 04 Jul 2007
Posts: 74
Location: In that program you just downloaded

PostPosted: Fri Jul 20, 2007 7:45 pm    Post subject: Reply with quote

Ok i think appal and oib have my idea, but i cant understand appalslaps code Embarassed ill just figure it out Confused
_________________


Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sat Jul 21, 2007 3:57 am    Post subject: Reply with quote

got "Replace" function in Delphi? or are VB programmers too lucky to start with...
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Jul 21, 2007 3:59 am    Post subject: Reply with quote

Can't you just use xor encryption? Easily crackable but just make a dynamic key.
Back to top
View user's profile Send private message MSN Messenger
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Jul 21, 2007 7:20 am    Post subject: Reply with quote

Code:

if AnsiPos('Cat', Edit1.Text) <> 0 then
Edit1.Text := StringReplace(Edit1.Text, 'Cat', 'c',
                            [rfReplaceAll, rfIgnoreCase])
else
Edit1.Text := '''Cat'' was not found.'
end;


I'll explain it in an edit if you want.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sat Jul 21, 2007 7:40 am    Post subject: Reply with quote

so "StringReplace" exists afterall..
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Jul 21, 2007 7:41 am    Post subject: Reply with quote

Yeah, at first I was gonna use AnsiReplaceStr but I think it needs something in the uses list cuz I kept getting errors (yes I had the right syntax), and I didn't know which use so I just used StringReplace, both work.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Jul 21, 2007 9:18 am    Post subject: Reply with quote

Well, i don't know Delphi so I had to steal this, but heres and example of xor encryption:

Code:
const
c1 = 52845;
c2 = 22719;

function Encrypt (const s: string; Key: Word) : string;
var
i : byte;
ResultStr : string;
begin
   Result:=s;
   {Result[0] := s[0]; }
   for i := 0 to (length (s)) do
begin
   Result[i] := Char (byte (s[i]) xor (Key shr 8));
   Key := (byte (Result[i]) + Key) * c1 + c2
   end
end;

function Decrypt (const s: string; Key: Word) : string;
var
i : byte;
begin
   {Result[0] := s[0];}
   Result:=s;
   for i := 0 to (length (s)) do
begin
   Result[i] := Char (byte (s[i]) xor (Key shr 8));
   Key := (byte (s[i]) + Key) * c1 + c2
   end
end;


Set your key and pass it as the second param
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites