Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
void FUN_00293d08(ulong *param_1,ulong param_2)
{
ulong uVar1;
ulong uVar2;
uint uVar3;
int iVar4;
long *local_t2_lo_12;
long *local_t2_lo_200;
ulong uVar5;
ulong uVar6;
uint uVar7;
uint uVar8;
ulong uVar9;
uint uVar10;
uint uVar11;
int iVar12;
iVar4 = 0x38;
local_t2_lo_12 = &LONG_0036dcc0;
uVar5 = 0x8000000000000000;
uVar1 = 0;
do {
uVar2 = 0;
if ((param_2 & 1 << (ulong)*(byte *)local_t2_lo_12) != 0) {
uVar2 = uVar5;
}
uVar1 = uVar1 | uVar2;
iVar4 = iVar4 + -1;
local_t2_lo_12 = (long *)((int)local_t2_lo_12 + 1);
uVar5 = uVar5 >> 1;
} while (iVar4 != 0);
uVar5 = uVar1 >> 0x24;
uVar1 = uVar1 >> 8 & 0xfffffff;
uVar3 = 0x10;
do {
uVar11 = (uint)uVar1;
uVar10 = (uint)uVar5;
if (((uVar3 < 0xf) && (uVar3 != 8)) && (uVar7 = uVar10 >> 0x1a, uVar3 != 1)) {
uVar8 = uVar11 >> 0x1a;
iVar4 = uVar10 << 2;
iVar12 = uVar11 << 2;
}
else {
uVar7 = uVar10 >> 0x1b;
uVar8 = uVar11 >> 0x1b;
iVar4 = uVar10 << 1;
iVar12 = uVar11 << 1;
}
uVar5 = (long)iVar4 & 0xfffffffU | (long)(int)uVar7;
uVar1 = (long)iVar12 & 0xfffffffU | (long)(int)uVar8;
iVar4 = 0x30;
local_t2_lo_200 = &LONG_0036dd00;
uVar6 = 0x8000000000000000;
uVar2 = 0;
do {
uVar9 = 0;
if (((uVar5 << 0x24 | uVar1 << 8) & 1 << (ulong)*(byte *)local_t2_lo_200) != 0) {
uVar9 = uVar6;
}
uVar2 = uVar2 | uVar9;
iVar4 = iVar4 + -1;
local_t2_lo_200 = (long *)((int)local_t2_lo_200 + 1);
uVar6 = uVar6 >> 1;
} while (iVar4 != 0);
uVar3 = uVar3 - 1;
*param_1 = uVar2;
param_1 = param_1 + 1;
} while (uVar3 != 0);
return;
}
ulong FUN_00293a60(ulong param_1)
{
int iVar1;
ulong uVar2;
ulong uVar3;
ulong uVar4;
ulong uVar5;
ulong uVar6;
ulong uVar7;
ulong uVar8;
ulong uVar9;
ulong uVar10;
ulong uVar11;
ulong uVar12;
iVar1 = 8;
uVar11 = 0;
uVar12 = 0;
do {
uVar2 = SEXT48(1 << (iVar1 - 1U & 0x1f));
uVar7 = 0;
if ((param_1 & 2) != 0) {
uVar7 = uVar2;
}
uVar3 = 0;
if ((param_1 & 1) != 0) {
uVar3 = uVar2 << 0x20;
}
uVar4 = 0;
if ((param_1 & 4) != 0) {
uVar4 = uVar2 << 0x28;
}
uVar8 = 0;
if ((param_1 & 8) != 0) {
uVar8 = uVar2 << 8;
}
uVar5 = 0;
if ((param_1 & 0x10) != 0) {
uVar5 = uVar2 << 0x30;
}
uVar9 = 0;
if ((param_1 & 0x20) != 0) {
uVar9 = uVar2 << 0x10;
}
uVar6 = 0;
if ((param_1 & 0x40) != 0) {
uVar6 = uVar2 << 0x38;
}
uVar10 = 0;
if ((param_1 & 0x80) != 0) {
uVar10 = uVar2 << 0x18;
}
uVar11 = uVar11 | uVar3 | uVar4 | uVar5 | uVar6;
iVar1 = iVar1 + -1;
uVar12 = uVar12 | uVar7 | uVar8 | uVar9 | uVar10;
param_1 = param_1 >> 8;
} while (iVar1 != 0);
return uVar11 | uVar12;
}
ulong FUN_00293c08(ulong param_1)
{
ulong uVar1;
int iVar2;
int iVar3;
long lVar4;
ulong *puVar5;
ulong uVar6;
puVar5 = &DAT_0036d940;
prefetch(0x36d940,0);
iVar2 = 0x20;
prefetch(0x36d980,0);
iVar3 = 0x20;
prefetch(0x36d9c0,0);
uVar1 = 0;
prefetch(0x36da00,0);
do {
lVar4 = (long)iVar3;
iVar2 = iVar2 + -1;
iVar3 = iVar3 + 1;
uVar6 = 0;
if ((param_1 >> lVar4 & 1) != 0) {
uVar6 = *puVar5;
}
puVar5 = puVar5 + 1;
uVar1 = uVar1 | uVar6;
} while (iVar2 != 0);
return uVar1;
}
ulong FUN_00293ca8(ulong param_1)
{
uint uVar1;
ulong uVar2;
int iVar3;
int iVar4;
long lVar5;
undefined *puVar6;
byte *pbVar7;
iVar3 = 8;
iVar4 = 0x20;
puVar6 = &DAT_0036dac0;
uVar2 = 0;
do {
lVar5 = (long)iVar4;
prefetch(puVar6,0);
uVar1 = (uint)param_1;
iVar3 = iVar3 + -1;
pbVar7 = puVar6 + (uVar1 & 0x20 | uVar1 >> 1 & 0xf | (uVar1 & 1) << 4);
puVar6 = puVar6 + 0x40;
param_1 = param_1 >> 6;
iVar4 = iVar4 + 4;
uVar2 = uVar2 | (ulong)*pbVar7 << lVar5;
} while (iVar3 != 0);
return uVar2;
}
long FUN_00293c5c(ulong param_1)
{
ulong uVar1;
int iVar2;
int iVar3;
long lVar4;
int *piVar5;
ulong uVar6;
piVar5 = &DAT_0036da40;
iVar2 = 0x20;
prefetch(0x36da40,0);
iVar3 = 0x20;
prefetch(0x36da80,0);
uVar1 = 0;
do {
lVar4 = (long)iVar3;
iVar2 = iVar2 + -1;
iVar3 = iVar3 + 1;
uVar6 = 0;
if ((param_1 >> lVar4 & 1) != 0) {
uVar6 = (long)*piVar5;
}
piVar5 = piVar5 + 1;
uVar1 = uVar1 | uVar6;
} while (iVar2 != 0);
return uVar1 << 0x20;
}
ulong FUN_00293b28(ulong param_1)
{
uint uVar1;
ulong uVar2;
ulong uVar3;
ulong uVar4;
ulong uVar5;
ulong uVar6;
ulong uVar7;
ulong uVar8;
ulong uVar9;
ulong uVar10;
ulong uVar11;
ulong uVar12;
uVar1 = 0;
uVar11 = 0;
uVar12 = 0;
do {
uVar2 = SEXT48(1 << ((uVar1 >> 2 ^ 1) & 0x1f | (uVar1 & 3) << 1));
uVar3 = 0;
if ((param_1 & 1) != 0) {
uVar3 = uVar2 << 0x38;
}
uVar7 = 0;
if ((param_1 & 2) != 0) {
uVar7 = uVar2 << 0x30;
}
uVar4 = 0;
if ((param_1 & 4) != 0) {
uVar4 = uVar2 << 0x28;
}
uVar8 = 0;
if ((param_1 & 8) != 0) {
uVar8 = uVar2 << 0x20;
}
uVar5 = 0;
if ((param_1 & 0x10) != 0) {
uVar5 = uVar2 << 0x18;
}
uVar9 = 0;
if ((param_1 & 0x20) != 0) {
uVar9 = uVar2 << 0x10;
}
uVar10 = 0;
if ((param_1 & 0x80) != 0) {
uVar10 = uVar2;
}
uVar6 = 0;
if ((param_1 & 0x40) != 0) {
uVar6 = uVar2 << 8;
}
uVar1 = uVar1 + 1;
uVar12 = uVar12 | uVar7 | uVar8 | uVar9 | uVar10;
uVar11 = uVar11 | uVar3 | uVar4 | uVar5 | uVar6;
param_1 = param_1 >> 8;
} while (uVar1 < 8);
return uVar11 | uVar12;
}
int main() {
long lVar4;
ulong uVar6;
ulong uVar7;
long lVar8;
ulong uVar9;
undefined in_a3_qw [16];
ulong uVar12;
ulong *puVar13;
int iVar14;
char **ppcVar15;
int iVar16;
int iVar17;
ulong auStack352 [15];
ulong local_e8;
undefined **local_d8;
int local_d0;
int local_c4;
undefined local_b0 [16];
// Scrambled data should be 0x68000
lVar4 = SUB168(in_a3_qw,0);
if (lVar4 < 0) {
ppcVar15 = local_d8 + 4;
}
else {
local_d0 = SUB164(in_a3_qw,0) + 7;
local_b0 = in_a3_qw;
FUN_00293d08(auStack352,((QWORD_002ad978 ^ 0x2cbadb31cccb12f6) - 5) - QWORD_002ad970);
ppcVar15 = local_d8;
iVar17 = local_d0;
if (-1 < SUB168(local_b0,0)) {
iVar17 = SUB164(local_b0,0);
}
lVar4 = 0;
if (0x3f < iVar17 >> 3) {
do {
iVar17 = 0;
local_c4 = (int)lVar4 + 0x200;
do {
iVar16 = (int)lVar4 + iVar17;
iVar17 = iVar17 + 1;
puVar13 = &local_e8;
iVar14 = 0xf;
uVar6 = FUN_00293a60(*(ulong *)(&DAT_00680000 + iVar16 * 8));
uVar7 = uVar6 << 0x20;
uVar6 = uVar6 & 0xffffffff00000000;
do {
uVar12 = uVar7;
uVar7 = FUN_00293c08(uVar12);
iVar14 = iVar14 + -1;
uVar9 = *puVar13;
puVar13 = puVar13 + -1;
uVar7 = FUN_00293ca8((uVar7 ^ uVar9) >> 0x10);
uVar7 = FUN_00293c5c(uVar7);
uVar7 = uVar7 ^ uVar6;
uVar6 = uVar12;
} while (-1 < iVar14);
uVar7 = FUN_00293b28(uVar7 | uVar12 >> 0x20);
*(ulong *)(&DAT_00680000 + iVar16 * 8) = uVar7;
} while (iVar17 < 0x40);
lVar4 = (long)local_c4;
iVar17 = local_d0;
if (-1 < SUB168(local_b0,0)) {
iVar17 = SUB164(local_b0,0);
}
} while (local_c4 + 0x3f < iVar17 >> 3);
}
ppcVar15 = ppcVar15 + 4;
// Unscrambled data should now be at 0x68000
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.