hax0r31337 / resleriana_tools

Tool to play around with Atelier Resleriana encrypted AssetBundle files
MIT License
5 stars 3 forks source link

Usage documentation #3

Open 09williamsad opened 11 months ago

09williamsad commented 11 months ago

After the last update, I now get "invalid character '<' looking for beginning of value" at the star of the main for loop, after changing the asset version and running. I suspect that there is a significant difference between how I am using this tool and how it has been made to be used.

Can you add information detailing: how it is supposed to be used Its dependencies required modifications etc.

hax0r31337 commented 11 months ago

well you need to replace this with an actual version

Riunia commented 11 months ago

well you need to replace this with an actual version

Apologies for the stupid question, but how would I go about finding the Asset Version?

hax0r31337 commented 11 months ago

You can log the request with mitmproxy after you killed the certificate pinning in BestHTTP2

09williamsad commented 11 months ago

well you need to replace this with an actual version

I did that, which I why I think some other step is being missed.

What is the execution environment and steps involved for this tool? For example: Does it need a go 1.21.1 or do higher versions work? Does terminal focus need to be in a specific folder? Are there any steps other than changing the asset version required? Does this use a standard golang run like "go run main.go"? It is designed to work with a golang IDE or just to be run?

hax0r31337 commented 11 months ago

I think it will be fine across go versions.
I'd recommend you to run it in the folder of the project
Nope.
go run ./main It's designed to run without an IDE as I'm using NeoVim sometimes

09williamsad commented 11 months ago

Thanks, that clears up the running.

For the version do you mean: The published game version, currently 1.0.2 The game code version, currently, 847 Or something else?

You can log the request with mitmproxy after you killed the certificate pinning in BestHTTP2

I am not sure how to use those tools for this use case.

hax0r31337 commented 11 months ago

For the version I meant the game asset version

09williamsad commented 11 months ago

Steps:

  1. Install latest golang, currently 1.21.3
  2. Clone project and extract the zip
  3. Edit main.go so that the base_url has the game version, currently 1.0.2. const BASE_URL = "https://asset.resleriana.jp/asset/1.0.2/Android/"
  4. Open terminal and change directory to the resleriana_tools-main
  5. Run the command "go run ./main"

This results in: panic: invalid character '<' looking for beginning of value goroutine 1 [running]: main.main() C:/Users/adamw/Downloads/resleriana_tools-main/main/main.go:27 +0x5e5 exit status 2

I presume I am missing something.

From what I understand, the current version download the catalog.json file and assets. Or am I mistaken and I need to put the catalog.json and bundle files somewhere?

hax0r31337 commented 11 months ago

You need game asset version instead of game version

Riunia commented 11 months ago

Haven't actually used BestHTTP2 before but given that it's a Unity Extension, I imagine I'd have to get the files into Unity somehow?

Tried using Frida but running into too many issues with the security around the app (root detection, emulator detection).

hax0r31337 commented 11 months ago

Haven't actually used BestHTTP2 before but given that it's a Unity Extension, I imagine I'd have to get the files into Unity somehow?

Tried using Frida but running into too many issues with the security around the app (root detection, emulator detection).

I coded a xposed module to hook its function with https://github.com/Rprop/And64InlineHook/, also for live debugging.
but i'll keep it private

09williamsad commented 11 months ago

You need game asset version instead of game version

Can you specify what that looks like and how to acquire it?

While I can get the full game files from my rooted device without issue, I have no familiarity with: mitmproxy, xposed and BestHTTP2. I can see many versions in the games files, but beyond trial and error I do not know which is the asset version.

Are you saying that network http request tracing is required to determine the asset version? I did something simular a while back when getting a retired games files, but that required older versions of android.

Would the version not be in the game files somewhere?

hax0r31337 commented 11 months ago

You need game asset version instead of game version

Can you specify what that looks like and how to acquire it?

While I can get the full game files from my rooted device without issue, I have no familiarity with: mitmproxy, xposed and BestHTTP2. I can see many versions in the games files, but beyond trial and error I do not know which is the asset version.

Are you saying that network http request tracing is required to determine the asset version? I did something simular a while back when getting a retired games files, but that required older versions of android.

Would the version not be in the game files somewhere?

It's like timestamp_randomString, for example the latest asset version for now is 1697082844_f3OrnfHInH1ixh1s

09williamsad commented 11 months ago

It's like timestamp_randomString, for example the latest asset version for now is 1697082844_f3OrnfHInH1ixh1s

