| View previous topic :: View next topic |
| Author |
Message |
Polynomial Grandmaster Cheater
Reputation: 5
Joined: 17 Feb 2008 Posts: 524 Location: Inside the Intel CET shadow stack
|
Posted: Sat Feb 19, 2011 4:32 am Post subject: |
|
|
Just as a note here:
IEEE floats do not have any defined endianness when abstracted, so they may be stored in either (i.e. 0x01234567 or 0x67452301) in memory depending on how the compiler works. In .NET the endianness may be totally different to the implementation of Java, or the endianness of C. Some compilers tie to the standard endianness of the model of processor that is being targeted (e.g. little-endian on Intel CPUs) whereas some stick to one endian type regardless of target architecture. Some may actually switch endianness depending on the OS you target (e.g. cross-platform framework). When you use Array.Reverse() on a byte array being passed to a BitConverter function, you are flipping the endianness. It may actually turn out that in certain strange circumstances you are in fact required not to reverse it. The way to check is with the BitConverter.IsLittleEndian value. I would imagine in this case the answer is false, but if not then it means you're attaching to a process that handles its own internal float memory operations. Be careful, it's a jungle out there. _________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time. |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Sun Feb 20, 2011 8:30 am Post subject: |
|
|
| Burningmace wrote: | Just as a note here:
IEEE floats do not have any defined endianness when abstracted, so they may be stored in either (i.e. 0x01234567 or 0x67452301) in memory depending on how the compiler works. In .NET the endianness may be totally different to the implementation of Java, or the endianness of C. Some compilers tie to the standard endianness of the model of processor that is being targeted (e.g. little-endian on Intel CPUs) whereas some stick to one endian type regardless of target architecture. Some may actually switch endianness depending on the OS you target (e.g. cross-platform framework). When you use Array.Reverse() on a byte array being passed to a BitConverter function, you are flipping the endianness. It may actually turn out that in certain strange circumstances you are in fact required not to reverse it. The way to check is with the BitConverter.IsLittleEndian value. I would imagine in this case the answer is false, but if not then it means you're attaching to a process that handles its own internal float memory operations. Be careful, it's a jungle out there. |
Thanks for this info
I will try to use the ".IsLittleEndian" to check if I have to reverse it, or not
Thanks :> |
|
| Back to top |
|
 |
SlowPoke69 How do I cheat?
Reputation: 0
Joined: 18 Feb 2011 Posts: 7
|
Posted: Sat Feb 26, 2011 9:27 am Post subject: |
|
|
I was having the same issue..
thank you guys so much!
It Works! YaY! |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Mon Mar 07, 2011 8:04 am Post subject: |
|
|
#Delete This Please
Last edited by Miaurice on Mon Mar 28, 2011 2:45 pm; edited 1 time in total |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Mon Mar 28, 2011 2:24 pm Post subject: |
|
|
I dont fucking get it.
Is someone able to reverse the routine again?
So if I have the "2500", how to get "451C4000" out of it
I'm sorry I'm too stupid for it..
Thanks for any help :// |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Mar 28, 2011 7:34 pm Post subject: |
|
|
what don't you get?
BitConverter.GetBytes() |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Tue Mar 29, 2011 9:06 am Post subject: |
|
|
I tried this:
| Code: | Dim MyArray() As Byte = BitConverter.GetBytes(2500)
Array.Reverse(MyArray)
Return MyArray |
Doesn't give me "451C4000"
:/ |
|
| Back to top |
|
 |
AhMunRa Grandmaster Cheater Supreme
Reputation: 27
Joined: 06 Aug 2010 Posts: 1117
|
Posted: Tue Mar 29, 2011 9:41 am Post subject: |
|
|
Try using uint instead. In .NET a float does some unwanted math on floats with more than 7 numbers in total.
IE 0x451C4000 is 1159479296.
I ran into this issue a few weeks ago doing SHR conversions on hex numbers. Every 3rd run the number was getting rounded up or down. I changed the type to uint and it cured the issue.
http://www.homeandlearn.co.uk/csharp/csharp_s2p6.html _________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.> |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Tue Mar 29, 2011 10:02 am Post subject: |
|
|
| AhMunRa wrote: | Try using uint instead. In .NET a float does some unwanted math on floats with more than 7 numbers in total.
IE 0x451C4000 is 1159479296.
I ran into this issue a few weeks ago doing SHR conversions on hex numbers. Every 3rd run the number was getting rounded up or down. I changed the type to uint and it cured the issue. |
Hmmh..
1159479296 is "4 Bytes" in CheatEngine
But I need to deal with the "2500" (which is Float (In vb.net Single))
:/
So I can't switch to UInt..  |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Tue Mar 29, 2011 10:20 am Post subject: |
|
|
Use the Converter namespace if you are looking to convert from one type to another. _________________
- Retired. |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Tue Mar 29, 2011 10:37 am Post subject: |
|
|
| Wiccaan wrote: | | Use the Converter namespace if you are looking to convert from one type to another. |
If I do that I get that "1,159479E+09" again.. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Tue Mar 29, 2011 10:42 am Post subject: |
|
|
| Miaurice wrote: | | Wiccaan wrote: | | Use the Converter namespace if you are looking to convert from one type to another. |
If I do that I get that "1,159479E+09" again.. |
Basing on how you are posting:
| Code: |
float fValue = 2500.0f;
UInt32 uValue = Convert.ToUInt32(fValue);
|
Doing this I get a perfectly fine result, uValue contains 2500 properly. _________________
- Retired. |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Tue Mar 29, 2011 10:50 am Post subject: |
|
|
| Wiccaan wrote: | | Miaurice wrote: | | Wiccaan wrote: | | Use the Converter namespace if you are looking to convert from one type to another. |
If I do that I get that "1,159479E+09" again.. |
Basing on how you are posting:
| Code: |
float fValue = 2500.0f;
UInt32 uValue = Convert.ToUInt32(fValue);
|
Doing this I get a perfectly fine result, uValue contains 2500 properly. |
| Code: | Dim MyFloat As Single = 2500.0F
Dim MyInt As UInt32 = Convert.ToUInt32(MyFloat) |
Gives Me MyInt = 2500
But I need 451C4000..
I already have 2500 from the beginning, I don't have 2500.0F. Its a clean 2500.
But what I now need is to get 451C4000 out of that 2500 |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Tue Mar 29, 2011 11:27 am Post subject: |
|
|
| Code: | float fValue = 2500.0f;
UInt32 uValue = Convert.ToUInt32(fValue);
byte[] btBytes = BitConverter.GetBytes(Convert.ToSingle(uValue)); |
Should do it. _________________
- Retired. |
|
| Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Tue Mar 29, 2011 12:22 pm Post subject: |
|
|
| Code: | | BitConverter.GetBytes(Convert.ToSingle(2500)) |
In my tries i forgot the "Convert.ToSingle()"
This did it!
Thanks again! I will post it in the Post at the first page (:
I would like to +rep you, but I seem to not be able to do this with my low Post-Count.. |
|
| Back to top |
|
 |
|