The website only contains the challenge description, and is not needed to solve the challenge: https://azusawa.world/#/2023/03/02
Solution
Downloading the game files we find that the game is Unity (Mono Bleeding Edge), so let's run the game on a Windows VM.
We have 100 credits, which we can use to pull a card - after that we will have zero credits.
I used cheat engine to scan for the value and then increased it to 999999 (check my cheat engine tutorial series if you want to find out how to do this).
Now we can do the 10 card pull, which costs 1000 credits. Each time, we get a different combination of 2 or 3 star cards (but no flag).
Since the game is Unity, we can try to decompile the Assembly-CSharp.dll with a tool like DNSpy, recovering the C# code.
Immediately, I noticed some interesting values, e.g. the Character class has a flag property.
Comparing the methods, we see that the DisplayFourStarCharacter has an interesting section of code.
string flag =character.flag;if (flag !=null){byte[] array =Convert.FromBase64String(flag);Texture2D texture2D =newTexture2D(2,2);texture2D.LoadImage(array);Rect rect =newRect(0f,0f, (float)texture2D.width, (float)texture2D.height);Vector2 vector =newVector2(0.5f,0.5f);Sprite sprite =Sprite.Create(texture2D, rect, vector);this.flagImage.sprite= sprite;}
Looks like all we need to do is get a 4-star card and we've solved the challenge! First, I patched the code so that all cards would be processed as 4-star (I thought maybe the 2-3 star characters could still have a flag property, that wasn't being extracted/displayed). The patched code looked like:
It didn't work though - we saw from the web request that the cards are returned from the server though, this isn't going to be a client-side trick. Maybe we just need to brute-force until we get it? Well, we can check the game rules and find that the odds are as follows.
4star=0%3star=8.5%2star=91.5%
Sounds like we have literally zero chance of getting a 4 star card. I decided to copy the HTTP request we found earlier to burp suite and play around with the values. After a few attempts I came across this one.
The response contained a happy-birthday character containing a big base64 blob.
{"characters": [ {"name":"こはね 小豆沢","cardName":"Happy Birthday!!2023","rarity":"4*","attribute":"Mysterious","splashArt":"happy-birthday","avatar":"happy-birthday-icon","flag":"redacted due to size"..........
We can save the base64 blob to a text file and run base64 -d file_name > flag and then check the file type with file flag.
It's a PNG image, so we rename to flag.png and open it up to find our flag!