Lucky Number

Description

Find the lucky number and get your rewards :D

Download Link : lucky_number.runarrow-up-right

MD5 of the file : 4fc64afc55f6aac260254cf4ef944ed0

Flag Format : BDSEC{lucky_number_here}

Example Flag : BDSEC{2023}

Author : NomanProdhan

Solution

After opening file in ghidra and navigating to main function we get pseudo code:

  ...
  printf("Enter a number to check if its a lucky number: ");
  scanf("%llu",&userInput);
  userInput = reverseNumber(userInput);
  luckyNumberGen(&luckyNumber);
  if (luckyNumber == userInput) {
    puts("Wow ! You guessed the lucky number.");
    puts("Now submit the lucky number to get your points");
  }
  else {
    puts("Damn ! You are unlucky like me :( ");
  }
  ...

I already renamed the functions and variables. First function reverseNumber is a standard for loop which reverses the number mathematically. readingarrow-up-right

Replicate luckyNumberGen:

circle-check

Last updated