Hacking Wii U Hacking & Homebrew Discussion

ryuutseku85

Well-Known Member
Member
Joined
Dec 14, 2015
Messages
110
Trophies
0
Age
39
XP
416
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,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,218
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.
    D @ diamondsofmayhem: G'night!