ffrk-proxy icon indicating copy to clipboard operation
ffrk-proxy copied to clipboard

Different tactic

Open CodySwannGT opened this issue 6 years ago • 45 comments

I realize this isn't an issue, but with the AES encryption apparently being released soon, I don't think this is going to work. I definitely could be wrong, though.

I've circumvented this issue by adding scripts to the html files instead of writing the JSON feeds directly.

One script turns "easy mode" on and the other turns on an in-app drop tracker.

I also started a sub to discuss FFRK exploits

If you're interested in collaborating, let me know.

We could easily inject my scripts using your proxy.

CodySwannGT avatar Jan 29 '18 18:01 CodySwannGT

I had a similar idea a while ago, but discarded this, because I stopped playing the game. Where are the html files or is it just a single one? Isn't the encryption already active? The current workaround is to use an old version of the app.

ThauEx avatar Jan 30 '18 09:01 ThauEx

WE got an in-game announcement earlier on that says there is a mandatory update coming on 18/02. I can only assume that's it.

jdel avatar Jan 30 '18 13:01 jdel

Yeah. I saw that, but I don't think that's what we're thinking of.

iOS moved to using https for all feeds a while back and I think that's what this announcement is for.

That's easily worked around by installing a profile on the ios device, what I think they are moving to, eventually is encrypting their data feeds with AES encryption and maintaining the key inside the app and then decrypting the feeds inside the app.

Right now, it's just a single HTML file I'm writing to and it's diff/battle/index

On Tue, Jan 30, 2018 at 8:50 AM, Julien Del-Piccolo < [email protected]> wrote:

WE got an in-game announcement earlier on that says there is a mandatory update coming on 18/02. I can only assume that's it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ThauEx/ffrk-proxy/issues/106#issuecomment-361598639, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4O5K95rg3NY_MixOibjD6PLOoAcRgks5tPx4bgaJpZM4RxGbx .

-- Cody Swann - CEO, Gunner Technology T: 213.915.4083 | [email protected] | www.gunnertech.com

http://www.gunnertech.com/

CONFIDENTIALITY NOTICE: This email message, together with any documents, files and/or email messages attached to it, is intended for the sole use of the individual or entity to whom it is addressed, and may contain information that is legally privileged, confidential and restricted from disclosure. If you are not the intended recipient, or responsible for delivery to that person, you are hereby notified that any dissemination or copying of this communication is STRICTLY PROHIBITED. In such case please notify the sender by reply email and delete this message without reading, printing or saving.

CodySwannGT avatar Jan 30 '18 18:01 CodySwannGT

Ah didn't know, that they reverted the previous encryption. Let's see how the new one works. Where is the HTML file comming from? Is the game opening some url or is it downloading it and opening it locally? I think in both cases the proxy could inject scripts instead of modifying the data from the request.

ThauEx avatar Feb 01 '18 07:02 ThauEx

Yeah. That's exactly what I'm doing with my hack. I'm having Charles Proxy replace

with

It's basically the HTML file that loads all the scenes for a Battle and is loaded whenever you start a battle

On Thu, Feb 1, 2018 at 2:03 AM, ThauEx [email protected] wrote:

Ah didn't know, that they reverted the previous encryption. Let's see how the new one works. Where is the HTML file comming from? Is the game opening some url or is it downloading it and opening it locally? I think in both cases the proxy could inject scripts instead of modifying the data from the request.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ThauEx/ffrk-proxy/issues/106#issuecomment-362176955, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4O4ze1-mGXNLAmoHzKS0i0mQXCCvLks5tQWG2gaJpZM4RxGbx .

-- Cody Swann - CEO, Gunner Technology T: 213.915.4083 | [email protected] | www.gunnertech.com

http://www.gunnertech.com/

CONFIDENTIALITY NOTICE: This email message, together with any documents, files and/or email messages attached to it, is intended for the sole use of the individual or entity to whom it is addressed, and may contain information that is legally privileged, confidential and restricted from disclosure. If you are not the intended recipient, or responsible for delivery to that person, you are hereby notified that any dissemination or copying of this communication is STRICTLY PROHIBITED. In such case please notify the sender by reply email and delete this message without reading, printing or saving.

CodySwannGT avatar Feb 01 '18 16:02 CodySwannGT

