Skip to content

Commit

Permalink
Fix issues with 3DS TMD downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
0x100 committed Aug 3, 2018
1 parent c5691f3 commit c66c9cd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
5 changes: 3 additions & 2 deletions USBHelperLauncher/Net/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class Proxy : IDisposable
new ContentEndpoint(),
new ApplicationEndpoint(),
new RegistrationEndpoint(),
new SiteEndpoint()
new SiteEndpoint(),
new WiiUShopEndpoint()
};

private ushort port;
Expand Down Expand Up @@ -59,7 +60,7 @@ private void FiddlerApplication_BeforeRequest(Session oS)
{
if (oS.HTTPMethodIs("CONNECT"))
{
if(oS.hostname.EndsWith("wiiuusbhelper.com"))
if (oS.hostname.EndsWith("wiiuusbhelper.com"))
{
oS.oFlags["X-ReplyWithTunnel"] = "Fake for HTTPS Tunnel";
}
Expand Down
26 changes: 26 additions & 0 deletions USBHelperLauncher/Net/WiiUShopEndpoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Fiddler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace USBHelperLauncher.Net
{
class WiiUShopEndpoint : Endpoint
{
public WiiUShopEndpoint() : base("ccs.cdn.wup.shop.nintendo.net") { }

protected WiiUShopEndpoint(string hostName) : base(hostName) { }

[Request("/*")]
public void Get(Session oS)
{
oS.utilCreateResponseAndBypassServer();
oS.oResponse.headers.SetStatus(307, "Redirect");
oS.oResponse["Location"] = "http://ccs.cdn.c.shop.nintendowifi.net" + oS.PathAndQuery;
Proxy.LogRequest(oS, this, "Redirecting to http://ccs.cdn.c.shop.nintendowifi.net" + oS.PathAndQuery);
}
}
}
1 change: 1 addition & 0 deletions USBHelperLauncher/USBHelperLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="Emulator\ZipPackage.cs" />
<Compile Include="Logger.cs" />
<Compile Include="ModuleInitInjector.cs" />
<Compile Include="Net\WiiUShopEndpoint.cs" />
<Compile Include="Net\SiteEndpoint.cs" />
<Compile Include="ProgressDialog.cs">
<SubType>Form</SubType>
Expand Down

0 comments on commit c66c9cd

Please sign in to comment.