Download PDB using PInvoke#9
Conversation
Additionally, made the generic download method only be able to download from the Unity symbol server
70ca9d9 to
e20b416
Compare
|
Sorry for not backing to you before but i didn't merge and ignored this pr because to my mind there was just no specific reasons to merge as it was just a refactor of effectively an already working solution with no pros as i don't think the extra exe in a zip that is installed automatically by mod managers would change anything and that the TS filter was gonna trigger regardless due to the amount of native stuff this project is interacting with + your solution is using pinvokes which also trigger the filter anyway. But i'm fine with moving ahead with this solution since you also support pd_ and pdb files. I'm also fine if you wanna solve #12 on this pr too i'll be happy to merge it |
|
Okay, for #12 merged my The best thing I could come up with was adding a new property to Then in the |
|
|
||
| namespace FixPluginTypesSerialization.UnityPlayer.Structs.v5.v0 | ||
| { | ||
| public class IsFileCreatedParam : IIsFileCreatedParam |
There was a problem hiding this comment.
You don't have an ApplicableToUnityVersionsSince so any version below 2022.3.62 will fail, you also don't have another IsFileCreatedParam for versions startig from 2023 so those also will fail. Only 2022.3.62 will work correctly.
|
This one got merged a 'lil too quickly, I was proposing the Will scramble together another PR (draft this time) that fixes some of the missing implementations in this one. |

For a while Unity has been enforcing HTTPS on their symbol servers, which is a problem because during the patcher phase in BepInEx, HTTPS is not yet supported.
This was initially fixed by shipping an external executable which would download the PDB file. This is however an undesirable solution for a couple of reasons:
Process.StartandProcessStartInfoThis technique only supports Windows (and probably Wine/Proton, but not Linux or MacOS native games)A more elegant solution is to use PInvoke to use native system libraries to perform the download for us.
Windows
On Windows, we can leverage the
winhttp.dlllibrary to download the PDB files.winhttp.dllis used by BepInEx as the chainloader proxy anyways, so it's basically guaranteed to exist.This project only seems to support Windows anyways, so Linux/MacOS support can be ignored
Testing