Can you tell me the exact url of the index file? It should appear in your proxy, right? Do you have some example scripts, which you have used to inject the scripts?

ThauEx avatar Feb 01 '18 16:02 ThauEx

https://www.dropbox.com/s/3dz2iffsitzqjae/Screenshot%202018-02-01%2019.59.36.png?dl=0

https://gist.githubusercontent.com/CodySwannGT/44ba482ef5d227d05d8ee84424481d1b https://gist.githubusercontent.com/CodySwannGT/c75c66a2716856fb9e8c90ba65f0428b

CodySwannGT avatar Feb 02 '18 01:02 CodySwannGT

Hahahhaha - and they literally just blocked outbound connections to gisthub, so I'm just doing it all inline now:

On Thu, Feb 1, 2018 at 8:00 PM, Cody Swann [email protected] wrote:

https://www.dropbox.com/s/3dz2iffsitzqjae/Screenshot% 202018-02-01%2019.59.36.png?dl=0

-- Cody Swann - CEO, Gunner Technology T: 213.915.4083 <(213)%20915-4083> | [email protected] | www.gunnertech.com

http://www.gunnertech.com/ Check out our Live Show every Thursday at 1 pm EST on Facebook https://www.facebook.com/gunnertechnology, YouTube https://www.youtube.com/channel/UCjURDi2kurZOJFK1OY-QRHg and Periscope https://www.periscope.tv/gunnertech.

CONFIDENTIALITY NOTICE: This email message, together with any documents, files and/or email messages attached to it, is intended for the sole use of the individual or entity to whom it is addressed, and may contain information that is legally privileged, confidential and restricted from disclosure. If you are not the intended recipient, or responsible for delivery to that person, you are hereby notified that any dissemination or copying of this communication is STRICTLY PROHIBITED. In such case please notify the sender by reply email and delete this message without reading, printing or saving.

-- Cody Swann - CEO, Gunner Technology T: 213.915.4083 | [email protected] | www.gunnertech.com

http://www.gunnertech.com/ Check out our Live Show every Thursday at 1 pm EST on Facebook https://www.facebook.com/gunnertechnology, YouTube https://www.youtube.com/channel/UCjURDi2kurZOJFK1OY-QRHg and Periscope https://www.periscope.tv/gunnertech.

CONFIDENTIALITY NOTICE: This email message, together with any documents, files and/or email messages attached to it, is intended for the sole use of the individual or entity to whom it is addressed, and may contain information that is legally privileged, confidential and restricted from disclosure. If you are not the intended recipient, or responsible for delivery to that person, you are hereby notified that any dissemination or copying of this communication is STRICTLY PROHIBITED. In such case please notify the sender by reply email and delete this message without reading, printing or saving.

CodySwannGT avatar Feb 02 '18 01:02 CodySwannGT

Looks good to me. I think we have to extend the proxy here https://github.com/ThauEx/ffrk-proxy/blob/master/lib/ffrk-proxy.js#L57 and add a listener for the battle html file and trigger a new event. Then we would have to do something like this https://github.com/ThauEx/ffrk-proxy/blob/master/bin/app.js#L38 to apply all the filters.

What I don't like is the way how the original methods got replaced, because it could slow down older devices. Maybe it's better to add a custom property to FF.ns.battle.BattleInitData and check inside the setInterval for it, to avoid unnecessary function calls. I've seen, you've replaced multi function, but FF.ns.battle.BattleInitData should do it, right? Since it contains all the data for the battle.

ThauEx avatar Feb 02 '18 17:02 ThauEx

Hey man - sorry. I've been traveling.

Yes. I replaced multiple functions because I'm rewriting the functions - not the data.

I don't believe you can modify the global var you are referencing to the same effect as it creates an immutable copy. I may be wrong, but that was my experience

On Fri, Feb 2, 2018 at 1:18 PM, ThauEx [email protected] wrote:

Looks good to me. I think we have to extend the proxy here https://github.com/ThauEx/ffrk-proxy/blob/master/lib/ffrk-proxy.js#L57 and add a listener for the battle html file and trigger a new event. Then we would have to do something like this https://github.com/ThauEx/ffrk-proxy/blob/master/bin/app.js#L38 to apply all the filters.

