 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Tue May 28, 2019 11:35 am Post subject: |
|
|
exchange every 1st and 4th byte and every 2nd and 3rd
_________________
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 |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Tue May 28, 2019 1:25 pm Post subject: |
|
|
not reverse?
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Wed May 29, 2019 2:37 am Post subject: |
|
|
Corroder wrote: | not reverse? |
nope.
https://forum.cheatengine.org/viewtopic.php?t=606701
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Wed May 29, 2019 4:47 pm Post subject: |
|
|
Meiyoh wrote: | seems like no one wants to help... |
That or no one wants to do it for you, you might want to show a little effort. Doesn't even seem like you want to help yourself. And you were told exactly how to do it.
_________________
|
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Wed May 29, 2019 4:50 pm Post subject: |
|
|
Meiyoh wrote: | seems like no one wants to help.
I want a script that reads bytes from RPCS3 and converts the input to them to big endian.
like
if script wants to add +3fD0
to add
do3F auto instead and read the address addint to as a big endian. |
you have no choice, you must emulate whatever endianness is needed.
just build couple functions:
- convert to big
- convert to lil
- add_function (calls convert to lil, do addition then convert back)
but i believe you are too lazy, or you got used to let people do stuff for you.
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Wed May 29, 2019 9:17 pm Post subject: |
|
|
[quote="OldCheatEngineUser"] Meiyoh wrote: | seems like no one wants to help.
I want a script that reads bytes from RPCS3 and converts the input to them to big endian.
...
but i believe you are too lazy, or you got used to let people do stuff for you. |
I agree, some people need help but do not want to show what they have done, in this case at least as shown the code or script they have made.
And most importantly, they don't say exactly what they really need with an example.
Maybe they fear someone will steal or use the code they make, like a phobia...
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu May 30, 2019 6:50 am Post subject: |
|
|
Meiyoh wrote: | I have spent whole two days trying to incrememnt value from hex regular form but problem here is values are NON=STATIC so icant make a correct calculation as one time it shall be NEGATIVE next time postivie like 0Xbla
or -0xbla
therefore no correct math because the base value of the address i use changes.
I have reversed the bytes before DB said but the problem for readInteger and writeInteger still exists .
... |
So where is the code the reverses the bytes, because the code you posted does nothing of the sort. And DB didn't say to reverse the bytes, that won't work for an AOB.
Dark Byte wrote: | exchange every 1st and 4th byte and every 2nd and 3rd |
And "readInteger" and "writeInteger" are not for BE or LE you'll need to setup your own functions for those. That's why they don't work.
Meiyoh wrote: | ...
And it was insulting of you all calling me lazy.
I am not as versed in ASM as you here nor i am into lua.
... |
Well it wasn't meant as a compliment. And you'll never learn just making requests, you actually need to write some code; do some tutorials and just try stuff and see how it works, life doesn't come with a tutorial and you just have to give stuff a try.
And just spamming every topic you made with the same code that does nothing to deal with BE or LE values doesn't really show that you're not lazy. Seems like you just grabbed the first bit of code you found and posted it in all your topics. Is this the code you wrote to "Convert to Big Endian Array of Bytes" and "make CE read and write all values as Big Endian"? You need to setup some conversion functions, one for BE, LE, and AOBs like you want.
Meiyoh wrote: | ...
if i change value to BIG ENDIAN in address list it is displayed correctly therefor its big endian as adding to the value gives correct result but i cant make a script that reads and writes in the correct bytes order.... |
If you have the memory records on the address list you could try just getting the memory record with "getMemoryRecordByDescription" and then use "MR.Value" to manipulate the value but you'll need to convert that to a number with "tonumber" so you can use math on it.
_________________
|
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu May 30, 2019 7:59 am Post subject: |
|
|
Meiyoh wrote: | ...
Thanks for the "help" i think you shall all close those forums and tell users like me to fuck of and you fucking elitists to remain chatting yourselves.! Really nice "help" everyone asking for help is lazy and needs to make things themselves.
Tim I am sorry I thought very high of you i valued you and respected you as a maker for codes on many games now I see truth. You and SunBean need your asses to learn some manners and remove that big pride you have. You are nothing. If you treat people like this you are nothing no matter how much you are good with coding.
Pride is downfall. Mark my words.
And I am not your victim to spread your hatred because you have some issues OK!
Calling me lazy whatever I DONT FUCKING CARE!
Thanks again FOR Nothing! |
You were told multiple ways how to do this and tried none of them, but sure it's everyone else's fault.
And I have always said, I'll pass a man asking for fish to finds one that's willing to learn to fish for himself; so nothing's really changed. But whatever helps you feel better about yourself I guess.
_________________
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Thu May 30, 2019 8:37 am Post subject: |
|
|
Wow, surprise... getting hot here
It this topic close?. But, whatever, here some stuffs:
Code: | ref_endianness = [[
Big endian machine: An int is 4 bytes, and the first is the largest.
Read 4 bytes (W X Y Z) and W is the largest.
The number is 0x12345678.
Little endian machine: an int is 4 bytes, but the first is smallest.
Read W X Y Z, but W belongs way in the back -- it's the littlest.
The number is 0x78563412.
W = 0x12 // set data
X = 0x34
Y = 0x56
Z = 0x78
// data is W, X, Y, Z
big_short = (W <<8) + X
little_short = W + (X << 8)
big_int = (W << 24) + (X << 16) + (Y << 8) + Z
little_int = W + (X << 8) + (Y << 16) + (Z << 24)
// now, in hex
hex(big_short) = 0x1234
hex(little_short) = 0x3412
hex(big_int) = 0x12345678
hex(little_int) = 0x7856341
test reverse:
-------------
str = '12345678'
s = string.sub(str,7,8)..string.sub(str,5,6)..string.sub(str,3,4)..string.sub(str,1,2)
print(s) = 78563412 or 0x78563412
]]
|
Now back to the topic.
In fact CE scan for the little-endian value type. So for the big-endian need to define a custom type.
So for the game RPCS3 as @Meiyoh wish to get the custom type big-endian, published by Dennis Stanistan somewhere, here the steps to define the custom type:
1. Open CE Setting and enable MEM_MAPPED
2. Attach RPCS3.exe
3. Goto box 'Value Type', right click and choose 'Define New Custom Type (Auto Assembler)
4. Copy paste below script to AA engine windows and click OK
Code: | //4 Bytes Big Endian
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
TypeName:
db '4 Byte Big Endian',0
ByteSize:
dd 4
//The convert routine should hold a routine that converts the data to an integer (in eax)
//function declared as: stdcall int ConvertRoutine(unsigned char *input);
//Note: Keep in mind that this routine can be called by multiple threads at the same time.
ConvertRoutine:
//jmp dllname.functionname
[64-bit]
//or manual:
//parameters: (64-bit)
//rcx=address of input
xor eax,eax
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
bswap eax //convert to big endian
ret
[/64-bit]
[32-bit]
//jmp dllname.functionname
//or manual:
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//example:
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
bswap eax
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
//jmp dllname.functionname
//or manual:
[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address of output
//example:
bswap ecx //convert the little endian input into a big endian input
mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit]
[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
//example:
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
//convert the value to big endian
bswap eax
mov [ebx],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]
|
Do again steps 3 and 4 for script below:
Code: | //Float Big Endian
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(UsesFloat,4)
TypeName:
db 'Float Big Endian',0
ByteSize:
dd 4
UsesFloat:
db 01
ConvertRoutine:
[32-bit]
push ebp
mov ebp,esp
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax] //place the bytes into eax
bswap eax
pop ebp
ret 4
[/32-bit]
[64-bit]
//rcx=address of input
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
bswap eax
ret
[/64-bit]
ConvertBackRoutine:
[32-bit]
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
bswap eax
mov [ebx],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]
[64-bit]
//ecx=input
//rdx=address of output
bswap ecx
mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit] |
Go to the game and change the money value by scan it and get the correct address.
Now that you are equipped with this knowledge, go and have fun.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
Meiyoh Master Cheater
Reputation: 1
Joined: 14 Mar 2015 Posts: 402
|
Posted: Thu May 30, 2019 8:45 am Post subject: |
|
|
Corroder wrote: | Wow, surprise... getting hot here
It this topic close?. But, whatever, here some stuffs:
Code: | ref_endianness = [[
Big endian machine: An int is 4 bytes, and the first is the largest.
Read 4 bytes (W X Y Z) and W is the largest.
The number is 0x12345678.
Little endian machine: an int is 4 bytes, but the first is smallest.
Read W X Y Z, but W belongs way in the back -- it's the littlest.
The number is 0x78563412.
W = 0x12 // set data
X = 0x34
Y = 0x56
Z = 0x78
// data is W, X, Y, Z
big_short = (W <<8) + X
little_short = W + (X << 8)
big_int = (W << 24) + (X << 16) + (Y << 8) + Z
little_int = W + (X << 8) + (Y << 16) + (Z << 24)
// now, in hex
hex(big_short) = 0x1234
hex(little_short) = 0x3412
hex(big_int) = 0x12345678
hex(little_int) = 0x7856341
test reverse:
-------------
str = '12345678'
s = string.sub(str,7,8)..string.sub(str,5,6)..string.sub(str,3,4)..string.sub(str,1,2)
print(s) = 78563412 or 0x78563412
]]
|
Now back to the topic.
In fact CE scan for the little-endian value type. So for the big-endian need to define a custom type.
So for the game RPCS3 as @Meiyoh wish to get the custom type big-endian, published by Dennis Stanistan somewhere, here the steps to define the custom type:
1. Open CE Setting and enable MEM_MAPPED
2. Attach RPCS3.exe
3. Goto box 'Value Type', right click and choose 'Define New Custom Type (Auto Assembler)
4. Copy paste below script to AA engine windows and click OK
Code: | //4 Bytes Big Endian
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
TypeName:
db '4 Byte Big Endian',0
ByteSize:
dd 4
//The convert routine should hold a routine that converts the data to an integer (in eax)
//function declared as: stdcall int ConvertRoutine(unsigned char *input);
//Note: Keep in mind that this routine can be called by multiple threads at the same time.
ConvertRoutine:
//jmp dllname.functionname
[64-bit]
//or manual:
//parameters: (64-bit)
//rcx=address of input
xor eax,eax
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
bswap eax //convert to big endian
ret
[/64-bit]
[32-bit]
//jmp dllname.functionname
//or manual:
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//example:
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
bswap eax
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
//jmp dllname.functionname
//or manual:
[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address of output
//example:
bswap ecx //convert the little endian input into a big endian input
mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit]
[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
//example:
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
//convert the value to big endian
bswap eax
mov [ebx],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]
|
Do again steps 3 and 4 for script below:
Code: | //Float Big Endian
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(UsesFloat,4)
TypeName:
db 'Float Big Endian',0
ByteSize:
dd 4
UsesFloat:
db 01
ConvertRoutine:
[32-bit]
push ebp
mov ebp,esp
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax] //place the bytes into eax
bswap eax
pop ebp
ret 4
[/32-bit]
[64-bit]
//rcx=address of input
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
bswap eax
ret
[/64-bit]
ConvertBackRoutine:
[32-bit]
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
bswap eax
mov [ebx],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]
[64-bit]
//ecx=input
//rdx=address of output
bswap ecx
mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit] |
Go to the game and change the money value by scan it and get the correct address.
Now that you are equipped with this knowledge, go and have fun.  |
Thanks Corudder . I value your help i will try it i already have found some way to convert the values to big endian although call it primitive but at least works. I will try your advice.
Tim i am sorry but you acted rude and still do. I never blamed anyone but you must realize you learn stuff from others and by trial and error no one is born learned and if there are no examples how can we know what to do.
In fact Tim i shall be thanking you. You made my low blood pressure rise so i feel better now. Not even coffee can do it.
_________________
I am the forgotten one the dead one. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Thu May 30, 2019 8:52 am Post subject: |
|
|
also
Code: |
CustomType class (Object)
The custom type is an convertor of raw data, to a human readable interpretation.
global functions
registerCustomTypeLua(typename, bytecount, bytestovaluefunction, valuetobytesfunction, isFloat)
Registers a Custom type based on lua functions
The bytes to value function should be defined as "function bytestovalue (b1,b2,b3,b4)" and return an integer as result
The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write
returns the Custom Type object
registerCustomTypeAutoAssembler(script)
Registers a custom type based on an auto assembler script. The script must allocate an "ConvertRoutine" and "ConvertBackRoutine"
returns the Custom Type object
getCustomType(typename) : Returns the custom type object, or nil if not found
properties
name: string
functiontypename: string
CustomTypeType: TCustomTypeType - The type of the script
script: string - The custom type script
scriptUsesFloat: boolean - True if this script interprets it's user side values as float
methods
byteTableToValue({bytetable},Address Optional)
valueToByteTable(value, Address Optional)
|
so you can use the customtype in lua
_________________
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 |
|
 |
