--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2772 lines
80 KiB
C++
2772 lines
80 KiB
C++
#include "classes.h"
|
|
|
|
// 00428940
|
|
void Seeds::Init3(RNG *rng)
|
|
{
|
|
code *pcVar1;
|
|
uint32_t seed;
|
|
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((uint8_t)rng->_shift1 & 0x1f) ^ seed;
|
|
seed = seed ^ seed << ((uint8_t)rng->_shift2 & 0x1f);
|
|
seed = seed ^ seed >> ((uint8_t)rng->_shift3 & 0x1f);
|
|
rng->_seed = seed;
|
|
this->_seedEffectsCount = seed;
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((uint8_t)rng->_shift1 & 0x1f) ^ seed;
|
|
seed = seed ^ seed << ((uint8_t)rng->_shift2 & 0x1f);
|
|
seed = seed ^ seed >> ((uint8_t)rng->_shift3 & 0x1f);
|
|
rng->_seed = seed;
|
|
*GHIDRA_CAST<uint32_t *>((this + 1)) = seed;
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((uint8_t)rng->_shift1 & 0x1f) ^ seed;
|
|
seed = seed ^ seed << ((uint8_t)rng->_shift2 & 0x1f);
|
|
seed = seed ^ seed >> ((uint8_t)rng->_shift3 & 0x1f);
|
|
rng->_seed = seed;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) = seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
seed = seed >> 0xb ^ seed;
|
|
seed = seed << 7 ^ seed;
|
|
this[1]._rng._seed = seed >> 0xc ^ seed;
|
|
return;
|
|
}
|
|
|
|
// 0042a2d0
|
|
int Seeds::GetPlayerInitSeed()
|
|
{
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
return this->_playerInitSeed;
|
|
}
|
|
|
|
// 00436140
|
|
uint32_t Seeds::GetStartSeed()
|
|
{
|
|
uint32_t startSeed;
|
|
|
|
startSeed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (startSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Error: Game Start Seed was not set.\n"));
|
|
startSeed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
}
|
|
return startSeed;
|
|
}
|
|
|
|
// 00456750
|
|
uint8_t Seeds::HasSeedEffect(uint32_t seedEffect)
|
|
{
|
|
uint8_t findResult [8];
|
|
void *boundNode;
|
|
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(boundNode) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(boundNode) + 0x10)) <= GHIDRA_INT(seedEffect))) {
|
|
return boundNode != this->_seedEffects;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00685dc0
|
|
std_string * Seeds::GetStartSeedString(std_string *outSeed)
|
|
{
|
|
uint32_t seed;
|
|
|
|
seed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Error: Game Start Seed was not set.\n"));
|
|
seed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
}
|
|
Seed2String(outSeed,seed);
|
|
return outSeed;
|
|
}
|
|
|
|
// 00685e70
|
|
void Seeds::ClearSeedEffects()
|
|
{
|
|
void *treeHead;
|
|
|
|
treeHead = this->_seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&this->_seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&this->_seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(treeHead) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 4) = treeHead;
|
|
*(void **)treeHead = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 8) = treeHead;
|
|
this->_seedEffectsCount = 0;
|
|
return;
|
|
}
|
|
|
|
// 00685ea0
|
|
bool Seeds::IsSpecialSeed(void *param_1)
|
|
{
|
|
int seedEffect;
|
|
char acStackY_a4 [128];
|
|
std_string in_stack_ffffffe0;
|
|
|
|
(GHIDRA_CAST<msvc::string *>((acStackY_a4 + 0x84)))->msvc::string::string(param_1);
|
|
seedEffect = GetSeedEffect(in_stack_ffffffe0);
|
|
return seedEffect != 0;
|
|
}
|
|
|
|
// 006ef890
|
|
uint32_t Seeds::GetNextSeed()
|
|
{
|
|
uint32_t seed;
|
|
code *trap;
|
|
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
seed = (this->_rng)._seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
seed = (this->_rng)._seed;
|
|
if (seed == 0) {
|
|
trap = (code *)swi(3);
|
|
seed = (*trap)();
|
|
return seed;
|
|
}
|
|
}
|
|
seed = seed >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ seed;
|
|
(this->_rng)._seed = seed;
|
|
return seed;
|
|
}
|
|
|
|
// 006ef8f0
|
|
void Seeds::AddSeedEffect(int seedEffect)
|
|
{
|
|
uint8_t insertResult [12];
|
|
|
|
if (GHIDRA_UINT(seedEffect) < 0x50) {
|
|
msvc::set<int>::insert(insertResult,&seedEffect);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006f9400
|
|
uint32_t Seeds::GetForcedCurses()
|
|
{
|
|
void *foundNode;
|
|
uint32_t stageParity;
|
|
uint32_t curses;
|
|
void **seedEffects;
|
|
void *seedEffectsHead;
|
|
uint8_t findResult [8];
|
|
void *node;
|
|
uint32_t seedKey;
|
|
void *local_8;
|
|
|
|
local_8 = (void *)0x38;
|
|
seedEffects = &(g_game->_seedEffects)._seedEffects;
|
|
msvc::set<int>::find_node(findResult,&local_8);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x39)) {
|
|
foundNode = node;
|
|
local_8 = *seedEffects;
|
|
}
|
|
else {
|
|
foundNode = *seedEffects;
|
|
local_8 = foundNode;
|
|
}
|
|
seedEffectsHead = local_8;
|
|
seedKey = 0x39;
|
|
curses = GHIDRA_UINT((foundNode != local_8));
|
|
msvc::set<int>::find_node(findResult,&seedKey);
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x3a)) &&
|
|
(node != local_8)) && (g_game->_challenge != 0x2c)) {
|
|
stageParity = g_game->_stage & 0x80000001;
|
|
if (GHIDRA_INT(stageParity) < 0) {
|
|
stageParity = (stageParity - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if (((stageParity == 1) && (g_game->_stage < 8)) &&
|
|
((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) {
|
|
curses = curses | 2;
|
|
}
|
|
}
|
|
seedKey = 0x3a;
|
|
msvc::set<int>::find_node(findResult,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x3b)) &&
|
|
(seedEffectsHead = *seedEffects, node != seedEffectsHead)) {
|
|
curses = curses | 4;
|
|
}
|
|
seedKey = 0x3b;
|
|
msvc::set<int>::find_node(findResult,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x3c)) &&
|
|
(node != seedEffectsHead)) {
|
|
curses = curses | 8;
|
|
}
|
|
seedKey = 0x3c;
|
|
msvc::set<int>::find_node(findResult,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x3d)) &&
|
|
(node != seedEffectsHead)) {
|
|
curses = curses | 0x20;
|
|
}
|
|
seedKey = 0x3d;
|
|
msvc::set<int>::find_node(findResult,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x3e)) &&
|
|
(node != seedEffectsHead)) {
|
|
curses = curses | 0x40;
|
|
}
|
|
seedKey = 0x3e;
|
|
msvc::set<int>::find_node(findResult,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x3f)) &&
|
|
(node != seedEffectsHead)) {
|
|
curses = curses | 0x10;
|
|
}
|
|
return curses;
|
|
}
|
|
|
|
// 006f95a0
|
|
uint32_t Seeds::GetPreventedCurses()
|
|
{
|
|
void *firstResult;
|
|
uint32_t preventedCurses;
|
|
void *treeHead;
|
|
void **seedEffects;
|
|
uint8_t findResult [8];
|
|
void *foundNode;
|
|
uint32_t seedEffect;
|
|
|
|
seedEffect = 0x3f;
|
|
seedEffects = &(g_game->_seedEffects)._seedEffects;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x40)) {
|
|
firstResult = foundNode;
|
|
treeHead = *seedEffects;
|
|
}
|
|
else {
|
|
firstResult = *seedEffects;
|
|
treeHead = firstResult;
|
|
}
|
|
seedEffect = 0x40;
|
|
preventedCurses = GHIDRA_UINT((firstResult != treeHead));
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x41)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = preventedCurses | 2;
|
|
}
|
|
seedEffect = 0x41;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x42)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = preventedCurses | 4;
|
|
}
|
|
seedEffect = 0x42;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x43)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = preventedCurses | 8;
|
|
}
|
|
seedEffect = 0x43;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x44)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = preventedCurses | 0x20;
|
|
}
|
|
seedEffect = 0x44;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x45)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = preventedCurses | 0x40;
|
|
}
|
|
seedEffect = 0x46;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x47)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = 0x7f;
|
|
}
|
|
seedEffect = 0x4f;
|
|
msvc::set<int>::find_node(findResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) < 0x50)) &&
|
|
(foundNode != treeHead)) {
|
|
preventedCurses = preventedCurses | 0x40;
|
|
}
|
|
return preventedCurses;
|
|
}
|
|
|
|
// 00738280
|
|
uint32_t Seeds::GetStageSeed(int stage)
|
|
{
|
|
uint32_t stageIndex;
|
|
uint32_t stageIndex;
|
|
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
stageIndex = -GHIDRA_UINT((stage != 0)) & stage;
|
|
stageIndex = 0xd;
|
|
if (stageIndex < 0xd) {
|
|
stageIndex = stageIndex;
|
|
}
|
|
return this->_stageSeeds[stageIndex];
|
|
}
|
|
|
|
// 0085e180
|
|
void Seeds::ClearStartSeed()
|
|
{
|
|
int in_ECX;
|
|
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 4)) = 0;
|
|
return;
|
|
}
|
|
|
|
// 0085e190
|
|
void Seeds::RemoveSeedEffect(int param_2)
|
|
{
|
|
std_set_int_erase_key(&this->_seedEffects,¶m_2);
|
|
return;
|
|
}
|
|
|
|
// 0085e1b0
|
|
int Seeds::CountSeedEffects()
|
|
{
|
|
return this->_seedEffectsCount;
|
|
}
|
|
|
|
// 009e9290
|
|
void Seeds::constructor()
|
|
{
|
|
int *tree;
|
|
int head;
|
|
void *newHead;
|
|
uint8_t *in_ECX;
|
|
|
|
tree = GHIDRA_CAST<int *>((in_ECX + 0x54));
|
|
*GHIDRA_CAST<uint64_t *>((in_ECX + 0xc)) = 0x900000005;
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 8)) = 0xaa17414f;
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 0x14)) = 7;
|
|
*tree = 0;
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 0x58)) = 0;
|
|
newHead = operator_new(0x14);
|
|
*(void **)newHead = newHead;
|
|
*(void **)(GHIDRA_CAST<char *>(newHead) + 4) = newHead;
|
|
*(void **)(GHIDRA_CAST<char *>(newHead) + 8) = newHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(newHead) + 0xc)) = 0x101;
|
|
*tree = GHIDRA_INT(newHead);
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 4)) = 0;
|
|
*in_ECX = 0;
|
|
head = *tree;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(tree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)tree,
|
|
*(_Tree_node<unsigned_int,void*> **)(head + 4));
|
|
*GHIDRA_CAST<int *>((head + 4)) = head;
|
|
*GHIDRA_CAST<int *>(head) = head;
|
|
*GHIDRA_CAST<int *>((head + 8)) = head;
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 0x58)) = 0;
|
|
return;
|
|
}
|
|
|
|
// 009e9320
|
|
void Seeds::construct_from_copy(Seeds *right)
|
|
{
|
|
void **seedEffects;
|
|
int iVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
void *treeHead;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0fb50;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
seedEffects = &this->_seedEffects;
|
|
(this->_rng)._shift1 = 5;
|
|
(this->_rng)._shift2 = 9;
|
|
(this->_rng)._seed = -0x55e8beb1;
|
|
(this->_rng)._shift3 = 7;
|
|
*seedEffects = (void *)0x0;
|
|
this->_seedEffectsCount = 0;
|
|
treeHead = operator_new(0x14);
|
|
*(void **)treeHead = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 4) = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 8) = treeHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(treeHead) + 0xc)) = 0x101;
|
|
*seedEffects = treeHead;
|
|
local_8 = 0;
|
|
*GHIDRA_CAST<uint8_t *>(this) = *GHIDRA_CAST<uint8_t *>(right);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((right)) + 0x4))));
|
|
this->_playerInitSeed = right->_playerInitSeed;
|
|
if (seedEffects != &right->_seedEffects) {
|
|
treeHead = *seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(seedEffects,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(treeHead) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 4) = treeHead;
|
|
*(void **)treeHead = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 8) = treeHead;
|
|
this->_seedEffectsCount = 0;
|
|
std_set_uint_copy(seedEffects,&right->_seedEffects,GHIDRA_INT(right));
|
|
}
|
|
iVar1 = (right->_rng)._shift1;
|
|
iVar2 = (right->_rng)._shift2;
|
|
iVar3 = (right->_rng)._shift3;
|
|
(this->_rng)._seed = (right->_rng)._seed;
|
|
(this->_rng)._shift1 = iVar1;
|
|
(this->_rng)._shift2 = iVar2;
|
|
(this->_rng)._shift3 = iVar3;
|
|
iVar1 = right->_stageSeeds[1];
|
|
iVar2 = right->_stageSeeds[2];
|
|
iVar3 = right->_stageSeeds[3];
|
|
this->_stageSeeds[0] = right->_stageSeeds[0];
|
|
this->_stageSeeds[1] = iVar1;
|
|
this->_stageSeeds[2] = iVar2;
|
|
this->_stageSeeds[3] = iVar3;
|
|
iVar1 = right->_stageSeeds[5];
|
|
iVar2 = right->_stageSeeds[6];
|
|
iVar3 = right->_stageSeeds[7];
|
|
this->_stageSeeds[4] = right->_stageSeeds[4];
|
|
this->_stageSeeds[5] = iVar1;
|
|
this->_stageSeeds[6] = iVar2;
|
|
this->_stageSeeds[7] = iVar3;
|
|
iVar1 = right->_stageSeeds[9];
|
|
iVar2 = right->_stageSeeds[10];
|
|
iVar3 = right->_stageSeeds[0xb];
|
|
this->_stageSeeds[8] = right->_stageSeeds[8];
|
|
this->_stageSeeds[9] = iVar1;
|
|
this->_stageSeeds[10] = iVar2;
|
|
this->_stageSeeds[0xb] = iVar3;
|
|
*GHIDRA_CAST<uint64_t *>((this->_stageSeeds + 0xc)) = *GHIDRA_CAST<uint64_t *>((right->_stageSeeds + 0xc));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009e9430
|
|
Seeds * Seeds::operator_assign(Seeds *other)
|
|
{
|
|
void **seedEffects;
|
|
void *seedEffectsHead;
|
|
int iVar2;
|
|
int iVar3;
|
|
int iVar4;
|
|
|
|
if (this != other) {
|
|
*GHIDRA_CAST<uint8_t *>(this) = *GHIDRA_CAST<uint8_t *>(other);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x4))));
|
|
this->_playerInitSeed = other->_playerInitSeed;
|
|
seedEffects = &this->_seedEffects;
|
|
if (seedEffects != &other->_seedEffects) {
|
|
seedEffectsHead = *seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(seedEffects,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedEffectsHead) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(seedEffectsHead) + 4) = seedEffectsHead;
|
|
*(void **)seedEffectsHead = seedEffectsHead;
|
|
*(void **)(GHIDRA_CAST<char *>(seedEffectsHead) + 8) = seedEffectsHead;
|
|
this->_seedEffectsCount = 0;
|
|
std_set_uint_copy(&this->_seedEffects,&other->_seedEffects,GHIDRA_INT(other));
|
|
}
|
|
iVar2 = (other->_rng)._shift1;
|
|
iVar3 = (other->_rng)._shift2;
|
|
iVar4 = (other->_rng)._shift3;
|
|
(this->_rng)._seed = (other->_rng)._seed;
|
|
(this->_rng)._shift1 = iVar2;
|
|
(this->_rng)._shift2 = iVar3;
|
|
(this->_rng)._shift3 = iVar4;
|
|
iVar2 = other->_stageSeeds[1];
|
|
iVar3 = other->_stageSeeds[2];
|
|
iVar4 = other->_stageSeeds[3];
|
|
this->_stageSeeds[0] = other->_stageSeeds[0];
|
|
this->_stageSeeds[1] = iVar2;
|
|
this->_stageSeeds[2] = iVar3;
|
|
this->_stageSeeds[3] = iVar4;
|
|
iVar2 = other->_stageSeeds[5];
|
|
iVar3 = other->_stageSeeds[6];
|
|
iVar4 = other->_stageSeeds[7];
|
|
this->_stageSeeds[4] = other->_stageSeeds[4];
|
|
this->_stageSeeds[5] = iVar2;
|
|
this->_stageSeeds[6] = iVar3;
|
|
this->_stageSeeds[7] = iVar4;
|
|
iVar2 = other->_stageSeeds[9];
|
|
iVar3 = other->_stageSeeds[10];
|
|
iVar4 = other->_stageSeeds[0xb];
|
|
this->_stageSeeds[8] = other->_stageSeeds[8];
|
|
this->_stageSeeds[9] = iVar2;
|
|
this->_stageSeeds[10] = iVar3;
|
|
this->_stageSeeds[0xb] = iVar4;
|
|
*GHIDRA_CAST<uint64_t *>((this->_stageSeeds + 0xc)) = *GHIDRA_CAST<uint64_t *>((other->_stageSeeds + 0xc));
|
|
}
|
|
return this;
|
|
}
|
|
|
|
// 009e94e0
|
|
void Seeds::InitSeedInfo()
|
|
{
|
|
uint32_t banListSize;
|
|
int banListEnd;
|
|
int **copyHeadReg;
|
|
int **innerNode;
|
|
void *exclusiveSetHead;
|
|
uint32_t local_48;
|
|
int **copyHead;
|
|
uint32_t local_40;
|
|
uint8_t local_3c [8];
|
|
int ***local_34;
|
|
int ***local_30;
|
|
uint32_t exclusiveSeedIds;
|
|
uint32_t uStack_28;
|
|
uint32_t uStack_24;
|
|
uint32_t uStack_20;
|
|
uint32_t local_1c;
|
|
uint32_t local_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int ***outerNode;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0fb95;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((local_3c + 0x38));
|
|
ExceptionList = &local_10;
|
|
banListSize = DAT_00c798c8 - GHIDRA_INT(g_seedComboBans) >> 3;
|
|
if (banListSize < 0x51) {
|
|
if (banListSize < 0x50) {
|
|
if (GHIDRA_UINT((DAT_00c798cc - GHIDRA_INT(g_seedComboBans) >> 3)) < 0x50) {
|
|
msvc::vector<msvc::set<int>>::_Resize_reallocate(banListSize,&local_30);
|
|
}
|
|
else {
|
|
DAT_00c798c8 = msvc::_Uninitialized_value_construct_n<msvc::set<int>>
|
|
(DAT_00c798c8,0x50 - banListSize,local_30);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
banListEnd = GHIDRA_INT(g_seedComboBans) + 0x280;
|
|
FUN_009ebbf0(banListSize,local_14);
|
|
DAT_00c798c8 = banListEnd;
|
|
}
|
|
exclusiveSeedIds = 1;
|
|
uStack_28 = 2;
|
|
uStack_24 = 0x29;
|
|
uStack_20 = 0x2b;
|
|
local_1c = 0x2a;
|
|
local_18 = 0x2c;
|
|
exclusiveSetHead = (void *)0x0;
|
|
local_48 = 0;
|
|
exclusiveSetHead = operator_new(0x14);
|
|
*(void **)exclusiveSetHead = exclusiveSetHead;
|
|
*(void **)(GHIDRA_CAST<char *>(exclusiveSetHead) + 4) = exclusiveSetHead;
|
|
*(void **)(GHIDRA_CAST<char *>(exclusiveSetHead) + 8) = exclusiveSetHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(exclusiveSetHead) + 0xc)) = 0x101;
|
|
local_8 = 0;
|
|
msvc::set<int>::insert_range(&exclusiveSeedIds,&local_14);
|
|
local_8 = 1;
|
|
local_34 = ©Head;
|
|
copyHead = GHIDRA_CAST<int **>(0x0);
|
|
local_40 = 0;
|
|
local_30 = local_34;
|
|
copyHead = operator_new(0x14);
|
|
*copyHead = GHIDRA_CAST<int *>(copyHead);
|
|
copyHead[1] = GHIDRA_CAST<int *>(copyHead);
|
|
copyHead[2] = GHIDRA_CAST<int *>(copyHead);
|
|
*GHIDRA_CAST<uint16_t *>((copyHead + 3)) = 0x101;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
std_set_uint_copy(©Head,&exclusiveSetHead,GHIDRA_INT(local_30));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
local_30 = GHIDRA_CAST<int ***>(*copyHead);
|
|
copyHeadReg = copyHead;
|
|
if (local_30 != GHIDRA_CAST<int ***>(copyHead)) {
|
|
do {
|
|
outerNode = local_30;
|
|
innerNode = GHIDRA_CAST<int **>(*copyHeadReg);
|
|
if (innerNode != copyHeadReg) {
|
|
do {
|
|
if (outerNode[4] != GHIDRA_CAST<int **>(innerNode[4])) {
|
|
msvc::set<int>::insert(local_3c,innerNode + 4);
|
|
copyHeadReg = copyHead;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&innerNode);
|
|
} while (innerNode != copyHeadReg);
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_30);
|
|
} while (local_30 != GHIDRA_CAST<int ***>(copyHeadReg));
|
|
}
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(©Head,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)©Head,
|
|
(_Tree_node<unsigned_int,void*> *)copyHeadReg[1]);
|
|
operator_delete(copyHead,0x14);
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
FUN_009e9bf0();
|
|
local_30 = GHIDRA_CAST<int ***>(0xb);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0xd);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x10);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x11);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x13);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x15);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x12);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x14);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x18);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x19);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x20);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x21);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x26);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x37);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x39);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x3f);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x40);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x41);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x42);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x43);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x44);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x46);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x49);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x4d);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
local_30 = GHIDRA_CAST<int ***>(0x4f);
|
|
msvc::set<int>::insert_c798d0(local_3c,&local_30);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&exclusiveSetHead,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&exclusiveSetHead,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(exclusiveSetHead) + 4));
|
|
operator_delete(exclusiveSetHead,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009e9ab0
|
|
int Seeds::CountUnlockedSeedEffects()
|
|
{
|
|
int partialCount;
|
|
char *unlockFlag;
|
|
int partialCount2;
|
|
int count;
|
|
int batchesLeft;
|
|
|
|
count = 0;
|
|
batchesLeft = 0x10;
|
|
unlockFlag = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_manager->_persistentGameData))) + 0xf15)));
|
|
do {
|
|
partialCount = count + 1;
|
|
if (unlockFlag[-1] == '\0') {
|
|
partialCount = count;
|
|
}
|
|
count = partialCount + 1;
|
|
if (*unlockFlag == '\0') {
|
|
count = partialCount;
|
|
}
|
|
partialCount = count + 1;
|
|
if (unlockFlag[1] == '\0') {
|
|
partialCount = count;
|
|
}
|
|
partialCount2 = partialCount + 1;
|
|
if (unlockFlag[2] == '\0') {
|
|
partialCount2 = partialCount;
|
|
}
|
|
count = partialCount2 + 1;
|
|
if (unlockFlag[3] == '\0') {
|
|
count = partialCount2;
|
|
}
|
|
batchesLeft = batchesLeft + -1;
|
|
unlockFlag = unlockFlag + 5;
|
|
} while (batchesLeft != 0);
|
|
return count;
|
|
}
|
|
|
|
// 009e9b10
|
|
uint8_t Seeds::IsSeedComboBanned(int seedEffectA, int seedEffectB)
|
|
{
|
|
int *foundIt;
|
|
int *bannedSeeds;
|
|
|
|
if ((GHIDRA_UINT(seedEffectA) < 0x50) && (GHIDRA_UINT(seedEffectB) < 0x50)) {
|
|
bannedSeeds = GHIDRA_CAST<int *>((GHIDRA_INT(g_seedComboBans) + seedEffectA * 8));
|
|
foundIt = GHIDRA_CAST<int *>(std)::set<int>::find(&seedEffectA,&seedEffectB);
|
|
return *foundIt != *bannedSeeds;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 009e9b50
|
|
uint8_t Seeds::AchievementUnlocksDisallowed()
|
|
{
|
|
uint8_t local_18 [8];
|
|
int boundNode;
|
|
int seedKey;
|
|
uint32_t *seedEffectIt;
|
|
int blockedSeedsHead;
|
|
int seedEffect;
|
|
uint32_t *seedEffectsHead;
|
|
|
|
blockedSeedsHead = DAT_00c798d0;
|
|
seedEffectsHead = this->_seedEffects;
|
|
seedEffectIt = GHIDRA_CAST<uint32_t *>(*seedEffectsHead);
|
|
while( true ) {
|
|
if (seedEffectIt == seedEffectsHead) {
|
|
return 0;
|
|
}
|
|
seedEffect = seedEffectIt[4];
|
|
seedKey = seedEffect;
|
|
msvc::set<int>::find_node(local_18,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((boundNode + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((boundNode + 0x10)) <= seedEffect)) &&
|
|
(boundNode != blockedSeedsHead)) break;
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&seedEffectIt);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 009e9bc0
|
|
void Seeds::Reset()
|
|
{
|
|
void *seedEffectsHead;
|
|
|
|
seedEffectsHead = this->_seedEffects;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = 0;
|
|
*GHIDRA_CAST<uint8_t *>(this) = 0;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&this->_seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&this->_seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedEffectsHead) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(seedEffectsHead) + 4) = seedEffectsHead;
|
|
*(void **)seedEffectsHead = seedEffectsHead;
|
|
*(void **)(GHIDRA_CAST<char *>(seedEffectsHead) + 8) = seedEffectsHead;
|
|
this->_seedEffectsCount = 0;
|
|
return;
|
|
}
|
|
|
|
// 009e9c40
|
|
uint8_t Seeds::CanAddSeedEffect(uint32_t seedEffect)
|
|
{
|
|
uint8_t isAlreadyActive;
|
|
uint8_t isAllowed;
|
|
uint32_t *activeIt;
|
|
void *bannedEffects [2];
|
|
uint8_t local_14 [8];
|
|
void *foundNode;
|
|
int *activeEffect;
|
|
uint32_t *activeHead;
|
|
void *bannedHead;
|
|
|
|
if ((0x4f < seedEffect) ||
|
|
(isAlreadyActive = HasSeedEffect(this,seedEffect), isAlreadyActive != 0)) {
|
|
return 0;
|
|
}
|
|
msvc::set<int>::set_copy((void *)(GHIDRA_INT(g_seedComboBans) + seedEffect * 8));
|
|
bannedHead = bannedEffects[0];
|
|
activeHead = this->_seedEffects;
|
|
activeIt = GHIDRA_CAST<uint32_t *>(*activeHead);
|
|
do {
|
|
if (activeIt == activeHead) {
|
|
isAllowed = 1;
|
|
LAB_009e9ccd:
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(bannedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)bannedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(bannedHead) + 4));
|
|
operator_delete(bannedEffects[0],0x14);
|
|
return isAllowed;
|
|
}
|
|
activeEffect = activeIt + 4;
|
|
msvc::set<int>::find_node(local_14,activeEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)) <= *activeEffect)) && (foundNode != bannedHead)) {
|
|
isAllowed = 0;
|
|
goto LAB_009e9ccd;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&activeIt);
|
|
} while( true );
|
|
}
|
|
|
|
// 009e9d50
|
|
void Seeds::RemoveBlockingSeedEffects(int seedEffect)
|
|
{
|
|
int bannedEffect;
|
|
int banListOffset;
|
|
int *banSet;
|
|
|
|
if (GHIDRA_UINT(seedEffect) < 0x50) {
|
|
banListOffset = seedEffect * 8;
|
|
banSet = *GHIDRA_CAST<int **>((banListOffset + GHIDRA_INT(g_seedComboBans)));
|
|
seedEffect = *banSet;
|
|
if (GHIDRA_CAST<int *>(seedEffect) != banSet) {
|
|
do {
|
|
bannedEffect = *GHIDRA_CAST<int *>((seedEffect + 0x10));
|
|
std_set_int_erase_key(&this->_seedEffects,&bannedEffect);
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&seedEffect);
|
|
} while (seedEffect != *GHIDRA_CAST<int *>((banListOffset + GHIDRA_INT(g_seedComboBans))));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009e9db0
|
|
int Seeds::GetSeedEffect(std_string seedString)
|
|
{
|
|
uint32_t uVar1;
|
|
std_string *seedBuf;
|
|
int *digestWord;
|
|
void *ptr;
|
|
int *knownWord;
|
|
int seedEffect;
|
|
bool isMoreWords;
|
|
int seedDigest [5];
|
|
int knownDigests [12];
|
|
uint8_t *local_20;
|
|
uint32_t local_1c;
|
|
uint32_t local_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
int local_8;
|
|
|
|
puStack_c = &LAB_00b0fbcd;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_UINT((knownDigests + 0x13));
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
local_14 = uVar1;
|
|
if (seedString._size != 9) {
|
|
if (seedString._size < 9) {
|
|
(GHIDRA_CAST<msvc::string *>((seedString._buf)))->msvc::string::append_n(9 - seedString._size,0x20);
|
|
}
|
|
else {
|
|
seedString._size = 9;
|
|
seedBuf = &seedString;
|
|
if (0xf < seedString._capacity) {
|
|
seedBuf = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(seedString._buf))) + 0x0)));
|
|
}
|
|
seedBuf->_buf[9] = '\0';
|
|
}
|
|
}
|
|
sha1_digest(seedString._size,uVar1);
|
|
knownDigests[5] = 0x6c5a0c0e;
|
|
knownDigests[6] = 0x1a0758c1;
|
|
digestWord = seedDigest;
|
|
knownDigests[7] = 0xf87d621;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[8] = 0x4341e0df;
|
|
uVar1 = 0x10;
|
|
knownDigests[9] = 0xb960dbc8;
|
|
do {
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0x3bf504ef;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0x1d7a8f74;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0xe5f5926b;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x81c59abe;
|
|
knownDigests[9] = 0x1dd1207a;
|
|
goto LAB_009e9eb0;
|
|
}
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = 3 < uVar1;
|
|
uVar1 = uVar1 - 4;
|
|
} while (isMoreWords);
|
|
seedEffect = 1;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009e9eb0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0xc0978b6d;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0x1a161c38;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0x928e1cfa;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x5b6a6d2f;
|
|
knownDigests[9] = 0xac98e081;
|
|
goto LAB_009e9f00;
|
|
}
|
|
}
|
|
seedEffect = 2;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009e9f00:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0x304506ba;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0x8b775f95;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0x4e67cd3e;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x9c06ae9f;
|
|
knownDigests[9] = 0xe2de0fa8;
|
|
goto LAB_009e9f50;
|
|
}
|
|
}
|
|
seedEffect = 3;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009e9f50:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0x4fb26f55;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0xc5665e72;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0x9a17007b;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x87f1069f;
|
|
knownDigests[9] = 0x31ff0348;
|
|
goto LAB_009e9fa0;
|
|
}
|
|
}
|
|
seedEffect = 4;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009e9fa0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0x1cea905d;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0xb8ebca46;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0xed4280f;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x748ffb5;
|
|
knownDigests[9] = 0x7ffb5b76;
|
|
goto LAB_009e9ff0;
|
|
}
|
|
}
|
|
seedEffect = 5;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009e9ff0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0xd146f9aa;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0xa1e076ee;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0xdff668ab;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x913be3d0;
|
|
knownDigests[9] = 0x2634e8b6;
|
|
goto LAB_009ea040;
|
|
}
|
|
}
|
|
seedEffect = 6;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea040:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[5] = 0x3548c06e;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0xee4ee98a;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0x5b3c9a46;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x703e0a2f;
|
|
knownDigests[9] = 0x699f69f9;
|
|
goto LAB_009ea090;
|
|
}
|
|
}
|
|
seedEffect = 7;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea090:
|
|
if (*digestWord != *knownWord) {
|
|
if (*GHIDRA_CAST<int *>(&g_manager->_stringTable) != 0) goto LAB_009ea19b;
|
|
knownDigests[5] = 0xaf3f840;
|
|
digestWord = seedDigest;
|
|
knownDigests[6] = 0x7c7441af;
|
|
knownWord = knownDigests + 5;
|
|
knownDigests[7] = 0x65a9595;
|
|
uVar1 = 0x10;
|
|
knownDigests[8] = 0x5d8145b2;
|
|
knownDigests[9] = 0x54a7f5cd;
|
|
knownDigests[0] = -0x512ed42e;
|
|
knownDigests[1] = 0x7fe6f84a;
|
|
knownDigests[2] = 0x8b443c11;
|
|
knownDigests[3] = 0x52cff77d;
|
|
knownDigests[4] = 0xead4bf55;
|
|
knownDigests[10] = 0xde3e4928;
|
|
knownDigests[0xb] = 0x5a08d551;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xb1b137c2);
|
|
local_1c = 0x78d1be7;
|
|
local_18 = 0x6ecf797b;
|
|
goto LAB_009ea131;
|
|
}
|
|
}
|
|
seedEffect = 8;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea131:
|
|
if (*digestWord != *knownWord) {
|
|
digestWord = seedDigest;
|
|
uVar1 = 0x10;
|
|
knownWord = knownDigests;
|
|
goto LAB_009ea157;
|
|
}
|
|
}
|
|
seedEffect = 9;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea157:
|
|
if (*digestWord != *knownWord) {
|
|
digestWord = seedDigest;
|
|
uVar1 = 0x10;
|
|
knownWord = knownDigests + 10;
|
|
goto LAB_009ea180;
|
|
}
|
|
}
|
|
seedEffect = 9;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea180:
|
|
if (*digestWord != *knownWord) goto LAB_009ea19b;
|
|
}
|
|
seedEffect = 9;
|
|
goto LAB_009eb531;
|
|
LAB_009ea19b:
|
|
knownDigests[10] = 0xcc45f85d;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x4f57cb04;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x66a64a12);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x800e3620;
|
|
local_18 = 0x1d593677;
|
|
do {
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xa6c2493c;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x63ad9432;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x4148d831);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xdf9f77b1;
|
|
local_18 = 0xbf6647d1;
|
|
goto LAB_009ea220;
|
|
}
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = 3 < uVar1;
|
|
uVar1 = uVar1 - 4;
|
|
} while (isMoreWords);
|
|
seedEffect = 10;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea220:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x46f0455a;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x114286f;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x7aa1d92);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x31795e51;
|
|
local_18 = 0xc3a91557;
|
|
goto LAB_009ea270;
|
|
}
|
|
}
|
|
seedEffect = 0xb;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea270:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xad0d4f17;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xf205a756;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xa6f15c1c);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x54b52f56;
|
|
local_18 = 0x16d783d6;
|
|
goto LAB_009ea2c0;
|
|
}
|
|
}
|
|
seedEffect = 0xc;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea2c0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xdaec4547;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xfe35ccb5;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xc1324934);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xaf372679;
|
|
local_18 = 0x453c2fff;
|
|
goto LAB_009ea310;
|
|
}
|
|
}
|
|
seedEffect = 0xd;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea310:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x266a6130;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xf524c959;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x423fbe49);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x46fa74bb;
|
|
local_18 = 0x3039b5f;
|
|
goto LAB_009ea360;
|
|
}
|
|
}
|
|
seedEffect = 0xe;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea360:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xaa5761ee;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x30e25d1e;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xe52653e1);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xb8e93635;
|
|
local_18 = 0x204c69a6;
|
|
goto LAB_009ea3b0;
|
|
}
|
|
}
|
|
seedEffect = 0xf;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea3b0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x82a66e1f;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x2514691a;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x24b4fe73);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf55350c4;
|
|
local_18 = 0x59110ab8;
|
|
goto LAB_009ea400;
|
|
}
|
|
}
|
|
seedEffect = 0x10;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea400:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x180b97e7;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x4dc18b34;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xcfbe0714);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x99abc405;
|
|
local_18 = 0xfee53d9a;
|
|
goto LAB_009ea450;
|
|
}
|
|
}
|
|
seedEffect = 0x11;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea450:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x12daa358;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x36200ae1;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xdff06abf);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x1dd5a8c4;
|
|
local_18 = 0x869fb34a;
|
|
goto LAB_009ea4a0;
|
|
}
|
|
}
|
|
seedEffect = 0x12;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea4a0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x39f41b98;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x29f9df57;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x35180df6);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x84c6c35e;
|
|
local_18 = 0x3148da51;
|
|
goto LAB_009ea4f0;
|
|
}
|
|
}
|
|
seedEffect = 0x13;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea4f0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x6f178531;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xaff12645;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xcf29c82b);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x56d5e983;
|
|
local_18 = 0x3a27e93;
|
|
goto LAB_009ea540;
|
|
}
|
|
}
|
|
seedEffect = 0x15;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea540:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x8eca9891;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xae185aee;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xfd206f66);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x154b083f;
|
|
local_18 = 0xd7880653;
|
|
goto LAB_009ea590;
|
|
}
|
|
}
|
|
seedEffect = 0x14;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea590:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xc224e789;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xc4e85fce;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x22e2b855);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xc6967e4b;
|
|
local_18 = 0xc11440cb;
|
|
goto LAB_009ea5e0;
|
|
}
|
|
}
|
|
seedEffect = 0x17;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea5e0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x981bacd2;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xbd5f3f1b;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x25974766);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xaa585fb6;
|
|
local_18 = 0x89620e3b;
|
|
knownDigests[0] = -0x1c9f381;
|
|
knownDigests[1] = 0xab1e9a51;
|
|
knownDigests[2] = 0xd6ca5ab6;
|
|
knownDigests[3] = 0x1c274461;
|
|
knownDigests[4] = 0xa5b3c0a5;
|
|
goto LAB_009ea650;
|
|
}
|
|
}
|
|
seedEffect = 0x18;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea650:
|
|
if (*digestWord != *knownWord) {
|
|
digestWord = seedDigest;
|
|
uVar1 = 0x10;
|
|
knownWord = knownDigests;
|
|
goto LAB_009ea676;
|
|
}
|
|
}
|
|
seedEffect = 0x19;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea676:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x84264e8e;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x8f8a9b0a;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xb8be97f9);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x692ccf85;
|
|
local_18 = 0xb142e553;
|
|
goto LAB_009ea6c0;
|
|
}
|
|
}
|
|
seedEffect = 0x19;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea6c0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x21a39872;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x354944eb;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xd64ddd2);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x974d3d0;
|
|
local_18 = 0xe3257c75;
|
|
goto LAB_009ea710;
|
|
}
|
|
}
|
|
seedEffect = 0x1a;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea710:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x9658587d;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x680beb2e;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = &DAT_00c17e9a;
|
|
uVar1 = 0x10;
|
|
local_1c = 0xe8391b1e;
|
|
local_18 = 0x8a51b26b;
|
|
goto LAB_009ea760;
|
|
}
|
|
}
|
|
seedEffect = 0x1b;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea760:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x3edf6f95;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x9ecb1288;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x36195541);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x22b0c87e;
|
|
local_18 = 0x41ad36e6;
|
|
goto LAB_009ea7b0;
|
|
}
|
|
}
|
|
seedEffect = 0x1c;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea7b0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x8bcac277;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xd15bd5c2;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x6effa0f5);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x56a42aad;
|
|
local_18 = 0xce198264;
|
|
goto LAB_009ea800;
|
|
}
|
|
}
|
|
seedEffect = 0x1d;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea800:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf03d08f4;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x69227e8f;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x48611079);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf0003e96;
|
|
local_18 = 0x99ef74d2;
|
|
goto LAB_009ea850;
|
|
}
|
|
}
|
|
seedEffect = 0x1e;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea850:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xecf04d14;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xecde01d;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x8c11e029);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x6f44f055;
|
|
local_18 = 0xac7088cb;
|
|
knownDigests[0] = -0x21c388a2;
|
|
knownDigests[1] = 0x543bcce9;
|
|
knownDigests[2] = 0x94506ea0;
|
|
knownDigests[3] = 0xcb6208c3;
|
|
knownDigests[4] = 0xb5449e35;
|
|
goto LAB_009ea8c0;
|
|
}
|
|
}
|
|
seedEffect = 0x20;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea8c0:
|
|
if (*digestWord != *knownWord) {
|
|
digestWord = seedDigest;
|
|
uVar1 = 0x10;
|
|
knownWord = knownDigests;
|
|
goto LAB_009ea8e6;
|
|
}
|
|
}
|
|
seedEffect = 0x21;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea8e6:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf91813e9;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xa7772c9;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xe27b9d6b);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf7892976;
|
|
local_18 = 0xe236a4a4;
|
|
goto LAB_009ea930;
|
|
}
|
|
}
|
|
seedEffect = 0x21;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea930:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x4196cd99;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x64f8044a;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x3434a403);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x1270209d;
|
|
local_18 = 0x22ecf739;
|
|
goto LAB_009ea980;
|
|
}
|
|
}
|
|
seedEffect = 0x23;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea980:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xe882c0fe;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x8ac0f8d9;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xbd5489c9);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x7812cf03;
|
|
local_18 = 0x71356391;
|
|
goto LAB_009ea9d0;
|
|
}
|
|
}
|
|
seedEffect = 0x24;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ea9d0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xcec7da35;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x201aaa62;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xb4a9f700);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x4a432c0c;
|
|
local_18 = 0x7ee62bc6;
|
|
goto LAB_009eaa20;
|
|
}
|
|
}
|
|
seedEffect = 0x25;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaa20:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xaa095acf;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xe4a74c20;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x10ab775a);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x1907b856;
|
|
local_18 = 0x80687a48;
|
|
goto LAB_009eaa70;
|
|
}
|
|
}
|
|
seedEffect = 0x26;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaa70:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf70117d7;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x22517083;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xca73c522);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x1bd84277;
|
|
local_18 = 0xfce7e3f9;
|
|
goto LAB_009eaac0;
|
|
}
|
|
}
|
|
seedEffect = 0x29;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaac0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x2c504325;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x973cc813;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xbe13f93);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xd1852583;
|
|
local_18 = 0x3c3b24b9;
|
|
goto LAB_009eab10;
|
|
}
|
|
}
|
|
seedEffect = 0x2a;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eab10:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf9a7e518;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xa2c99815;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x96ff583f);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x44d29781;
|
|
local_18 = 0x1659d867;
|
|
goto LAB_009eab60;
|
|
}
|
|
}
|
|
seedEffect = 0x2b;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eab60:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x599c51f1;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xf66d16a3;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x3445635f);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x931521c2;
|
|
local_18 = 0x60887148;
|
|
goto LAB_009eabb0;
|
|
}
|
|
}
|
|
seedEffect = 0x2c;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eabb0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x2e0dd9cb;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x996c914e;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x871fb6d8);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x22bedbd8;
|
|
local_18 = 0xb5c604f2;
|
|
goto LAB_009eac00;
|
|
}
|
|
}
|
|
seedEffect = 0x2e;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eac00:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xaef79928;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xe73ce84c;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xa0deee95);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf8838a16;
|
|
local_18 = 0xe5ceac7e;
|
|
goto LAB_009eac50;
|
|
}
|
|
}
|
|
seedEffect = 0x2f;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eac50:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xe6ec1b40;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x242dc317;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xeaf3e29e);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x29a24bc7;
|
|
local_18 = 0x9b2c3239;
|
|
goto LAB_009eaca0;
|
|
}
|
|
}
|
|
seedEffect = 0x30;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaca0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xc0707c9b;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x3d97fc0c;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x78389ea3);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x7db053a6;
|
|
local_18 = 0xe34b8aab;
|
|
knownDigests[0] = -0x62041f9a;
|
|
knownDigests[1] = 0xf76d02bb;
|
|
knownDigests[2] = 0xc573d1f2;
|
|
knownDigests[3] = 0x97de624e;
|
|
knownDigests[4] = 0x1e81877e;
|
|
goto LAB_009ead10;
|
|
}
|
|
}
|
|
seedEffect = 0x35;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ead10:
|
|
if (*digestWord != *knownWord) {
|
|
digestWord = seedDigest;
|
|
uVar1 = 0x10;
|
|
knownWord = knownDigests;
|
|
goto LAB_009ead40;
|
|
}
|
|
}
|
|
seedEffect = 0x36;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ead40:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xc08e6930;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x80cdd12c;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xeb758cee);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x927977cb;
|
|
local_18 = 0x111abbc9;
|
|
goto LAB_009ead90;
|
|
}
|
|
}
|
|
seedEffect = 0x36;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009ead90:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x220a7ee4;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xe964d085;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x22376a38);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xfc1df130;
|
|
local_18 = 0x2179b945;
|
|
goto LAB_009eade0;
|
|
}
|
|
}
|
|
seedEffect = 0x37;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eade0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x4ac7df82;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xb747e6e3;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x35749d6a);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x36dc4df0;
|
|
local_18 = 0x8e59b190;
|
|
goto LAB_009eae30;
|
|
}
|
|
}
|
|
seedEffect = 0x34;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eae30:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xafe55c97;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x7fd1b37d;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x97cbbd26);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xfc68c3ba;
|
|
local_18 = 0xec247758;
|
|
goto LAB_009eae80;
|
|
}
|
|
}
|
|
seedEffect = 0x38;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eae80:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x1adbea69;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x6ae0833e;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xb255770c);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf6b0e556;
|
|
local_18 = 0x48bd8a35;
|
|
goto LAB_009eaed0;
|
|
}
|
|
}
|
|
seedEffect = 0x39;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaed0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x5fcca255;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xf1b3aee7;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x94f755c7);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x8350b8a4;
|
|
local_18 = 0x7afab16e;
|
|
goto LAB_009eaf20;
|
|
}
|
|
}
|
|
seedEffect = 0x3a;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaf20:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xef7f8d5a;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x560f9541;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x968346fc);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xb2e73f86;
|
|
local_18 = 0x4491efce;
|
|
goto LAB_009eaf70;
|
|
}
|
|
}
|
|
seedEffect = 0x3b;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eaf70:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xcaca8ad1;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xf707ea0;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x6175fa4);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x11f9995a;
|
|
local_18 = 0xf88db202;
|
|
goto LAB_009eafc0;
|
|
}
|
|
}
|
|
seedEffect = 0x3c;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eafc0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf175008f;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x1237581f;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xd058b62f);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x8f7d34d8;
|
|
local_18 = 0xf3f037cd;
|
|
goto LAB_009eb010;
|
|
}
|
|
}
|
|
seedEffect = 0x3d;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb010:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x8e0037f9;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xa1669bfc;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x6fa5dd21);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xe778f3cb;
|
|
local_18 = 0x711455a3;
|
|
goto LAB_009eb060;
|
|
}
|
|
}
|
|
seedEffect = 0x3e;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb060:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xad54e77c;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x6a2a6b36;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xb797cf31);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x501d7191;
|
|
local_18 = 0x80b3a955;
|
|
goto LAB_009eb0b0;
|
|
}
|
|
}
|
|
seedEffect = 0x3f;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb0b0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x41e2bd6f;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xf12943ef;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x54ec4ab6);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x565fb4a0;
|
|
local_18 = 0x345681a0;
|
|
goto LAB_009eb100;
|
|
}
|
|
}
|
|
seedEffect = 0x40;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb100:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xa863b211;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x6e2c9147;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xae5f6508);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x114eb299;
|
|
local_18 = 0x62d320f5;
|
|
goto LAB_009eb150;
|
|
}
|
|
}
|
|
seedEffect = 0x41;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb150:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf3fd3d89;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xcca14a44;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xebedc510);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x69bb00df;
|
|
local_18 = 0x8801f545;
|
|
goto LAB_009eb1a0;
|
|
}
|
|
}
|
|
seedEffect = 0x42;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb1a0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xa10fa13a;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xb1d8e004;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x81b93223);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xa3bacc39;
|
|
local_18 = 0xb46793fc;
|
|
goto LAB_009eb1f0;
|
|
}
|
|
}
|
|
seedEffect = 0x44;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb1f0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x5d1c4c85;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x5902de6f;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xac1156a1);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xc97868b4;
|
|
local_18 = 0xb518c1d3;
|
|
goto LAB_009eb240;
|
|
}
|
|
}
|
|
seedEffect = 0x43;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb240:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x7b845138;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xcde29161;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x1c040239);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x431b940c;
|
|
local_18 = 0xa255148c;
|
|
goto LAB_009eb290;
|
|
}
|
|
}
|
|
seedEffect = 0x46;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb290:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xc37f47b7;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x82d7cc03;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x4c8b417e);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf5d6b4f8;
|
|
local_18 = 0xebf23f83;
|
|
goto LAB_009eb2e0;
|
|
}
|
|
}
|
|
seedEffect = 0x47;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb2e0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x31a7e167;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x24906665;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x1a346f28);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xffc5ee52;
|
|
local_18 = 0x8719c7a7;
|
|
goto LAB_009eb330;
|
|
}
|
|
}
|
|
seedEffect = 0x48;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb330:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xab552bd3;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x4742222c;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xa0f0e6cf);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x4b15bb5;
|
|
local_18 = 0xdb833c02;
|
|
goto LAB_009eb380;
|
|
}
|
|
}
|
|
seedEffect = 0x49;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb380:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xd6da8026;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xb29cb3a3;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x8599bd3d);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x464a415;
|
|
local_18 = 0xf079460c;
|
|
goto LAB_009eb3d0;
|
|
}
|
|
}
|
|
seedEffect = 0x4a;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb3d0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x7f104aac;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x4c5dd52;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x886c422c);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x36b8e0e9;
|
|
local_18 = 0x8574715f;
|
|
goto LAB_009eb420;
|
|
}
|
|
}
|
|
seedEffect = 0x4b;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb420:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xf5145c3f;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xa7abbaaf;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xf8912d2f);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x71fab149;
|
|
local_18 = 0x33f872cb;
|
|
goto LAB_009eb470;
|
|
}
|
|
}
|
|
seedEffect = 0x4c;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb470:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0x764f0aa9;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0x76171ea9;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0x1eca41a3);
|
|
uVar1 = 0x10;
|
|
local_1c = 0xf38a621f;
|
|
local_18 = 0xb2387e17;
|
|
goto LAB_009eb4c0;
|
|
}
|
|
}
|
|
seedEffect = 0x4d;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb4c0:
|
|
if (*digestWord != *knownWord) {
|
|
knownDigests[10] = 0xaa42d2ad;
|
|
digestWord = seedDigest;
|
|
knownDigests[0xb] = 0xc7a73da7;
|
|
knownWord = knownDigests + 10;
|
|
local_20 = GHIDRA_CAST<uint8_t *>(0xcb0913e7);
|
|
uVar1 = 0x10;
|
|
local_1c = 0x41df263;
|
|
local_18 = 0x306ba234;
|
|
goto LAB_009eb510;
|
|
}
|
|
}
|
|
seedEffect = 0x4e;
|
|
goto LAB_009eb531;
|
|
while( true ) {
|
|
digestWord = digestWord + 1;
|
|
knownWord = knownWord + 1;
|
|
isMoreWords = uVar1 < 4;
|
|
uVar1 = uVar1 - 4;
|
|
if (isMoreWords) break;
|
|
LAB_009eb510:
|
|
if (*digestWord != *knownWord) {
|
|
seedEffect = 0;
|
|
goto LAB_009eb531;
|
|
}
|
|
}
|
|
seedEffect = 0x4f;
|
|
LAB_009eb531:
|
|
if (0xf < seedString._capacity) {
|
|
uVar1 = seedString._capacity + 1;
|
|
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)seedString._buf)) + 0x0)));
|
|
if (0xfff < uVar1) {
|
|
ptr = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(seedString._buf)) + 0x0))) + -4);
|
|
uVar1 = seedString._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(seedString._buf)) + 0x0))) - GHIDRA_INT(ptr)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar1);
|
|
}
|
|
ExceptionList = local_10;
|
|
return seedEffect;
|
|
}
|
|
|
|
// 009eb590
|
|
uint8_t Seeds::IsStringValidSeed(std_string *seedText)
|
|
{
|
|
uint32_t seed;
|
|
|
|
seed = String2Seed(seedText);
|
|
return seed != 0;
|
|
}
|
|
|
|
// 009eb5b0
|
|
std_string * Seeds::Seed2String(std_string *outStr, uint32_t seed)
|
|
{
|
|
uint32_t digitIdx;
|
|
std_string *chars;
|
|
uint32_t digitIdx;
|
|
uint8_t checksum;
|
|
char cVar2;
|
|
uint8_t digits [4];
|
|
uint32_t digits4to7;
|
|
uint32_t local_8;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((digits + 0xc));
|
|
checksum = 0;
|
|
for (digitIdx = seed; digitIdx != 0; digitIdx = digitIdx >> 5) {
|
|
cVar2 = checksum + (char)digitIdx;
|
|
checksum = cVar2 * '\x02' - (cVar2 >> 7);
|
|
}
|
|
digitIdx = seed ^ 0xfef7ffd;
|
|
outStr->_buf[0] = '\0';
|
|
outStr->_buf[1] = '\0';
|
|
outStr->_buf[2] = '\0';
|
|
outStr->_buf[3] = '\0';
|
|
outStr->_size = 0;
|
|
outStr->_capacity = 0xf;
|
|
digits[0] = (uint8_t)(digitIdx >> 0x1b);
|
|
digits[1] = (uint8_t)(digitIdx >> 0x16) & 0x1f;
|
|
outStr->_buf[0] = '\0';
|
|
digits[2] = (uint8_t)(digitIdx >> 0x11) & 0x1f;
|
|
outStr->_size = 9;
|
|
digits[3] = (uint8_t)(digitIdx >> 0xc) & 0x1f;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(digits4to7)) + 0x0))) = CONCAT11((char)(digitIdx >> 2),(char)(digitIdx >> 7)) & 0x1f1f;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(digits4to7)) + 0x0))) = (uint3)(uint16_t)digits4to7;
|
|
digits4to7 = CONCAT13(checksum,(uint3)digits4to7) & 0x1fffffff;
|
|
digits4to7 = CONCAT13((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(digits4to7)) + 0x3))),
|
|
CONCAT12((char)((digitIdx << 8 | GHIDRA_UINT(checksum)) >> 5),(uint16_t)digits4to7)) &
|
|
0xff1fffff;
|
|
memmove(outStr,"0000 0000",9);
|
|
outStr->_buf[9] = '\0';
|
|
digitIdx = 0;
|
|
do {
|
|
if (digitIdx != 4) {
|
|
digitIdx = digitIdx - 1;
|
|
if (digitIdx < 5) {
|
|
digitIdx = digitIdx;
|
|
}
|
|
chars = outStr;
|
|
if (0xf < outStr->_capacity) {
|
|
chars = *GHIDRA_CAST<std_string **>(outStr->_buf);
|
|
}
|
|
chars->_buf[digitIdx] = "ABCDEFGHJKLMNPQRSTWXYZ01234V6789"[digits[digitIdx]];
|
|
}
|
|
digitIdx = digitIdx + 1;
|
|
} while (digitIdx < 9);
|
|
return outStr;
|
|
}
|
|
|
|
// 009eb6b0
|
|
uint32_t Seeds::String2Seed(std_string *str)
|
|
{
|
|
std_string *chars;
|
|
char cVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
uint32_t digitIdx;
|
|
uint32_t uVar4;
|
|
uint8_t charLookup [256];
|
|
uint8_t digits [4];
|
|
uint8_t digit4;
|
|
uint8_t digit5;
|
|
uint8_t digit6;
|
|
uint8_t digit7;
|
|
uint32_t local_8;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((digits + 0xc));
|
|
if (str->_size == 9) {
|
|
uVar4 = str->_capacity;
|
|
chars = str;
|
|
if (0xf < uVar4) {
|
|
chars = *GHIDRA_CAST<std_string **>(str->_buf);
|
|
}
|
|
if (chars->_buf[4] == ' ') {
|
|
memset(charLookup,0xff,0x100);
|
|
uVar3 = 0;
|
|
do {
|
|
charLookup["ABCDEFGHJKLMNPQRSTWXYZ01234V6789"[uVar3]] = (uint8_t)uVar3;
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < 0x20);
|
|
uVar3 = 0;
|
|
do {
|
|
if (uVar3 != 4) {
|
|
digitIdx = uVar3 - 1;
|
|
if (uVar3 < 5) {
|
|
digitIdx = uVar3;
|
|
}
|
|
chars = str;
|
|
if (0xf < uVar4) {
|
|
chars = *GHIDRA_CAST<std_string **>(str->_buf);
|
|
}
|
|
bVar2 = charLookup[chars->_buf[uVar3]];
|
|
digits[digitIdx] = bVar2;
|
|
if (bVar2 == 0xff) {
|
|
return 0;
|
|
}
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < 9);
|
|
bVar2 = 0;
|
|
uVar3 = ((((((GHIDRA_UINT(digits[0]) << 5 | GHIDRA_UINT(digits[1])) << 5 | GHIDRA_UINT(digits[2])) << 5 |
|
|
GHIDRA_UINT(digits[3])) << 5 | GHIDRA_UINT(digit4)) << 5 | GHIDRA_UINT(digit5)) << 2 |
|
|
GHIDRA_UINT((digit6 >> 3))) ^ 0xfef7ffd;
|
|
for (uVar4 = uVar3; uVar4 != 0; uVar4 = uVar4 >> 5) {
|
|
cVar1 = bVar2 + (char)uVar4;
|
|
bVar2 = cVar1 * '\x02' - (cVar1 >> 7);
|
|
}
|
|
if (bVar2 == (uint8_t)(digit6 << 5 | digit7)) {
|
|
return uVar3;
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 009eb7f0
|
|
void Seeds::SetStartSeed(std_string seed)
|
|
{
|
|
uint32_t uVar1;
|
|
void *allocBlock;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
puStack_c = &LAB_00b0563d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
uVar1 = String2Seed(&seed);
|
|
set_start_seed(this,uVar1);
|
|
if (0xf < seed._capacity) {
|
|
uVar1 = seed._capacity + 1;
|
|
allocBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)seed._buf)) + 0x0)));
|
|
if (0xfff < uVar1) {
|
|
allocBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(seed._buf)) + 0x0))) + -4);
|
|
uVar1 = seed._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(seed._buf)) + 0x0))) - GHIDRA_INT(allocBlock)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(allocBlock,uVar1);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009eb880
|
|
void Seeds::set_start_seed(uint32_t seed)
|
|
{
|
|
code *pcVar1;
|
|
uint32_t rngSeed;
|
|
int remaining;
|
|
int *stageSeed;
|
|
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = seed;
|
|
if (seed == 0) {
|
|
rngSeed = Random();
|
|
seed = 1;
|
|
if (1 < rngSeed) {
|
|
seed = rngSeed;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = seed;
|
|
}
|
|
stageSeed = this->_stageSeeds;
|
|
remaining = 0xe;
|
|
(this->_rng)._shift1 = 3;
|
|
(this->_rng)._shift2 = 0x17;
|
|
(this->_rng)._seed = seed;
|
|
(this->_rng)._shift3 = 0x19;
|
|
do {
|
|
rngSeed = (this->_rng)._seed;
|
|
if (rngSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
rngSeed = (this->_rng)._seed;
|
|
if (rngSeed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
rngSeed = rngSeed >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ rngSeed;
|
|
rngSeed = rngSeed << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ rngSeed;
|
|
rngSeed = rngSeed >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ rngSeed;
|
|
(this->_rng)._seed = rngSeed;
|
|
*stageSeed = rngSeed;
|
|
stageSeed = stageSeed + 1;
|
|
remaining = remaining + -1;
|
|
} while (remaining != 0);
|
|
rngSeed = (this->_rng)._seed;
|
|
if (rngSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
rngSeed = (this->_rng)._seed;
|
|
if (rngSeed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
rngSeed = rngSeed >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ rngSeed;
|
|
rngSeed = rngSeed << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ rngSeed;
|
|
rngSeed = rngSeed >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ rngSeed;
|
|
(this->_rng)._seed = rngSeed;
|
|
this->_playerInitSeed = rngSeed;
|
|
return;
|
|
}
|
|
|
|
// 009eb950
|
|
void Seeds::Restart(int challenge)
|
|
{
|
|
if ((*GHIDRA_CAST<char *>(this) == '\0') || (challenge != 0)) {
|
|
set_start_seed(this,0);
|
|
return;
|
|
}
|
|
set_start_seed(this,*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))));
|
|
return;
|
|
}
|
|
|
|
// 009eb980
|
|
void Seeds::ForgetStageSeed(int levelStage)
|
|
{
|
|
code *pcVar1;
|
|
uint32_t stageIndex;
|
|
uint32_t stageIndex;
|
|
|
|
stageIndex = -GHIDRA_UINT((levelStage != 0)) & levelStage;
|
|
stageIndex = 0xd;
|
|
if (stageIndex < 0xd) {
|
|
stageIndex = stageIndex;
|
|
}
|
|
stageIndex = this->_stageSeeds[stageIndex];
|
|
if (stageIndex == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
stageIndex = stageIndex >> 5 ^ stageIndex;
|
|
stageIndex = stageIndex << 0xf ^ stageIndex;
|
|
this->_stageSeeds[stageIndex] = stageIndex >> 0x11 ^ stageIndex;
|
|
return;
|
|
}
|