Open Lisias opened 1 year ago
Quoting myself from Forum, just in case:
Well… That was a weird one, and one that got me worried for a couple days (and, so, I screwed up the scheduling).
Right now, A+ needs Firespitter on some of the parts. Yes, I know that there're replacements, but I would need to ask the user to install more than one add'ons to do the FS job - and yet, it will not be good enough (I know what I'm talking, replacing Firespitter on KAX wans't satisfactory). But most people forget to install dependencies anyway, and so I shove on every add'on of mine a WatchDog that barks on you everytime you fire up KSP missing dependencies my add'ons need, and while coding it into A+ I got this weird message on my KSP.log:
[ERR 12:27:47.935] Exception handling event onGameSceneSwitchRequested in class Startup:System.NullReferenceException: Object reference not set to an instance of an object at AirplanePlus.MonkeyPatching.Execute () [0x00000] in <filename unknown>:0 at AirplanePlus.Startup.OnGameSceneSwitchRequested (FromToAction`2 data) [0x00000] in <filename unknown>:0 at EventData`1[GameEvents+FromToAction`2[GameScenes,GameScenes]].Fire (FromToAction`2 data) [0x00000] in <filename unknown>:0
[EXC 12:27:47.941] NullReferenceException: Object reference not set to an instance of an object
AirplanePlus.MonkeyPatching.Execute ()
AirplanePlus.Startup.OnGameSceneSwitchRequested (FromToAction2 data) EventData
1[GameEvents+FromToAction2[GameScenes,GameScenes]].Fire (FromToAction
2 data)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
EventData1:Fire(FromToAction
2)
HighLogic:SetLoadSceneEventsAndFlags(GameScenes, Boolean)
HighLogic:LoadScene(GameScenes)
AHA!!!! I finally have positive and undeniable evidence that KSP is being Monkey Patched by our backs!! *
I'm not mad about the "feature" implemented, it appears to be good - but, hell, we need to be warned about the changes, damnit!!!. Silently patching things is what malware does, by God's sake!!
* EDIT: can't affirm that, unfortunately. After thinking on the problem, I concluded I may be biased due that traumatic event that initiated this Report. I can't prove that this is not a feature that I never stomped over yet by pure luck.
I used KDIFF3 on the affected KSP (1.4.3, by the way - they are Monkey Patching everything) with an old backup to see if the patching is being persisted on disk.
Apparently, they are not - the thing apparently is being downloaded and applied on every KSP boot.
This suggests we can block it using firewalls.
I transferred this to KSP-Recall, as now I have undeniable evidence this is something related to KSP itself. This doesn't means I will tackle this down on KSP-Recall (or that I ever will try), but KSP-Recall is the place where I'm consolidating KSP (mis)behaviours for future reference.
After thinking about, I concluded that no, this is not a hard evidence of Monkey Patching after all. It may be something on KSP that I never had seen before: Absence of evidence is not evidence of absence, in order to make such bold affirmation I would had to had screwed up an savegame in the exact way I did to check this user's report before, but I don't recall doing it before and, so, I don't have how to know if this is something that was always there or not.
To be more specific, I'm talking about this message:
It's happening while trying to open a savegame that by some reason throws up an Exception while being inspected - apparently, it's just it, KSP tries to open the data file, gets an Exception (any one, by any reason) and stupidly concludes "it's not compatible" and shows the message.
The user that reported the problem coming back today telling that his problem just vanished without they knowing how is still an evidence that suggests Monkey Patching, but it's not a positive and undeniable evidence about the message being something new, or even something else being patched on their rig (besides the suggestion being strong enough, see the next paragraph):
On the other hand, this TweakScale issue is:
And now I have evidences that Module Manager (Forum) is not yelling anymore when a Reflection Exception is detected on loading, allowing users to load KSP when TweakScale was prevented from being loaded due the bug on the KSP's Assembly Loader/Resolver that happens when something else borks on loading a dependency.
Hell. This is the KSP.log of a test session made on KSP 1.8.1 with (Forum) Module Manager 4.1.2 on the same circumstances. This was the very first Module Manager to yell (besides diagnosing it incorrectly) about it. KSP.log
There's something smelling here, but there's nothing I can do about it. Past Evidences. Mirror Page 1, Page 2.
https://github.com/TweakScale/TweakScale/issues/312
— — EDIT — —
The TweakScale#312 was finally diagnosed, and it's completely unrelated to this one.
Note to future readers: on Oct 1, I mentioned:
After thinking about, I concluded that no, this is not a hard evidence of Monkey Patching after all.
This DOES NOT RULES OUT Monkey Patching (look on the damned log, damnit - the words MonkeyPatching
is explicitly mentioned on the stack dump!).
This only means that I can't use this evidence as a HARD EVIDENCE (i.e., undeniable evidence or proof) of Monkey Patching because correlation is not causality:
So, this is not a proof - but it's still an evidence that should be used together other evidences that, so, may be used to conclude if we have or not Monkey Patching being downloaded from Kraken knows where by our backs.
See https://github.com/TweakScale/TweakScale/issues/312, in special, https://github.com/TweakScale/TweakScale/issues/312#issuecomment-1828819620 , for the reasons this theory is now slightly stronger than before.
Monkey Patching was completely ruled out on https://github.com/TweakScale/TweakScale/issues/312 .
See https://github.com/TweakScale/TweakScale/issues/312#issuecomment-1830246915 for details.
On the other hand, this post on Forum may still be explained by Monkey Patching.
Oukey. I found a Monkey Patching on KSP, and this freaking thing is screwing with me.
On 2022's Hallowing (more specifically, the weekend following it), my DLLs on A+ got screwed by the following problem:
That
AirplanePlus.MonkeyPatching
thingy? Not mine, don't have the slighest idea from what deepness of Hell this crapness came. I can only say that this prevented me from working on the DLL for the whole weekend.As long the clock marked midnight of Monday, the problem goes away.
I can only infer this was some kind of Easter Egg that some jerk though it could be a good idea to have hardcoded inside KSP without telling anyone about.
Also on Forum
I'm still thinking if I want to mess with this crap.