| |
Introduction
Looking online, tpk extension is for Samsung watches.
When extracting the content of the zip files, we find some images in res folder, app icon in shared folder, and most importantly we find some dll files in bin folder.
| |
Looks like this is built with Xamarin and Tizen.
From the list of dlls we would need to only reverse engineer TKApp.dll.
I will be using Dnspy since this is a .NET app.
Information collecting
We start by importing all dlls into Dnspy to fix connections between them, then we start looking into TKApp.dll.
In the resources we see one interesting file TKApp.UnlockPage.xaml, which has
Entry named "PasswordEntry" and a Label named "flag", lets keep that in mind.
In the App class constructor
We see the usage of UnlockPage first.
UnlockPage
In this class there is the login handler method to handle password input:
| |
This is also from Util.Decode:
The password is "mullethat", and that is all there is to it for this class,
nothing on flag label.
MainPage
There is some stuff here, but two functions seems interesting:
| |
Getting App data
These two functions depend on App.Password, App.Note, App.Step and App.Desc. We know App.Password and its "mullethat".
From PedDataUpdate we know that App.Step can be obtained from
Application.Current.ApplicationInfo.Metadata["its"]. Looking tizen-manifest.xml we see
Next, App.Desc is being set in GalleryPage.IndexPage_CurrentPageChanged
| |
we can get this with:
So its "water".
Lastly, App.Note. Its being set in TodoPage.SetupList.
| |
So this can be "and enable GPS" or "keep steaks for dinner",
since they are the first that are not done. I assumed that we should be at home,
so I worked with "keep steaks for dinner". But you can try both, its not much.
In the end:
In PedDataUpdate, it checks that the values are correct by comparing
the SHA256 of App.Password + App.Note + App.Step + App.Desc
to some predefined value. Tried it and it matches.
GetImage function
The most important part of that function is:
| |
And Util.GetString:
| |
This looks like AES decryption. Now we have all the pieces, lets solve it.
Solution
First, we can export the resource Runtime.dll into a file.
Then we run this:
| |
Running this, we get an image:

Flag:
| |