What I don't like is the way how the original methods got replaced, because it could slow down older devices. Maybe it's better to add a custom property to FF.ns.battle.BattleInitData and check inside the setInterval for it, to avoid unnecessary function calls. I've seen, you've replaced multi function, but FF.ns.battle.BattleInitData should do it, right? Since it contains all the data for the battle.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ThauEx/ffrk-proxy/issues/106#issuecomment-362651015, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4Oy8UGAGJyDWHZ6AebUz6Ab3x2spIks5tQ0ZQgaJpZM4RxGbx .

-- Cody Swann - CEO, Gunner Technology T: 213.915.4083 | [email protected] | www.gunnertech.com

http://www.gunnertech.com/ Check out our Live Show every Thursday at 1 pm EST on Facebook https://www.facebook.com/gunnertechnology, YouTube https://www.youtube.com/channel/UCjURDi2kurZOJFK1OY-QRHg and Periscope https://www.periscope.tv/gunnertech.

CONFIDENTIALITY NOTICE: This email message, together with any documents, files and/or email messages attached to it, is intended for the sole use of the individual or entity to whom it is addressed, and may contain information that is legally privileged, confidential and restricted from disclosure. If you are not the intended recipient, or responsible for delivery to that person, you are hereby notified that any dissemination or copying of this communication is STRICTLY PROHIBITED. In such case please notify the sender by reply email and delete this message without reading, printing or saving.

CodySwannGT avatar Feb 07 '18 17:02 CodySwannGT

I prepared a feature branch for this, for now it looks promissing.

https://github.com/ThauEx/ffrk-proxy/pull/109

ThauEx avatar Feb 11 '18 13:02 ThauEx

Awesome!

On Sun, Feb 11, 2018 at 8:28 AM, ThauEx [email protected] wrote:

I prepared a feature branch for this, for now it looks promissing.

#109 https://github.com/ThauEx/ffrk-proxy/pull/109

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ThauEx/ffrk-proxy/issues/106#issuecomment-364751601, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4Ox6alQNNp7qNErOVFuX__1_aiAJpks5tTurogaJpZM4RxGbx .

-- Cody Swann - CEO, Gunner Technology T: 213.915.4083 | [email protected] | www.gunnertech.com

http://www.gunnertech.com/ Check out our Live Show every Thursday at 1 pm EST on Facebook https://www.facebook.com/gunnertechnology, YouTube https://www.youtube.com/channel/UCjURDi2kurZOJFK1OY-QRHg and Periscope https://www.periscope.tv/gunnertech.

CONFIDENTIALITY NOTICE: This email message, together with any documents, files and/or email messages attached to it, is intended for the sole use of the individual or entity to whom it is addressed, and may contain information that is legally privileged, confidential and restricted from disclosure. If you are not the intended recipient, or responsible for delivery to that person, you are hereby notified that any dissemination or copying of this communication is STRICTLY PROHIBITED. In such case please notify the sender by reply email and delete this message without reading, printing or saving.

CodySwannGT avatar Feb 11 '18 21:02 CodySwannGT

Will you update the master or add it in a new release? Will it be plug'n'play like before or do each person gotta add certain values to it? :)

But good job on checking that out. Maybe people will have luck on newest JP version too then?

Cissamannen avatar Feb 12 '18 16:02 Cissamannen

Well both, the master branch always has the latest "stable" features. My plan is to make it configurable, so use the current method or the inject method. Currently I'm trying to use browserify to transpile the filter files to browser ready scripts, so I can include them in the battle html file. The ww and jp are working similar, so I think it will work for both. (when it's ready)

ThauEx avatar Feb 13 '18 08:02 ThauEx

I pushed a few changes, but after starting the battle, the game throws an error. I think this is related to the browserified javascript file. I want to use browserify, because I want to avoid to keep files with duplicated logic. Maybe someone has time to play around with it 😄

ThauEx avatar Feb 14 '18 18:02 ThauEx

Short update: I got the first version working with buddy and supporters filter. I created a babel plugin which makes the filters compatibel. When someone want to test it, clone the branch, run npm install and to start it npm start.

ThauEx avatar Feb 20 '18 18:02 ThauEx

So does this work like normal with the current release? Or do we gotta set up a new plugin and so on?