Thanks, that is / is in these files: "jp.co.koeitecmo.resleriana\no_backup\ABCache\aas_catalog_versions.json" "jp.co.koeitecmo.resleriana\no_backup\ABCache\current_catalog.json" "jp.co.koeitecmo.resleriana\no_backup\ABCache\content_catalogs\1697082844_f3OrnfHInH1ixh1s_catalog.json"

I have made the base url variable const BASE_URL = "https://asset.resleriana.jp/asset/1697082844_f3OrnfHInH1ixh1s/Android/" I double checked and that is the same asset version in the current game files.

I still get same error panic: invalid character '<' looking for beginning of value goroutine 1 [running]: main.main() C:/Users/adamw/Downloads/resleriana_tools-main/main/main.go:27 +0x5e5 exit status 2

I am not sure what I am missing here. I double checked my VPN, its the same one that I used to download the files on my phone, and its still showing my location as Tokyo.

hax0r31337 commented 11 months ago

Try to open https://asset.resleriana.jp/asset/1697082844_f3OrnfHInH1ixh1s/Android/catalog.json in browser, as long as you can download this file, it should be no problem. Also double check you saved the updated code in IDE

09williamsad commented 11 months ago

I can open the file in my browser, with and without VPN. The main.go file has been saved with the current version.

I forgot to check the basics, my antivirus was blocking the running. However, it now partially works. It downloads a bunch of files to "C:\Users\adamw\AppData\Local\go-build" but gets the same error after a bit. Last write action is trim.txt with the value 1697749135.

09williamsad commented 11 months ago

I have just checked, the game must have updated in the last hour. As that is a newer version. I will get the new catalog/asset version later and try again.

hax0r31337 commented 11 months ago

I have just checked, the game must have updated in the last hour. As that is a newer version. I will get the new catalog/asset version later and try again.

I think the game seems not have any update at this time, it's 6 am in Japan now

09williamsad commented 11 months ago

I have done more attempts, checks, reinstalls, complete redownloads etc. Something else seems to be going on.

The current game version is 1.0.3 with asset version 1697082844_f3OrnfHInH1ixh1s. {"_serializationVersion":1,"_version":"1697082844_f3OrnfHInH1ixh1s","_appVersion":"1.0.3","_isBuiltin":false}

I set the base_url to that 'const BASE_URL = "https://asset.resleriana.jp/asset/1697082844_f3OrnfHInH1ixh1s/Android/"' I execute "go run ./main". It starts downloading files to "C:\Users\adamw\AppData\Local\go-build", list of files attached. go-build files.txt The last file it downloads before the error is trim.txt with the content "1697811932".

1697811932 looks like a version, but its not anywhere in the latest game files, I checked using UTF8 content searches to be sure.

sent00 commented 10 months ago

Hello. There have been several recent updates to the application, but the asset version has not changed since October 17. I am unable to get the latest data, is it possible that something has changed in the system?

Amarillys commented 4 months ago

I have done more attempts, checks, reinstalls, complete redownloads etc. Something else seems to be going on.

The current game version is 1.0.3 with asset version 1697082844_f3OrnfHInH1ixh1s. {"_serializationVersion":1,"_version":"1697082844_f3OrnfHInH1ixh1s","_appVersion":"1.0.3","_isBuiltin":false}

I set the base_url to that 'const BASE_URL = "https://asset.resleriana.jp/asset/1697082844_f3OrnfHInH1ixh1s/Android/"' I execute "go run ./main". It starts downloading files to "C:\Users\adamw\AppData\Local\go-build", list of files attached. go-build files.txt The last file it downloads before the error is trim.txt with the content "1697811932".

1697811932 looks like a version, but its not anywhere in the latest game files, I checked using UTF8 content searches to be sure.

Hello, I got into the same issue: panic: invalid character '<' looking for beginning of value. After a time of debugging, I found "%5C" string in url, is because of filepath.Join in fetch functions.

Try to modify filepath.Join to path.Join, and the problem will be solved.→_→

package main

import (
    "log"
    "net/http"
    "net/url"
    "path"
)

var client = &http.Client{
    Transport: &http.Transport{
        DisableKeepAlives: true,
        ForceAttemptHTTP2: true,
        Proxy:             http.ProxyFromEnvironment,
    },
}

func fetch(subpath string) (*http.Response, error) {
    u, err := url.Parse(BASE_URL)
    if err != nil {
        return nil, err
    }
    u.Path = path.Join(u.Path, fpath)
    req, err := http.NewRequest("GET", u.String(), nil)
    if err != nil {
        return nil, err
    }

    req.Header.Add("User-Agent", "BestHTTP/2 v2.5.4")

    return client.Do(req)
}