Last active
November 23, 2021 21:38
-
-
Save zaksabeast/c2140499a1c8280602d63d08937d22f9 to your computer and use it in GitHub Desktop.
Calculates an ORAS seed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef uint64_t u64; | |
typedef uint32_t u32; | |
// Usage: ./calc 0x<save value> <epoch in milliseconds> | |
// saveValue is pulled from 0x8C71DB8 in v1.4. The value is the random number pulled 26 frames after pressing "A" to save | |
// epochTime is the current time in milliseconds | |
u32 calculateORASSeed(u32 saveValue, u64 epochTime) | |
{ | |
u64 osTime = (epochTime - 946684800000); | |
return saveValue + osTime; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
if (argc <= 2) | |
{ | |
printf("Missing arguments!\n"); | |
printf("Usage: ./seed saveValue osTime\n"); | |
return 1; | |
} | |
u32 saveValue = strtol(argv[1], NULL, 0); | |
u64 epochTime = strtoull(argv[2], NULL, 10); | |
u32 seed = calculateORASSeed(saveValue, epochTime); | |
printf("Seed: %08X\n", seed); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment