What's the algorithm to translate 8 byte memory into a double number on x86 32bit?

lllllllllllll

So basically I disassemble some code on 32bit Linux and in the rodata section, where double should exist, I find these 8 bytes:

00000000 00002440

The original double number is 10.0

Could anyone tell me how to transform this 8 bytes into double?

merlin2011

Put the bytes into a buffer and ask C to interpret the memory as a double.

#include <stdio.h>  

int main(){
    char* foo = "\x00\x00\x00\x00\x00\x00\x24\x40";
    double bar =*((double*) foo);
    printf("%f\n", bar);
}

Output:

10.000000

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Moving the memory address of a 32 bit register [esi] into an 8 bit low register in Assembly language x86

From Dev

Why is the default alignment for `int64_t` 8 byte on 32 bit x86 architecture?

From Dev

What does the ${env:ProgramFiles(x86)} Powershell variable contain on a 32bit/x86 system?

From Dev

What's the difference between local and global variables in 32-bit X86?

From Dev

What's the difference between local and global variables in 32-bit X86?

From Dev

Does AndroidStudio 32bit that worked on win8 x86 working on Windows 10 x64

From Dev

Algorithm translate a number to String

From Dev

what's the relation of "win32 project" name in visual studio to x86 or x64 platform

From Dev

What's wrong with x86 ENTER instruction?

From Dev

What's the difference between the x86 NOP and FNOP instructions?

From Dev

x86: Count transitions from 1 to 0 in 32 bit number

From Dev

Optimal uint8_t bitmap into a 8 x 32bit SIMD "bool" vector

From Dev

Assembly x86 (32-bit), call to NR_creat (8) Corrupts Filename Storage

From Dev

Assembly x86 (32-bit), call to NR_creat (8) Corrupts Filename Storage

From Dev

Byte conversion from 32 bit to 8 bit

From Java

Given a 32 bit number, what is an efficient way to scale each byte by a certain factor?

From Dev

Issues calling C-function with 32bit x86 AT&T assembly

From Dev

Issues calling C-function with 32bit x86 AT&T assembly

From Dev

X86: Comparison of last six bytes of a double type number with zero

From Dev

Generating random 32bit number in assembly

From Dev

Why does 'Any CPU (prefer 32-bit)' allow me to allocate more memory than x86 under .NET 4.5?

From Dev

11.10 x86 - memory RAM problem (shows 3.4 GB when 8 GB are installed)

From Dev

Dealing with the overflow of a 9bit result to an ADD op that is supposed to store in a byte ptr in x86

From Dev

Dealing with the overflow of a 9bit result to an ADD op that is supposed to store in a byte ptr in x86

From Dev

Translate ARM binary to x86

From Dev

Translate ARM binary to x86

From Dev

How to convert a 8-bit number to an actual byte in Python?

From Dev

PHP convert 64 bit printable number to 8 byte binary string?

From Dev

Run 32bit program with memory for a 64bit

Related Related

  1. 1

    Moving the memory address of a 32 bit register [esi] into an 8 bit low register in Assembly language x86

  2. 2

    Why is the default alignment for `int64_t` 8 byte on 32 bit x86 architecture?

  3. 3

    What does the ${env:ProgramFiles(x86)} Powershell variable contain on a 32bit/x86 system?

  4. 4

    What's the difference between local and global variables in 32-bit X86?

  5. 5

    What's the difference between local and global variables in 32-bit X86?

  6. 6

    Does AndroidStudio 32bit that worked on win8 x86 working on Windows 10 x64

  7. 7

    Algorithm translate a number to String

  8. 8

    what's the relation of "win32 project" name in visual studio to x86 or x64 platform

  9. 9

    What's wrong with x86 ENTER instruction?

  10. 10

    What's the difference between the x86 NOP and FNOP instructions?

  11. 11

    x86: Count transitions from 1 to 0 in 32 bit number

  12. 12

    Optimal uint8_t bitmap into a 8 x 32bit SIMD "bool" vector

  13. 13

    Assembly x86 (32-bit), call to NR_creat (8) Corrupts Filename Storage

  14. 14

    Assembly x86 (32-bit), call to NR_creat (8) Corrupts Filename Storage

  15. 15

    Byte conversion from 32 bit to 8 bit

  16. 16

    Given a 32 bit number, what is an efficient way to scale each byte by a certain factor?

  17. 17

    Issues calling C-function with 32bit x86 AT&T assembly

  18. 18

    Issues calling C-function with 32bit x86 AT&T assembly

  19. 19

    X86: Comparison of last six bytes of a double type number with zero

  20. 20

    Generating random 32bit number in assembly

  21. 21

    Why does 'Any CPU (prefer 32-bit)' allow me to allocate more memory than x86 under .NET 4.5?

  22. 22

    11.10 x86 - memory RAM problem (shows 3.4 GB when 8 GB are installed)

  23. 23

    Dealing with the overflow of a 9bit result to an ADD op that is supposed to store in a byte ptr in x86

  24. 24

    Dealing with the overflow of a 9bit result to an ADD op that is supposed to store in a byte ptr in x86

  25. 25

    Translate ARM binary to x86

  26. 26

    Translate ARM binary to x86

  27. 27

    How to convert a 8-bit number to an actual byte in Python?

  28. 28

    PHP convert 64 bit printable number to 8 byte binary string?

  29. 29

    Run 32bit program with memory for a 64bit

HotTag

Archive