The Forum is up for sale: XeNTaX Forum looking for new owner

Decryption Algorithm Reverse

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
theclub654
beginner
Posts: 26
Joined: Wed Oct 14, 2015 1:57 am
Has thanked: 3 times
Been thanked: 1 time

Decryption Algorithm Reverse

Post by theclub654 »

This is a decryption algorithm for a game could someone reverse this into c++. This is ppc

loc_39F50:
addi r29, r26, 0x18C
li r6, 1
lis r4, 4
clrldi r5, r29, 32
mr r3, r31
bl sub_18E8D0
nop
mr r3, r31
bl sub_8619C
nop
lis r6, 0x23CF # 0x23CF405D
lis r0, 4
li r7, 0
ori r6, r6, 0x405D # 0x23CF405D
mtspr CTR, r0
li r9, 0x7A69

loc_39F90:
add r10, r7, r29
addi r7, r7, 1
clrldi r10, r10, 32
mulli r11, r9, 0x1A3
addi r11, r11, 0x181D
lbz r8, 0(r10)
mulhwu r0, r11, r6
srwi r9, r0, 12
mulli r9, r9, 0x7262
subf r9, r9, r11
slwi r0, r9, 8
subf r0, r9, r0
mulhwu r0, r0, r6
extrdi r0, r0, 8,44
xor r0, r0, r8
stb r0, 0(r10)
bdnz+ loc_39F90
User avatar
ikskoks
Moderator
Posts: 1648
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 643 times
Been thanked: 419 times
Contact:

Re: Decryption Algorithm Reverse

Post by ikskoks »

Try to use Ghidra or IDA Pro to decompile this.
Post Reply