Cissamannen avatar Feb 22 '18 09:02 Cissamannen

At the end you have to update ffrk-proxy, thats it.

ThauEx avatar Feb 22 '18 09:02 ThauEx

Could you perhaps write a 3 step guide how to use the updated branch? I see files are the same, but I guess theres more to it since one gotta run the npm commands etc? Where would you run it from, in what folder, from pip or whatnot :P Dont need a noob guide, just a quick 1,2,3 how to make it run normally, and Im guessing it will work on newest game versions, aswell as JP?

And can I also ask if this browsify thingy enabled will make it possible for more than 1 connection to the proxy at the time, as im sharing it with a few friends :)

Cissamannen avatar Feb 24 '18 09:02 Cissamannen

I created a pre release version here: https://github.com/ThauEx/ffrk-proxy/releases/tag/0.12.0-pre This is just an alpha version and the config is not working yet. Most filters are not working yet, but the buddy one does. I had some issues, so I was unable to test this release...

ThauEx avatar Feb 25 '18 18:02 ThauEx

Oh wow that was quick, amazing!

May I ask what do you mean by the config isn't working though? It seems to be working Android and all I had to do was open the new start batch file and open my game (I had every cheat effect active it seems), though it doesn't load on iOS (get the check your connection message + getting the cert isn't possible it seems). Is that what you meant by the config thing?

Dorzalty avatar Feb 25 '18 19:02 Dorzalty

Can say same here too as Dorzalty, that cert cannot be retrieved, but player stats work perfectly and some of the ailments that you start with. Might be changed ID's here and there from FFRK that have been changed, I dunno. But for now the 5.3.0 version with 0.11.0 works wonders till it goes past alpha stage :)

Cissamannen avatar Feb 25 '18 22:02 Cissamannen

The current pre release will use the default config settings, so if you change something buddy specific, it won't take affect. On linux/mac the files which are getting injected are rebuilt each time you start the proxy. This is currently not working on windows, so I included a pre generated file.

Can't you connect at all or clicking away these messages works?

ThauEx avatar Feb 26 '18 11:02 ThauEx

On iOS, no. I cannot connect at all, not even if I attempt click away the message. It will just come back over and over again. I set the settings to my IP address with the set to 5050, and then try to connect to the game. The CMD window only prompts me to connect to my IP:5051 at first and then in game I get the failure to get a connection message:

We're not able to connect. Please check your network settings and try again.

The CMD window then gives out this:

Proxying: GET http://init.gc.apple.com/WebObjects/GKInit.woa/wa/getBag?ix=1 Generating new TLS certificate for: ffrk.denagames.com

Dorzalty avatar Feb 26 '18 18:02 Dorzalty

I have built a docker container using the same method I've used until now and it crashes with the following:

2018-02-26T18:56:03.691783733Z Proxying: GET http://172.18.0.29:5051/js/inject.js
2018-02-26T18:56:03.741507167Z Injecting: File inject.js
2018-02-26T18:56:03.854118854Z Proxying: GET http://172.18.0.29:5051/js/buddy.js
2018-02-26T18:56:03.854188279Z Injecting: File buddy.js
2018-02-26T18:56:03.854122874Z fs.js:972
2018-02-26T18:56:03.854241203Z   binding.stat(pathModule.toNamespacedPath(path));
2018-02-26T18:56:03.854262998Z           ^
2018-02-26T18:56:03.854283960Z
2018-02-26T18:56:03.854304994Z Error: ENOENT: no such file or directory, stat '/ffrk/bin/../public/buddy.js'
2018-02-26T18:56:03.854326698Z     at Object.fs.statSync (fs.js:972:11)
2018-02-26T18:56:03.854347731Z     at Server.<anonymous> (/ffrk/bin/app.js:92:15)
2018-02-26T18:56:03.854369908Z     at Server.emit (events.js:127:13)
2018-02-26T18:56:03.854391010Z     at parserOnIncoming (_http_server.js:642:12)
2018-02-26T18:56:03.854412425Z     at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)

Inside of the container (using v0.12.0-pre), the directory /ffrk/public/ only contains inject.js. IS this normal ?

jdel avatar Feb 26 '18 19:02 jdel

