 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
iam_clint How do I cheat?
Reputation: 0
Joined: 14 Dec 2007 Posts: 0
|
Posted: Fri Dec 14, 2007 6:42 pm Post subject: Assembly Int to String? |
|
|
need help to convert an int to a string in assembly
example provided
---
| Code: |
push eax
mov eax,[10232F2] //This value for example could be 22
mov [10332D],eax //[10332D] is a text for example A Goat
pop eax
|
--
when I run this code I get a hex value in the text field so say it was 22 being pushed into that text it would show 0x16 if i swap the text to a byte field in CE but when its in text view it shows a random symbol/letter
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Fri Dec 14, 2007 7:24 pm Post subject: |
|
|
Check m32lib's version of ITOA.
_________________
|
|
| Back to top |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Fri Dec 14, 2007 7:55 pm Post subject: |
|
|
| Code: | | invoke crt__itoa, <number>, <pointer to string buffer>, <radix> |
Example:
| Code: | .DATA
somestring db 50 dUP(00)
magicalnumber dd 13371337h
.CODE
start:
mov eax,magicalnumber
invoke crt__itoa, eax, offset somestring, 10h |
or
| Code: | .DATA
somestring db 50 dUP(00)
magicalnumber dd 13371337h
.CODE
start:
push 16
push offset somestring
push magicalnumber
call crt__itoa
add esp,0ch | They do the same thing. Make sure you import msvcrt though...
For string to int I just use StrToInt... if the string is, say "10" it'll return 10 in eax(0x0a), and if the string is, say "$10", it'll return 16 in eax(0x10). The $ sign simply means 'hexidecimal', You can use crt__atoi as well, but if the result is the same, I'm fine with being a slut for simplicity- in which StrToInt takes the cake.
_________________
|
|
| Back to top |
|
 |
iam_clint How do I cheat?
Reputation: 0
Joined: 14 Dec 2007 Posts: 0
|
Posted: Fri Dec 14, 2007 8:36 pm Post subject: |
|
|
| Uzeil wrote: | | Code: | | invoke crt__itoa, <number>, <pointer to string buffer>, <radix> |
Example:
| Code: | .DATA
somestring db 50 dUP(00)
magicalnumber dd 13371337h
.CODE
start:
mov eax,magicalnumber
invoke crt__itoa, eax, offset somestring, 10h |
or
| Code: | .DATA
somestring db 50 dUP(00)
magicalnumber dd 13371337h
.CODE
start:
push 16
push offset somestring
push magicalnumber
call crt__itoa
add esp,0ch | They do the same thing. Make sure you import msvcrt though...
For string to int I just use StrToInt... if the string is, say "10" it'll return 10 in eax(0x0a), and if the string is, say "$10", it'll return 16 in eax(0x10). The $ sign simply means 'hexidecimal', You can use crt__atoi as well, but if the result is the same, I'm fine with being a slut for simplicity- in which StrToInt takes the cake. |
Thanks
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Dec 15, 2007 12:51 am Post subject: |
|
|
The source code for the Microsoft Visual C++ runtime library comes with visual studio, for compilation purposes, not sure on their copying stance though.
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|