Tutorial How to get and use float in armv7-il2cpp

Numark

Awesome Active Platinian
Original poster
May 23, 2017
116
929
193
Step 1: Go to this site

Step 2: Once opening, find "Decimal Floating-Point".

Step 3: Beside that, type in the number you want through 1-2000.

Step 4: Click "Rounded" or "Not Rounded", it doesn't matter which is which. Just choose one.

Step 5: Find "Single precision (32 bits):", DO NOT USE THE 64 BIT!!

Step 6: Above "Single precision (32 bits):", you should find "Hexadecimal".

Step 7: you should now find the Hexadecimal, if the numbers or letters is not there, then you haven't done STEP 3 yet.

Step 8. You should see a 4 Byte Hexadecimal, copy the 4 Byte.

Example: I chose the number 100 and clicked "Not Rounded", I scrolled down and found "Hexadecimal" above "Single precision (32 bits):"
You should see the Hexadecimal that has letters or numbers. The number I chose 100 and the Hexadecimal for that is 42C8. After that, copy that Hexadecimal.

Step 9: After copying the Hexadecimal... Go to armconverter.com.

Step 10: Make sure the page is Arm To Hex.

Step 11: Choose the architecture of Armv7.

Step 12: Now go into the text box and type in "Movt r0, #0x42C8" and you should find the hex value for it.

Float 100 Value = C8 02 44 E3

Congratulations, you now have the hex value of float 100.

Make sure to BX LR after the value of float, or just in case to end function.

BX LR = 1E FF 2F E1

Both = C8 02 44 E3 1E FF 2F E1

Thank you for understanding and learning.

I hope that this tutorial will help you guys. :)

Armconverter: ARM To HEX Converter Online
 
Last edited:

DaRealPanDa

Co-Administrator
Staff member
Supporting-Team
Global Moderator
Social Media
Mar 12, 2018
6,771
15,650
2,120
27
Skyrim
.i use 2000 but still conversation failed
2000 would be this in ARM:

"\xfa\x04\x04\xe3\x1e\xff\x2f\xe1"

Which is

FA 04 04 E3 1E FF 2F E1

The Number for 2000 in hex is:
44FA

So the Instruction would be:

MOV R0, #0x44FA
BX LR
 

Serekay

Rookie
Aug 22, 2019
4
9
3
37
Germany
YOU CAN use large float...

I dont know why expierienced modders keep this stuff secret....sometimes simply not able to help beginners.
I figure it out by myself and this is how you can do float value > 2000:

on this tool IEEE-754 Floating Point Converter you can edit the Hexadecimal Representation to get float.

Example:

you want a float value like 10000 you will get 0x461c4000 Hexadecimal Representation.

we know that arm instruction for float cant be longer than 4 digits.

just strip the hex down to 4 digits and replace any longer than 4 with 0 like this 0x461c0000, your result will be 9984 float value

in this case we can put the
c up to f to increase the float if needed

for the Instruction it will looks like this:


movt r0, #0x461c
bx lr

here are some float examples already converted to Hex:

80 0F 43 E3 1E FF 2F E1 ( 1 )
FA 03 44 E3 1E FF 2F E1 ( 500 )
7A 04 44 E3 1E FF 2F E1 ( 1 000 )
FA 04 44 E3 1E FF 2F E1 ( 2 000 )
7A 05 44 E3 1E FF 2F E1 ( 4 000 )
84 09 45 E3 1E FF 2F E1 ( 5 984 )
FA 05 44 E3 1E FF 2F E1 ( 8 000 )
1C 06 44 E3 1E FF 2F E1 ( 9 984 )
1D 06 44 E3 1E FF 2F E1 ( 10 048 )
C3 07 44 E3 1E FF 2F E1 ( 99 840 )
AA 08 44 E3 1E FF 2F E1 ( 348 160 )
67 09 44 E3 1E FF 2F E1 ( 946 176 )
BE 0C 44 E3 1E FF 2F E1 ( 99 614 720 )
6E 0E 44 E3 1E FF 2F E1 ( 998 244 352 )
BA 01 45 E3 1E FF 2F E1 (99 857 989 632 )


hope this helps.

it would be great if you can update this tutorial.
 

xadf

Solid & Active Platinian
Nov 27, 2020
82
1,532
193
Germany
YOU CAN use large float...

I dont know why expierienced modders keep this stuff secret....sometimes simply not able to help beginners.
I figure it out by myself and this is how you can do float value > 2000:

on this tool IEEE-754 Floating Point Converter you can edit the Hexadecimal Representation to get float.

Example:

you want a float value like 10000 you will get 0x461c4000 Hexadecimal Representation.

we know that arm instruction for float cant be longer than 4 digits.

just strip the hex down to 4 digits and replace any longer than 4 with 0 like this 0x461c0000, your result will be 9984 float value

in this case we can put the
c up to f to increase the float if needed

for the Instruction it will looks like this:


movt r0, #0x461c
bx lr

here are some float examples already converted to Hex:

80 0F 43 E3 1E FF 2F E1 ( 1 )
FA 03 44 E3 1E FF 2F E1 ( 500 )
7A 04 44 E3 1E FF 2F E1 ( 1 000 )
FA 04 44 E3 1E FF 2F E1 ( 2 000 )
7A 05 44 E3 1E FF 2F E1 ( 4 000 )
84 09 45 E3 1E FF 2F E1 ( 5 984 )
FA 05 44 E3 1E FF 2F E1 ( 8 000 )
1C 06 44 E3 1E FF 2F E1 ( 9 984 )
1D 06 44 E3 1E FF 2F E1 ( 10 048 )
C3 07 44 E3 1E FF 2F E1 ( 99 840 )
AA 08 44 E3 1E FF 2F E1 ( 348 160 )
67 09 44 E3 1E FF 2F E1 ( 946 176 )
BE 0C 44 E3 1E FF 2F E1 ( 99 614 720 )
6E 0E 44 E3 1E FF 2F E1 ( 998 244 352 )
BA 01 45 E3 1E FF 2F E1 (99 857 989 632 )

hope this helps.

it would be great if you can update this tutorial.
Thanks Dude!
 
  • Like
Reactions: Serekay