My public folder contains buddy, enemy, inject, magicite, rounds and supporter, so I don't think it is normal yours only has inject.js in it. Maybe you need to redownload the file or you accidentally deleted something?

Dorzalty avatar Feb 26 '18 21:02 Dorzalty

Looks like babel cannot generate the files but there is no mention of it in the logs. I cannot enable debug because the configuration is skipped.

Edit: Even with debug mode, nothing in the logs

jdel avatar Feb 26 '18 22:02 jdel

Figured out: I was running node node ./bin/app.js instead of npm start, therefore skipping the babel build.

jdel avatar Feb 26 '18 22:02 jdel

Yes, for now it's generating these files on each npm start, because the config settings are hardcoded in these files. This is one of the downsides when transpiling the filters from nodejs to browser js. The pre release windows package contains these transpiled files, because the scripts for thats are not working on windows yet.

ThauEx avatar Feb 27 '18 09:02 ThauEx

Yes, I figured as much yesterday and got it working.

The docker container jdel/ffrk-proxy:v0.12.0-pre is available if somebody wants to run it for tests.

jdel avatar Feb 27 '18 19:02 jdel

Uploaded a new version with the same tag, but a new file (0.12.0-1). Mostly bugfixes, including:

  • Update root ca and server certificates (server certificates expired a while ago and root ca will expire soon, this means, you should reinstall the root ca)
  • Downgraded node-forge (this time in the lock file too)

https://github.com/ThauEx/ffrk-proxy/releases/tag/0.12.0-pre

ThauEx avatar Mar 01 '18 18:03 ThauEx

It this version by any chance containing an update for the pre-release for the iOS version?

Dorzalty avatar Mar 04 '18 14:03 Dorzalty

I don't know, but try it. Some certificates expired, maybe this was the issue.

ThauEx avatar Mar 04 '18 14:03 ThauEx

Well, I tried it, seems to be acting the same way as before and won't connect nor let me install the certificate.

Dorzalty avatar Mar 05 '18 04:03 Dorzalty

Yeah the certificate server is buggy, cant get it to respond either. But thats not such a big issue atm. What I'm noticing is the enemy stats seems to not be working like it should. They all have their base stats like defense etc. Player stats works perfectly, but damage is no longer maxed etc. Dunno if it's just some numbers thats gotta be shaved around in the enemy file or not?

But no a second note, the old 0.11.0 version works with the newest FFRK apk from playstore, so thats good news!

Cissamannen avatar Mar 12 '18 06:03 Cissamannen

The alpha is only modifying buddy stats, enemy support will follow soon. I don't know, why some of you have issues with installing the certificate...

ThauEx avatar Mar 12 '18 07:03 ThauEx

hi thau, was wondering if it was possible to change values to make my char stronger? i cannot clear magicite 5 star with current nodes.

can i modify stats? im not sure how (modify my own char, or support etc)

lebroze avatar Mar 29 '18 08:03 lebroze

This pre release and the current stable are already modifying the stats of your chars.

ThauEx avatar Mar 29 '18 08:03 ThauEx

oh sorry i mean like before the old build I could use instant kill and it would kill the monster instantly. and for example i would almost always do 9999/99999 but now i cant anymore like i do 1k damage to 5 star magicite since their defence is so high lol

lebroze avatar Mar 29 '18 09:03 lebroze

Changing enemy stats is currently missing, I have to debug something to reenable it again.

ThauEx avatar Mar 29 '18 13:03 ThauEx

I uploaded a new version (0.12.0-2). This has all filters except the round shortener enabled, it will also rebuild the injected files after each restart, which means config settings will get applied.

ThauEx avatar Apr 04 '18 17:04 ThauEx

Hey thau do u know how i would fix this error? & : File D:\FFrkProxy122\start.ps1 cannot be loaded. The file D:\FFrkProxy122\start.ps1 is not digitally signed. You cannot run this script on the current system.

lebroze avatar Apr 05 '18 03:04 lebroze

Wow great 😄 I will try to implement a workaround today.

ThauEx avatar Apr 05 '18 06:04 ThauEx

Uploaded a new release to fix that issue.

ThauEx avatar Apr 06 '18 15:04 ThauEx

Yo thau it works. Thx G

lebroze avatar Apr 07 '18 01:04 lebroze