Hacking Wii U Hacking & Homebrew Discussion

ryuutseku85

Well-Known Member
Member
Joined
Dec 14, 2015
Messages
112
Trophies
0
Age
39
XP
427
Country
France
like i said , i will post a code today , so yes it's not a wiiu code (cause i am learning it and don't understand everything ATM)
it a simple game call mysterious number (it's in french because i'm french)
so enjoy
(when i will know enough of wiiu coding i will try a port of it)

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main ( int argc, char** argv )
{
        int choix = 0;
        int continuer = 0;

    do
    {


    printf("         =====MENU=====\n");
    printf("       Le Nombre Mystere\n");
    printf("       1-facile(1 et 10)\n");
    printf("        2-moyen(1 et 100)\n");
    printf("     3-difficile(1 et 1000)\n");
    printf("4-completement malade(1 et 10 000)\n\n");
    printf("      que veux tu faire?\n");
    scanf("%d" , &choix);

if (choix==1)
{
    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 10;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois\n\n", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");



}
if (choix==2)
{

    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 100;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");
}
if (choix==3)
{
    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 100;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");
}
if (choix==4)
{
    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 10000;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");
}
    }
    while (continuer == 1);



    return 0;
}
 
  • Like
Reactions: Garou

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,604
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,280
Country
Canada
like i said , i will post a code today , so yes it's not a wiiu code (cause i am learning it and don't understand everything ATM)
it a simple game call mysterious number (it's in french because i'm french)
so enjoy
(when i will know enough of wiiu coding i will try a port of it)

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main ( int argc, char** argv )
{
        int choix = 0;
        int continuer = 0;

    do
    {


    printf("         =====MENU=====\n");
    printf("       Le Nombre Mystere\n");
    printf("       1-facile(1 et 10)\n");
    printf("        2-moyen(1 et 100)\n");
    printf("     3-difficile(1 et 1000)\n");
    printf("4-completement malade(1 et 10 000)\n\n");
    printf("      que veux tu faire?\n");
    scanf("%d" , &choix);

if (choix==1)
{
    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 10;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois\n\n", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");



}
if (choix==2)
{

    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 100;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");
}
if (choix==3)
{
    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 100;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");
}
if (choix==4)
{
    int compteur = 0;

    int nombreentre = 0;

    int nombremystere = 0;

    const int min = 1 ;

    const int max = 10000;

    srand(time(NULL));
    nombremystere = (rand()% (max -min +1)+ min);

    do
{
    printf("quel est le nombre secret?\n\n");

    compteur++ ;

    scanf("%d" , &nombreentre);

    if(nombreentre < nombremystere)

        printf("c'est plus\n\n") ;


    else

        printf("c'est moins\n\n") ;
       }



    while (nombreentre != nombremystere);

        printf("bravo ! tu as trouve le nombre secret en %d fois", compteur);
        printf("veux tu rejouer?\n oui(1) or non(2)\n\n");
        scanf("%d", &continuer);
        printf("\n\n\n");
}
    }
    while (continuer == 1);



    return 0;
}
Taken directly from openclassroom didn't you? :P
 

Garou

Well-Known Member
Member
Joined
Jan 13, 2015
Messages
1,213
Trophies
0
XP
1,667
Country
like i said , i will post a code today , so yes it's not a wiiu code (cause i am learning it and don't understand everything ATM)
it a simple game call mysterious number (it's in french because i'm french)
so enjoy
(when i will know enough of wiiu coding i will try a port of it)
just for fun
okay I assume you're not familiar with asm, so I'm gonna give you this