Meiyoh Master Cheater
Reputation: 1
Joined: 14 Mar 2015 Posts: 402
|
Posted: Thu May 30, 2019 8:57 am Post subject: |
|
|
Dark Byte wrote: | also
Code: |
CustomType class (Object)
The custom type is an convertor of raw data, to a human readable interpretation.
global functions
registerCustomTypeLua(typename, bytecount, bytestovaluefunction, valuetobytesfunction, isFloat)
Registers a Custom type based on lua functions
The bytes to value function should be defined as "function bytestovalue (b1,b2,b3,b4)" and return an integer as result
The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write
returns the Custom Type object
registerCustomTypeAutoAssembler(script)
Registers a custom type based on an auto assembler script. The script must allocate an "ConvertRoutine" and "ConvertBackRoutine"
returns the Custom Type object
getCustomType(typename) : Returns the custom type object, or nil if not found
properties
name: string
functiontypename: string
CustomTypeType: TCustomTypeType - The type of the script
script: string - The custom type script
scriptUsesFloat: boolean - True if this script interprets it's user side values as float
methods
byteTableToValue({bytetable},Address Optional)
valueToByteTable(value, Address Optional)
|
so you can use the customtype in lua |
Hooray DB Thank you!
Always helping always!
Thank you all. God bless you all!
_________________
I am the forgotten one the dead one. |
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu May 30, 2019 4:32 pm Post subject: |
|
|
Meiyoh wrote: | seems like no one wants to help... |
Meiyoh wrote: | ...
Tim i am sorry but you acted rude and still do. I never blamed anyone but you must realize you learn stuff from others and by trial and error no one is born learned and if there are no examples how can we know what to do.
In fact Tim i shall be thanking you. You made my low blood pressure rise so i feel better now. Not even coffee can do it.  |
Complaining that no one is willing to help you when you have been given help is rude as shit. All I ever said was to put in some effort. But I like how you delete all your posts and try to act like you did nothing wrong. But like I said, whatever makes you feel better about yourself I guess. And just know I always have and always will be outspoken.
_________________
|
|
Back to top |
|
 |
Meiyoh Master Cheater
Reputation: 1
Joined: 14 Mar 2015 Posts: 402
|
|
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
|
|