| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Dark Byte Site Admin
  Reputation: 470
  Joined: 09 May 2003 Posts: 25807 Location: The netherlands
  | 
		
			
				 Posted: Mon Mar 12, 2007 9:19 pm    Post subject: Increasing a integer in delphi | 
				       | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		flawedmatrix Grandmaster Cheater
  Reputation: 0
  Joined: 21 Jun 2006 Posts: 819 Location: 14598622 for yourself...
  | 
		
			
				 Posted: Tue Mar 13, 2007 1:05 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				Wow, I've always thought I should just do
 
 
 
 
But now we include pointers. Lol.
 _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Ungreat Expert Cheater
  Reputation: 0
  Joined: 27 Feb 2007 Posts: 215
 
  | 
		
			
				 Posted: Tue Mar 13, 2007 1:09 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 is for lame people.
 
 
 is 'teh pwnage'
 
 
or (will it allow this?)
 
  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 | 
		 | 
	
	
		  | 
	
	
		flawedmatrix Grandmaster Cheater
  Reputation: 0
  Joined: 21 Jun 2006 Posts: 819 Location: 14598622 for yourself...
  | 
		
			
				 Posted: Tue Mar 13, 2007 2:31 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | Ungreat wrote: | 	 		   is for lame people.
 
 
 is 'teh pwnage'
 
 
or (will it allow this?)
 
  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 | 
		 | 
	
	
		  | 
	
	
		Renkokuken GO Moderator
  Reputation: 4
  Joined: 22 Oct 2006 Posts: 3249
 
  | 
		
			
				 Posted: Tue Mar 13, 2007 2:34 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | flawedmatrix wrote: | 	 		   	  | Ungreat wrote: | 	 		   is for lame people.
 
 
 is 'teh pwnage'
 
 
or (will it allow this?)
 
  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 | 
		 | 
	
	
		  | 
	
	
		flawedmatrix Grandmaster Cheater
  Reputation: 0
  Joined: 21 Jun 2006 Posts: 819 Location: 14598622 for yourself...
  | 
		
			
				 Posted: Tue Mar 13, 2007 2:37 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | Renkokuken wrote: | 	 		   	  | flawedmatrix wrote: | 	 		   	  | Ungreat wrote: | 	 		   is for lame people.
 
 
 is 'teh pwnage'
 
 
or (will it allow this?)
 
  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 | 
		 | 
	
	
		  | 
	
	
		pyr0magex Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 26 Jun 2006 Posts: 1192 Location: my room
  | 
		
			
				 Posted: Tue Mar 13, 2007 11:07 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		appalsap Moderator
  Reputation: 0
  Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
  | 
		
			
				 Posted: Tue Mar 13, 2007 11:17 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				pyr0magex, read in between the lines.
 
 
 	  | Dark Byte wrote: | 	 		  | there, now was that so hard ? | 	  
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		pyr0magex Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 26 Jun 2006 Posts: 1192 Location: my room
  | 
		
			
				 Posted: Tue Mar 13, 2007 5:11 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		Ungreat Expert Cheater
  Reputation: 0
  Joined: 27 Feb 2007 Posts: 215
 
  | 
		
			
				 Posted: Tue Mar 13, 2007 6:47 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		Noz3001 I'm a spammer
  Reputation: 26
  Joined: 29 May 2006 Posts: 6220 Location: /dev/null
  | 
		
			
				 Posted: Tue Mar 13, 2007 7:23 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				
 
 
 
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		 |