you cut your game so the random number will be only between 1 - 10 (option #1)
like this
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main ( int argc, char** argv )
{
  int compteur = 0;

  int nombreentre = 0;

  int nombremystere = 0;

  const int min = 1 ;

  const int max = 10;

  srand(time(NULL));
  nombremystere = (rand()% (max -min +1)+ min);

  do
  {
  printf("quel est le nombre secret?\n\n");

  compteur++ ;

  scanf("%d" , &nombreentre);

  if(nombreentre < nombremystere)
  printf("c'est plus\n\n") ;
  else
  printf("c'est moins\n\n") ;
  }
  while (nombreentre != nombremystere);

  printf("bravo ! tu as trouve le nombre secret en %d fois\n\n", compteur);

  return 0;
}

then generate the assembly file and figure out how to read your code in asm (you can cheat by looking at the .c code)

Code:
  .section   __TEXT,__text,regular,pure_instructions
   .globl   _main
   .align   4, 0x90
_main:  ## @main
   .cfi_startproc
## BB#0:
   pushq   %rbp
Ltmp2:
   .cfi_def_cfa_offset 16
Ltmp3:
   .cfi_offset %rbp, -16
   movq   %rsp, %rbp
Ltmp4:
   .cfi_def_cfa_register %rbp
   subq   $64, %rsp
   movabsq   $0, %rax
   movl   $0, -4(%rbp)
   movl   %edi, -8(%rbp)
   movq   %rsi, -16(%rbp)
   movl   $0, -20(%rbp)
   movl   $0, -24(%rbp)
   movl   $0, -28(%rbp)
   movl   $1, -32(%rbp)
   movl   $10, -36(%rbp)
   movq   %rax, %rdi
   callq   _time
   movl   %eax, %ecx
   movl   %ecx, %edi
   callq   _srand
   callq   _rand
   movl   $10, %ecx
   cltd
   idivl   %ecx
   addl   $1, %edx
   movl   %edx, -28(%rbp)
LBB0_1:  ## =>This Inner Loop Header: Depth=1
   leaq   L_.str(%rip), %rdi
   movb   $0, %al
   callq   _printf
   leaq   L_.str1(%rip), %rdi
   leaq   -24(%rbp), %rsi
   movl   -20(%rbp), %ecx
   addl   $1, %ecx
   movl   %ecx, -20(%rbp)
   movl   %eax, -40(%rbp)  ## 4-byte Spill
   movb   $0, %al
   callq   _scanf
   movl   -24(%rbp), %ecx
   cmpl   -28(%rbp), %ecx
   movl   %eax, -44(%rbp)  ## 4-byte Spill
   jge   LBB0_3
## BB#2:  ##  in Loop: Header=BB0_1 Depth=1
   leaq   L_.str2(%rip), %rdi
   movb   $0, %al
   callq   _printf
   movl   %eax, -48(%rbp)  ## 4-byte Spill
   jmp   LBB0_4
LBB0_3:  ##  in Loop: Header=BB0_1 Depth=1
   leaq   L_.str3(%rip), %rdi
   movb   $0, %al
   callq   _printf
   movl   %eax, -52(%rbp)  ## 4-byte Spill
LBB0_4:  ##  in Loop: Header=BB0_1 Depth=1
   jmp   LBB0_5
LBB0_5:  ##  in Loop: Header=BB0_1 Depth=1
   movl   -24(%rbp), %eax
   cmpl   -28(%rbp), %eax
   jne   LBB0_1
## BB#6:
   leaq   L_.str4(%rip), %rdi
   movl   -20(%rbp), %esi
   movb   $0, %al
   callq   _printf
   movl   $0, %esi
   movl   %eax, -56(%rbp)  ## 4-byte Spill
   movl   %esi, %eax
   addq   $64, %rsp
   popq   %rbp
   retq
   .cfi_endproc

   .section   __TEXT,__cstring,cstring_literals
L_.str:  ## @.str
   .asciz   "quel est le nombre secret?\n\n"

L_.str1:  ## @.str1
   .asciz   "%d"

L_.str2:  ## @.str2
   .asciz   "c'est plus\n\n"

L_.str3:  ## @.str3
   .asciz   "c'est moins\n\n"

L_.str4:  ## @.str4
   .asciz   "bravo ! tu as trouve le nombre secret en %d fois\n\n"


.subsections_via_symbols

I posted this because I believe if you really want to learn how to hack wii u (or other systems), you have to know how to read asm code

and yes, this is x86 asm. ppc and arm asm are very different that this, but still follow the same principle (more or less^_^)
 
Last edited by Garou,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Psionic Roshambo @ Psionic Roshambo:
    Float like a butterfly burns when I pee lol
    +1
  • BigOnYa @ BigOnYa:
    So does that mean your date was not good? It burns now?
    +2
  • K3Nv2 @ K3Nv2:
    Got two new stds in one night
    +1
  • BigOnYa @ BigOnYa:
    Giggity
    +1
  • The Catboy @ The Catboy:
    I don't bite! Minus the times when I did bite
  • The Catboy @ The Catboy:
    Like 5 minutes ago
  • K3Nv2 @ K3Nv2:
    Billie needs her lunch
  • K3Nv2 @ K3Nv2:
    Ffs papa brought back the cheeseburger pizza it's like the only decent pie they had since the 80s
  • BigOnYa @ BigOnYa:
    I'm not a fan of papa johns, but that does sound good. We hardly order out pizza, I like making my own, but when we do its donatoes
  • K3Nv2 @ K3Nv2:
    I get them like once every two months anymore
  • K3Nv2 @ K3Nv2:
    Just because it's half a mile from where I live
  • BigOnYa @ BigOnYa:
    Request next time you order, that Shaq deliver it to you
  • K3Nv2 @ K3Nv2:
    I want him to buy me a chain also
  • K3Nv2 @ K3Nv2:
    Open it right next to the one we have
    +1
  • BakerMan @ BakerMan:
    guys should i make a new thread and just count the amount of posts until kyle, luke or leo joins the thread for fun?
  • BakerMan @ BakerMan:
    kyle's fine, just waiting for that wario joke

    luke and leo though, they yap until the thread's enjoyability is about halved
  • K3Nv2 @ K3Nv2:
    Leo is Luke's alterego when he gets hard
  • BigOnYa @ BigOnYa:
    Luke is gone, he got banned. And I'm surprised Leo hasn't yet
  • K3Nv2 @ K3Nv2:
    Subway was actually pretty decent tonight
  • BigOnYa @ BigOnYa:
    Wut you get, a seafood and psi salad sub
  • K3Nv2 @ K3Nv2:
    Psi had my footlong meatball special
    +1
  • PandaPandel @ PandaPandel:
    i want a meatball sandwich
    now
  • K3Nv2 @ K3Nv2:
    Gay
  • BigOnYa @ BigOnYa:
    Bout time you came out and admitted it
  • K3Nv2 @ K3Nv2:
    Bigonya talks to himself often
    +1
    K3Nv2 @ K3Nv2: Bigonya talks to himself often +1