WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: Bully@Wiiplaza on December 28, 2012, 02:31:02 PM

Title: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on December 28, 2012, 02:31:02 PM
The one who figures which on-screen value this represents deserves a medal :)

000000E2 BFA19949

Tip:
The value is 32bit. The first and second 8 byte are involved...

Have fun ;)
Title: Re: Ultimate Value Weirdness
Post by: Deathwolf on December 28, 2012, 03:00:44 PM
That must be a float value. Not sure, but I've one in my mind  :eek:
Title: Re: Ultimate Value Weirdness
Post by: megazig on December 28, 2012, 04:12:11 PM
the second 32bits does look like a float. -1.2624
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on December 28, 2012, 04:37:40 PM
Nope, no float.

The value starts at the "E" and not at the "B". Otherwise there wouldn´t be need to post the first 8 bytes.

Like the title says it´s not that easy, hehehe. It isn´t something crazy I came up with, it´s how some game handles it.
More luck next time. :p
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on December 31, 2012, 12:17:00 AM
Come on, people! Guess, imagination!

Another hint? :eek:
Title: Re: Ultimate Value Weirdness
Post by: megazig on December 31, 2012, 07:56:54 AM
only if the hint is code. otherwise it's just guessing what a random hex value is
this is why I left the thread/guessing alone
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on December 31, 2012, 01:00:29 PM
Here´s the hint:

------8- 674523-1

Note the numbers and how they are arranged.
They symbolize something you will need to know.
Title: Re: Ultimate Value Weirdness
Post by: XeR on January 01, 2013, 05:44:29 PM
1564703659 ?
2876982109 ?
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on January 01, 2013, 08:20:34 PM
I´m affraid, that´s also wrong.

Be sure to use the last hint, otherwise you won´t make it...
Title: Re: Ultimate Value Weirdness
Post by: megazig on January 01, 2013, 08:23:10 PM
that indicates little endian. but without code this is still stupid to just guess
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on January 01, 2013, 08:25:05 PM
Quote from: megazig on January 01, 2013, 08:23:10 PM
that indicates little endian. but without code this is still stupid to just guess
No little endian. Which code you want? This is a value interpretation some game uses, obviously it will be some guessing. You should use the last tip which is about the most and least significant bit(s)... :smileyface:
Title: Re: Ultimate Value Weirdness
Post by: XeR on January 02, 2013, 12:43:31 PM
Quote from: Bully@Wiiplaza on January 01, 2013, 08:25:05 PM
Quote from: megazig on January 01, 2013, 08:23:10 PM
that indicates little endian. but without code this is still stupid to just guess
No little endian. Which code you want? This is a value interpretation some game uses, obviously it will be some guessing. You should use the last tip which is about the most and least significant bit(s)... :smileyface:
Breakpoint read -> Reverse the code.
I hope you didn't guess it...
Title: Re: Ultimate Value Weirdness
Post by: megazig on January 02, 2013, 02:32:37 PM
the tip about msb is what makes it little endian
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on January 04, 2013, 12:16:21 PM
:o

Nobody made it still (not even close), so I just post the solution:
(http://jafile.com/uploads/bullywp/valueweirdness.jpg)
The "-" means that this spot doesn´t matter for the result. The numbers tell what has to be put where.
The value gets interpreted as signed, that´s why the result at 2) is correct. I do think this was solvable with given hints though. ???

Note that I figured myself how this is done by doing some tests in the game.
Truely weird. Anyone who knows what it´s about after all? "Normal" little endian goes differently.
Title: Re: Ultimate Value Weirdness
Post by: megazig on January 05, 2013, 04:52:55 AM
again, still just random numbers and little endian with bitfields on a big endian machine would have the same ugly format

EDIT:
#include <stdio.h>
#include <stdlib.h>

void hexdump(void* buffer, int len)
{
   unsigned char* buf = (unsigned char*)buffer;
   int ii = 0;
   for (ii = 0; ii < len; ii++)
   {
      printf("%02x", buf[ii]);
   }
   printf("\n");
}

typedef unsigned long long u64;
typedef unsigned long u32;
union l
{
   u64 val;
   struct foo {
      unsigned top: 4;
      unsigned middle: 32;
      unsigned bottom: 28;
   } bar;;

} value;

int main(int argc, char ** argv)
{
   value.bar.top = 0;
   value.bar.middle = 0x12345678;
   value.bar.bottom = 0;
   value.val >>= 4;
   hexdump(&value, 8);
   return EXIT_SUCCESS;
}

run on a PC (little endian (x86)) and you'll see the values

0000008067452301
http://codepad.org/WOI0V192

SO... please don't say not even close. I had it spot on, you just don't know memory format
Title: Re: Ultimate Value Weirdness
Post by: Bully@Wiiplaza on January 07, 2013, 06:24:26 PM
Okay, I didn´t know the memory format. Thanks for the code and everything.
You really knew this memory format after all? Good job.