Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sub_120()
- {
- Block0();
- Block1();
- Block2();
- Block3();
- do
- {
- Block4();
- }
- while(Block5())
- Block6();
- Block7();
- Block8();
- while(Block9());
- Block10();
- Block11();
- do
- {
- if(Block12())
- {
- Block15();
- }
- else
- {
- if(!Block13())
- {
- Block14();
- }
- }
- while(Block16());
- Block17();
- }
- while(Block18())
- Block19();
- Block20();
- Block21();
- Block22();
- Block23();
- while(Block24());
- Block25();
- }
- void Block0()
- {
- _asm
- {
- mfspr r12, LR #(mfspr) Copies the contents of a special-purpose register into a general-purpose register.
- std r12, -8(r1)
- std response, -0x10(r1)
- std r30, -0x18(r1)
- std r29, -0x20(r1)
- std r28, -0x28(r1)
- std r27, -0x30(r1)
- std r26, -0x38(r1)
- std r25, -0x40(r1)
- stdu r1, -0xF0(r1)
- addi response, r3, 0x20 #increment the contents of r3 by 0x20 then store the result back into r31(response)
- ld r12, 0(r0) #read from 0x0 in HV & Load a double-word of data into the specified general purpose register.
- std r12, 8(response) #store HV 8 byte header at response + 0x28 = wHvMagic
- ld r12, 0x10(r0) #read from 0x10 in HV & Load a double-word of data into the specified general purpose register.
- std r12, 0x10(response) #store BaseKernel+UpdateType at 0x30 = wHvVersion
- lwz r12, dword_30 #read from 0x30 in HV & Loads a word of data from a specified location in memory into a general-purpose register
- stw r12, 0x18(response) #response + 0x38 = dwBaseKernelVersion
- lwz r12, dword_74 #read from 0x74 in HV & Loads a word of data from a specified location in memory into a general-purpose register
- stw r12, 0x1C(response) #response + 0x3C = dwUpdateSequence
- std r2, 0x20(response) #store RTOC @ response + 0x40 (RTOC = 0x00000002000000000 = qwRTOC
- mfspr r12, HRMOR #0x0000010000000000 (mfspr) Copies the contents of a special-purpose register into a general-purpose register.
- std r12, 0x28(response) #response + 0x48 = qwHRMOR
- lwz r12, dword_4C #read from 0x4C in HV Loads a word of data from a specified location in memory into a general-purpose register
- add r30, r2, r12 #increments the contents of r2 by the contents of r12 storing the result back into r30
- lwz r12, 8(r30) #Loads a word of data from a specified location in memory into a general-purpose register
- mtspr CTR, r12 #(mtspr) Copies the contents of a general-purpose register into a special-purpose register.
- mr r3, r4 #The mr subcommand modifies general purpose, segment, special, or floating point registers.
- li r4, 0x1000 #load immediate (take this constant value known at compile time and store it in this register)
- bctrl
- }
- }
- void Block1()
- {
- _asm
- {
- mr r25, r3 #The mr subcommand modifies general purpose, segment, special, or floating point registers.
- lwz r28, 0xD4(r30) #Loads a word of data from a specified location in memory into a general-purpose register
- lwz r29, 0xD8(r30) #Loads a word of data from a specified location in memory into a general-purpose register
- lwz r30, 0xD0(r30) #Loads a word of data from a specified location in memory into a general-purpose register
- bl XeCryptShaInit #Branch (to call a function)
- }
- }
- void Block2()
- {
- _asm
- {
- li r5, 0x10 #load immediate (take this constant value known at compile time and store it in this register)
- mr r4, r25 #The mr subcommand modifies general purpose, segment, special, or floating point registers.
- bl XeCryptShaUpdate #Branch (to call a function) & first hash HV salt
- }
- }
- void Block3()
- {
- _asm
- {
- li r26, 7 #load immediate (take this constant value known at compile time and store it in this register)
- addi r27, response, 0x388 #increment the contents of r31 by 0x388 then store the result back into r27
- }
- }
- void Block4()
- {
- _asm
- {
- loc_1BC
- ldu r6, 8(r27) #start reading from offset at 0x3B0 & Load a double-word of data into the specified general purpose register, updating the address base.
- andi. r5, r6, 0xFFF #(create length) & Logically ANDs the contents of a general-purpose register with an immediate value.
- srdi r4, r6, 16 #(create offset) & Rotate double word right immediate
- bl XeCryptShaUpdate #Branch (to call a function)
- }
- }
- void Block5()
- {
- _asm
- {
- addic. r26, r26, -1 #Performs an addition with carry of the contents of a general-purpose register and an immediate value.
- bne loc_1BC
- }
- }
- void Block6()
- {
- _asm
- {
- addi r4, response, 0xCC #(store at response + 0xEC) increment the contents of r31 by 0xCC then store the result back into r4
- bl XeCryptShaFinal #Branch (to call a function)
- }
- }
- void Block7()
- {
- _asm
- {
- bl XeCryptShaInit #Branch (to call a function)
- }
- }
- void Block8()
- {
- _asm
- {
- li r5, 8 #load immediate (take this constant value known at compile time and store it in this register)
- mtspr CTR, r5 #(mtspr) Copies the contents of a general-purpose register into a special-purpose register.
- addi r26, response, 0x3E0 #increment the contents of r31 by 0x3E0 then store the result back into r26
- extrdi r12, r26, 16,32 #Extract double word and right justify immediate
- sth r12, 0xD8(response) #Stores a halfword of data from a general-purpose register into a specified location in memory.
- addi r4, r26, -8 #increment the contents of r26 by -8 then store the result back into r4
- }
- }
- void Block9()
- {
- _asm
- {
- loc_1F8
- ld r12, 0(r25) #Load a double-word of data into the specified general purpose register.
- stdu r12, 8(r4) #Store a double-word of data from a general purpose register into a specified memory location. Update the address base.
- ld r12, 8(r25) #Load a double-word of data into the specified general purpose register.
- stdu r12, 8(r4) #Store a double-word of data from a general purpose register into a specified memory location. Update the address base.
- bdnz+ loc_1F8
- }
- }
- void Block10()
- {
- _asm
- {
- dcbst r0, r26 #Allows a program to copy the contents of a modified block to main memory.
- sync
- li r25, 0x200 #load immediate (take this constant value known at compile time and store it in this register)
- oris r25, r25, 0x8000 #Logically ORs the upper 16 bits of the contents of a general-purpose register with a 16-bit unsigned integer and stores the result in another general-purpose register.
- sldi r25, r25, 32 #Shift left double word immediate
- oris r25, r25, 1 #Logically ORs the upper 16 bits of the contents of a general-purpose register with a 16-bit unsigned integer and stores the result in another general-purpose register.
- extrdi r4, r26, 10,48 #Extract double word and right justify immediate
- ori r4, r4, 0xF800 #Logically ORs the lower 16 bits of the contents of a general-purpose register with a 16-bit unsigned integer and stores the result in another general-purpose register.
- li r5, 2 #load immediate (take this constant value known at compile time and store it in this register)
- add r4, r25, r4 #increments the contents of r25 by the contents of r4 storing the result back into r4
- bl XeCryptShaUpdate #Branch (to call a function)
- }
- }
- void Block11()
- {
- _asm
- {
- li r26, 0xD #load immediate (take this constant value known at compile time and store it in this register)
- addi r27, response, 0x320 #increment the contents of r31 by 0x320 then store the result back into r27
- }
- }
- void Block12()
- {
- _asm
- {
- loc_240
- ldu r6, 8(r27) #start reading from offset at 0x348 & Load a double-word of data into the specified general purpose register, updating the address base.
- andi. r12, r6, 0x8000 #Logically ANDs the contents of a general-purpose register with an immediate value.
- bne loc_278
- }
- }
- void Block13()
- {
- _asm
- {
- li r3, 1 #load immediate (take this constant value known at compile time and store it in this register)
- mtspr CTR, r3 #(mtspr) Copies the contents of a general-purpose register into a special-purpose register.
- srdi r3, r6, 16 #Rotate double word right immediate
- mr r4, r3 #The mr subcommand modifies general purpose, segment, special, or floating point registers.
- andi. r5, r6, 0x7F #Logically ANDs the contents of a general-purpose register with an immediate value.
- cmplwi r5, 0x10 #Compare Logical Word Immediate
- blt loc_290
- }
- }
- void Block14()
- {
- _asm
- {
- clrldi r4, r4, 46 #Clear left double word immediate
- li r12, 1 #load immediate (take this constant value known at compile time and store it in this register)
- insrdi r4, r12, 1,0 #Insert double word from right immediate
- b loc_290
- }
- }
- void Block15()
- {
- _asm
- {
- loc_278
- andi. r5, r6, 0x3FF #Logically ANDs the contents of a general-purpose register with an immediate value.
- mtspr CTR, r5 #(mtspr) Copies the contents of a general-purpose register into a special-purpose register.
- srdi r3, r6, 16 #Rotate double word right immediate
- extrdi r12, r3, 12,46 #Extract double word and right justify immediate
- add r4, r25, r12 #increments the contents of r25 by the contents of r12 storing the result back into r4
- sldi r5, r5, 1 #Shift left double word immediate
- }
- }
- void Block16()
- {
- _asm
- {
- loc_290
- lbz r12, 0(r3) #Loads a byte of data from a specified location in memory into a general-purpose register and sets the remaining 24 bits to 0.
- stb r12, 0(r3) #Stores a byte of data from a general-purpose register into a specified location in memory.
- dcbst r0, r3 #Allows a program to copy the contents of a modified block to main memory.
- addi r3, r3, 0x80 #increment the contents of r3 by 0x80 then store the result back into r3
- bdnz+ loc_290
- }
- }
- void Block17()
- {
- _asm
- {
- sync
- bl XeCryptShaUpdate #Branch (to call a function)
- }
- }
- void Block18()
- {
- _asm
- {
- addic. r26, r26, -1 #Performs an addition with carry of the contents of a general-purpose register and an immediate value.
- bne loc_240
- }
- }
- void Block19()
- {
- _asm
- {
- addi r4, response, 0x30 #(store at response + 0x50) increment the contents of r31 by 0x30 then store the result back into r4
- bl XeCryptShaFinal #Branch (to call a function)
- }
- }
- void Block20()
- {
- _asm
- {
- bl XeCryptShaInit #Branch (to call a function)
- }
- }
- void Block21()
- {
- _asm
- {
- li r5, 0x10 #load immediate (take this constant value known at compile time and store it in this register)
- li r4, 0x20 #' ' #Get The CPUKey off the HV
- bl XeCryptShaUpdate #Branch (to call a function)
- }
- }
- void Block22()
- {
- _asm
- {
- addi r4, response, 0x44 #(hash CPU key at response + 0x64) increment the contents of r31 by 0x44 then store the result back into r4
- bl XeCryptShaFinal #Branch (to call a function)
- }
- }
- void Block23()
- {
- _asm
- {
- li r5, 0x10 #load immediate (take this constant value known at compile time and store it in this register)
- mtspr CTR, r5 #(mtspr) Copies the contents of a general-purpose register into a special-purpose register.
- addi r4, response, 0x50 #(reading from response at 0x78) increment the contents of r31 by 0x50 then store the result back into r4
- lis r3, 1 #Load Immediate Shifted
- insrdi r3, r3, 47,0 #Insert double word from right immediate
- ori r3, r3, 0x38 #Logically ORs the lower 16 bits of the contents of a general-purpose register with a 16-bit unsigned integer and stores the result in another general-purpose register.
- }
- }
- void Block24()
- {
- _asm
- {
- loc_2EC
- ldu r12, 8(r3) #0000000200010040 (0x10040 in HV space) & Load a double-word of data into the specified general purpose register, updating the address base.
- stdu r12, 8(r4) #Store a double-word of data from a general purpose register into a specified memory location. Update the address base.
- bdnz loc_2EC #copy 0x74 bytes of data into response + 0x78
- }
- }
- void Block25()
- {
- _asm
- {
- addi r1, r1, 0xF0 #increment the contents of r1 by 0xF0 then store the result back into r1
- ld r12, -8(r1) #Load a double-word of data into the specified general purpose register.
- mtspr LR, r12 #(mtspr) Copies the contents of a general-purpose register into a special-purpose register.
- ld r25, -0x40(r1) #Load a double-word of data into the specified general purpose register.
- ld r26, -0x38(r1) #Load a double-word of data into the specified general purpose register.
- ld r27, -0x30(r1) #Load a double-word of data into the specified general purpose register.
- ld r28, -0x28(r1) #Load a double-word of data into the specified general purpose register.
- ld r29, -0x20(r1) #Load a double-word of data into the specified general purpose register.
- ld r30, -0x18(r1) #Load a double-word of data into the specified general purpose register.
- ld response, -0x10(r1) #Load a double-word of data into the specified general purpose register.
- li r3, 0 #load immediate (take this constant value known at compile time and store it in this register)
- blr
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement