Modding[Release]Achievement & Avatar Award Unlocker + Source[C#]
Posted:

Modding[Release]Achievement & Avatar Award Unlocker + Source[C#]Posted:

XeCrippy
  • Winter 2019
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Original Version:
Searches default.xex for XUserWriteAchievements. This method is slow and kind of messy.


Source

Download


*EDIT: I forgot that I built this on .net 9 in visual studio 2022 preview. If anyone is having trouble, that could be why.

https://i.gyazo.com/2b3c11e5ed38449771e1c4043778ccca.png


WPF Version:
Same as original version except it saves the addresses for XUserWriteAchievements to a json file along with the title id.


Revised Version:
Loads an xex module into memory that calls XUserWriteAchievements and XUserAwardAvatarAssets. Also includes gamer picture unlocker. This one does not search memory for the game specific function and instead calls it from the internal Xbox libraries so it works instantly. The gamer pics can take a few seconds and some games that have a lot of achievements may take a few seconds. I didn't include the executable for this one so you'll have to compile the source. Built on .NET framework 4.7.2 in VS 2022 preview.



**DO NOT USE THE LATEST VERSION FOR THE TIME BEING. THERE IS SOMETHING WRONG WITH THE FUNCTION CALL THAT WILL CORRUPT THE PROFILE. IF THIS HAPPENS CLEAR YOUR CACHE AND REDOWNLOAD THE PROFILE**

Currently looking for a fix. The plugin works fine but when calling the function from the c# tool something isn't being handled properly.


Last edited by XeCrippy ; edited 9 times in total

The following 3 users thanked XeCrippy for this useful post:

Federation (01-12-2025), Wretched (09-21-2024), Treason (09-21-2024)
#2. Posted:
Treason
  • Christmas!
Status: Offline
Joined: Jan 29, 201311Year Member
Posts: 415
Reputation Power: 555
Motto: RGH Consoles In Stock!
Motto: RGH Consoles In Stock!
Status: Offline
Joined: Jan 29, 201311Year Member
Posts: 415
Reputation Power: 555
Motto: RGH Consoles In Stock!
says missing .exe when trying to run or build in vb code looks sweet though, do i have to add UI
#3. Posted:
XeCrippy
  • Vantage
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Treason wrote says missing .exe when trying to run or build in vb code looks sweet though, do i have to add UI


It's c# not VB. If you want to build the source you need to add xdevkit.dll and jrpc.dll and change the reference from JRPCPlusPlus to JRPC_Client (normal jrpc). I mean really this is all it is are these two functions that are needed


private uint LocateInstruction()
        {
            byte[] targetSequence = { 0x60, 0x84, 0x00, 0x08 };
            byte[] bytes = console.GetMemory(0x82000000, 0x3000000);

            for (int i = 0; i <= bytes.Length - targetSequence.Length; i++)
            {
                bool match = true;
                for (int j = 0; j < targetSequence.Length; j++)
                {
                    if (bytes[i + j] != targetSequence[j])
                    {
                        match = false;
                        break;
                    }
                }
                uint address = 0x82000000 + (uint)i;
                if (match)
                {
                    uint addr2 = address - 0x8;
                    byte[] testBytes = console.GetMemory(addr2, 4);
                    byte[] target2 = { 0x38, 0xE0, 0x00, 0x08 };
                    if (testBytes.Length == target2.Length && testBytes.SequenceEqual(target2))
                    {
                        return address;
                    }
                }
            }
            return 0;
        }

        private void XUserWriteAchievements(uint achievementCallAddr, uint achievementIdPtr, uint xoverlappedPtr, int achievementCount)
        {
            console.WriteUInt32(xoverlappedPtr, 0);

            for (int i = 0; i < achievementCount; i++)
            {
                console.WriteUInt64(achievementIdPtr, (ulong)i);
                console.CallVoid(achievementCallAddr, 1, achievementIdPtr, xoverlappedPtr);

                while (console.ReadUInt32(xoverlappedPtr) != 0) Thread.Sleep(30);
            }
            Thread.Sleep(250);
        }

private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (connected)
                {
                    uint callAddr = LocateInstruction() - 0x24;
                    if (callAddr != 0)
                        XUserWriteAchievements(callAddr, 0x91D0D9E0, 0x91D0D9E8, 350); // i set the count high because the id's are not always in sequence. better chance to get all of them
                    else
                        MessageBox.Show("Failed to find the function address!");
                }
                else
                    MessageBox.Show("Not connected to console!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
#4. Posted:
XeCrippy
  • Rated Awesome
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
So to be a little more clear, to build the GitHub source clone the repo and then once it's opened in visual studio remove the current references to xdevkit and jrpc. Then re-add them and change the using JRPCPlusPlus to JRPC_Client. Then it will build a .exe. It has a UI but it's just two buttons.

All it's doing is searching the xex for a specific sequence of bytes that I know is part of the function to write achievements. Then calculating the function address once it finds it. That address will be the start of XUserWriteAchievements within the specific game you're on. Then it calls XUserWriteAchievements with the proper arguments.
#5. Posted:
XeCrippy
  • Winter 2019
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Added avatar award unlocker also and included the prebuilt binaries in the release tab. There is .NET 6 and .NET 9 versions, you will need to have one of those installed probably.

Downloads
#6. Posted:
XeCrippy
  • Winter 2019
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
#7. Posted:
XeCrippy
  • Winter 2019
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Made a little bit better version. It uses a plugin so it's kind of pointless making a tool but it works well. I will add avatar awards also.


For the people who have been asking around about unlocking individual achievements I may have made some progress. I'm not sure if there is a way to do it dynamically like this though, the only way I can think of would be doing individual games. Most games apparently have a struct for the achievement names and so on. There is one little snippet on the web about unlocking achievements on mw2 that shows a method worth reversing. I have limited time to fool with it between work but I do plan to release it eventually.

Git hub source
#8. Posted:
Federation
  • Summer 2022
Status: Offline
Joined: Apr 22, 201113Year Member
Posts: 6,321
Reputation Power: 15211
Motto: Don't be a follower be a leader! "The Federation sees all!" -Cortez Dia
Motto: Don't be a follower be a leader! "The Federation sees all!" -Cortez Dia
Status: Offline
Joined: Apr 22, 201113Year Member
Posts: 6,321
Reputation Power: 15211
Motto: Don't be a follower be a leader! "The Federation sees all!" -Cortez Dia
Thank you for this post man!
#9. Posted:
XeCrippy
  • Vantage
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
Status: Offline
Joined: May 12, 20168Year Member
Posts: 1,921
Reputation Power: 1262
So I was messing around with XUserAwardGamerPicture and just for kicks tried it from the dashboard instead of on a game and it seems like it can unlock all the pictures from the games in your play history if you set the count for the picture Id high enough xD

https://i.gyazo.com/c5c4e8ab599a3f254ff80cf9f26f199c.png
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS