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 


Increasing a integer in delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Mon Mar 12, 2007 9:19 pm    Post subject: Increasing a integer in delphi Reply with quote

As first post in this section here's a piece of code that will increase the value of i with 1
Code:

var i: integer;
var pi: ^integer; 
begin
//..... (some code that sets i to something)
//now increase with 1
pi:=@i;
pi^:=pi^-2;
i:=i+1;
inc(i,2);

end;


there, now was that so hard ?

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
flawedmatrix
Grandmaster Cheater
Reputation: 0

Joined: 21 Jun 2006
Posts: 819
Location: 14598622 for yourself...

PostPosted: Tue Mar 13, 2007 1:05 am    Post subject: Reply with quote

Wow, I've always thought I should just do

Code:

i:=i+1;


But now we include pointers. Lol.

_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Ungreat
Expert Cheater
Reputation: 0

Joined: 27 Feb 2007
Posts: 215

PostPosted: Tue Mar 13, 2007 1:09 am    Post subject: Reply with quote

Code:
i:=i+1
is for lame people.

Code:
inc(i);
is 'teh pwnage'

or (will it allow this?)
Code:
asm
  inc i
end;
You might have to move i into eax then eax back into i... freaky thing that inline asm is.
_________________
Code:
mov     r10, qword ptr [rsp+0A28h+arg_5F8]
shl     rdx, 20h
mov     r11, 7010008004002001h
or      rax, rdx
mov     rcx, r10
xor     rcx, rax
lea     rax, [rsp+0A28h+var_2C8]
Oh man, I'm getting too excited
Back to top
View user's profile Send private message
flawedmatrix
Grandmaster Cheater
Reputation: 0

Joined: 21 Jun 2006
Posts: 819
Location: 14598622 for yourself...

PostPosted: Tue Mar 13, 2007 2:31 am    Post subject: Reply with quote

Ungreat wrote:
Code:
i:=i+1
is for lame people.

Code:
inc(i);
is 'teh pwnage'

or (will it allow this?)
Code:
asm
  inc i
end;
You might have to move i into eax then eax back into i... freaky thing that inline asm is.


I tried inc(i) before. For some reason Renko claims it doesn't work. I started using i:=i+1 ever since.

_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Tue Mar 13, 2007 2:34 am    Post subject: Reply with quote

flawedmatrix wrote:
Ungreat wrote:
Code:
i:=i+1
is for lame people.

Code:
inc(i);
is 'teh pwnage'

or (will it allow this?)
Code:
asm
  inc i
end;
You might have to move i into eax then eax back into i... freaky thing that inline asm is.


I tried inc(i) before. For some reason Renko claims it doesn't work. I started using i:=i+1 ever since.
That was when I just began, I was using invalid types.
Back to top
View user's profile Send private message
flawedmatrix
Grandmaster Cheater
Reputation: 0

Joined: 21 Jun 2006
Posts: 819
Location: 14598622 for yourself...

PostPosted: Tue Mar 13, 2007 2:37 am    Post subject: Reply with quote

Renkokuken wrote:
flawedmatrix wrote:
Ungreat wrote:
Code:
i:=i+1
is for lame people.

Code:
inc(i);
is 'teh pwnage'

or (will it allow this?)
Code:
asm
  inc i
end;
You might have to move i into eax then eax back into i... freaky thing that inline asm is.


I tried inc(i) before. For some reason Renko claims it doesn't work. I started using i:=i+1 ever since.
That was when I just began, I was using invalid types.


I am shaking my fists at you like a jewish mother in denial. Yeah, types can get annoying.

_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
pyr0magex
Grandmaster Cheater Supreme
Reputation: 0

Joined: 26 Jun 2006
Posts: 1192
Location: my room

PostPosted: Tue Mar 13, 2007 11:07 am    Post subject: Reply with quote

yea... is it just me, or do people always make things harder than it really is. Or is DarkBytes code better in some way?
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Mar 13, 2007 11:17 am    Post subject: Reply with quote

pyr0magex, read in between the lines.

Dark Byte wrote:
there, now was that so hard ?
Back to top
View user's profile Send private message
pyr0magex
Grandmaster Cheater Supreme
Reputation: 0

Joined: 26 Jun 2006
Posts: 1192
Location: my room

PostPosted: Tue Mar 13, 2007 5:11 pm    Post subject: Reply with quote

lol, but I meant in general as well, I see a lot of code that doesn't really need to be there.
_________________
Back to top
View user's profile Send private message
Ungreat
Expert Cheater
Reputation: 0

Joined: 27 Feb 2007
Posts: 215

PostPosted: Tue Mar 13, 2007 6:47 pm    Post subject: Reply with quote

I could look through public ASM scripts and truncate almost all of them (or make those jump changes more efficient via nop/jmp instead of a conditional). However, I think we can expect DarkByte to only make something more complicated than it is on purpose (like for this instance, to be 'joking' around. Oh DarkByte, you jokester you.)

Renko: Was your type an integer? xD (signed/unsigned shouldn't matter)

inc(i) should be the equivelant of i++ (in c++) or i:=i+1 (in Delphi).

Or you can do the ol' inc(i,5) for an i:=i+5, etc. If you can do one, you should be able to do the other. I think the overloaded versions exist because one in asm will be inc [mem] (or reg), where the other would be add [mem],param (or reg)

In other words... if one works, as should the other.

_________________
Code:
mov     r10, qword ptr [rsp+0A28h+arg_5F8]
shl     rdx, 20h
mov     r11, 7010008004002001h
or      rax, rdx
mov     rcx, r10
xor     rcx, rax
lea     rax, [rsp+0A28h+var_2C8]
Oh man, I'm getting too excited
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: Tue Mar 13, 2007 7:23 pm    Post subject: Reply with quote

Code:

int i = 68;
i++;


Neutral
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