| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| TwinShards Newbie cheater
 
 ![]() Reputation: 0 
 Joined: 23 Jan 2023
 Posts: 11
 
 
 | 
			
				|  Posted: Thu Jan 30, 2025 1:13 am    Post subject: How can i convert hex decimal to string or vise versa in ASM |   |  
				| 
 |  
				| I've tried rly hard to find my answer with no success. 
 So how can i, for example, convert this integer: 1008466724768 to be a string or vise versa? I only need this to compare an address containing the 8 bytes value.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Dark Byte Site Admin
 
  Reputation: 470 
 Joined: 09 May 2003
 Posts: 25807
 Location: The netherlands
 
 | 
			
				|  Posted: Thu Jan 30, 2025 4:47 am    Post subject: |   |  
				| 
 |  
				| looks like a pointer, so you'll have to read the memory at the address is points to and try to interpret that _________________
 
 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 |  | 
	
		|  | 
	
		| TwinShards Newbie cheater
 
 ![]() Reputation: 0 
 Joined: 23 Jan 2023
 Posts: 11
 
 
 | 
			
				|  Posted: Thu Jan 30, 2025 11:58 am    Post subject: |   |  
				| 
 |  
				| 1008466724768 was just an example, and no what i am trying to compare is not a pointer. 
 I have an address which contain 1008466724768 as hex decimal (aka EACD4D07A0)
 
 and an address which will contain at some point 1008466724768 as a string
 
 I need to convert one or the other so i can cmp them.
 
 Update:
 
 Considering cheat engine itself already does that, i figured i could probably just search to find the OpCode that does the job.
 
 I was able to find what i was looking for. For those looking for the same thing:
 My current CE version is 7.4
 
 Use a 2nd CE window to hook on the other one and in memory viewer, Search > Find Memory.
 
 The AOB should be: 48 83 C6 01 48 89 CA 48 B8 CD CC CC CC CC CC CC CC 48 F7 E2 48 C1 EA 03 48 89 D7 48 6B D7 0A 48 89 C8 48 29 D0 48 83 C0 30 88 06 48 89 F9 48 85 FF 75 CD
 (rcx initially contain 000000EACD4D07A0)
 
 The OpCode above convert Hex 000000EACD4D07A0 to string 8674276648001 then just flip the string to 1008466724768.
 
 Last edited by TwinShards on Thu Jan 30, 2025 2:52 pm; edited 1 time in total
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ParkourPenguin I post too much
 
  Reputation: 152 
 Joined: 06 Jul 2014
 Posts: 4706
 
 
 | 
			
				|  Posted: Thu Jan 30, 2025 2:36 pm    Post subject: |   |  
				| 
 |  
				| Calling a library function like `strtoll` would be the easiest option. If you don't know all the details of calling conventions to call the function yourself in assembly, use {$ccode}: 
 You can also write to the register parameters. e.g. 	  | Code: |  	  | [ENABLE] globalalloc(foo,4096)
 label(out_int)
 label(my_hex_string)
 
 foo:
 push rbp
 mov rbp,rsp
 sub rsp,20
 mov rax,my_hex_string
 {$ccode hexstring=rax}
 extern long long out_int;
 long long strtoll(const char* str, char** str_end, int base);
 
 out_int = strtoll((const char *)hexstring, 0, 16);
 {$asm}
 mov rsp,rbp
 pop rbp
 ret
 
 align 4 CC
 out_int:
 dq 0
 my_hex_string:
 db 'B24F301A930100' 0
 
 registersymbol(out_int)
 registersymbol(my_hex_string)
 createthread(foo)
 
 [DISABLE]
 | 
 
  	  | Code: |  	  | {$ccode hexstring=rax output=rcx} long long strtoll(const char* str, char** str_end, int base);
 
 output=strtoll(...)
 {$asm}
 // rcx is now the converted 8-byte int
 ...
 | 
 _________________
 
 I don't know where I'm going, but I'll figure it out when I get there. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| TwinShards Newbie cheater
 
 ![]() Reputation: 0 
 Joined: 23 Jan 2023
 Posts: 11
 
 
 | 
			
				|  Posted: Thu Jan 30, 2025 2:53 pm    Post subject: |   |  
				| 
 |  
				| Thank for the help Dark Byte & ParkourPenguin! I updated my 2nd post. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ep!chack How do I cheat?
 
 ![]() Reputation: 1 
 Joined: 11 Sep 2015
 Posts: 4
 
 
 | 
			
				|  Posted: Sat Apr 26, 2025 8:44 pm    Post subject: |   |  
				| 
 |  
				| 1. Find Browser Tab PID Open Cheat Engine → click Select Process → pick your browser.
 
 Or in Chrome, press Shift + Esc → find the PID → match it in Cheat Engine.
 
 2. Convert HEX ↔ Decimal in ASM
 Hex to decimal:
 
 asm
 Copy
 Edit
 mov eax, 0x10   // hex 10 = decimal 16
 Decimal to hex:
 
 asm
 Copy
 Edit
 mov eax, 16     // decimal 16 = hex 0x10
 CPU sees them the same!
 
 3. Make Text (String) in ASM
 Example:
 
 asm
 Copy
 Edit
 db 'Hello',0
 (db writes the text directly in memory.)
 
 Short Notes:
 0x10 = hex
 
 16 = decimal
 
 'A' = 0x41 (ASCII letter A)
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |