Compare commits

..

28 Commits
1.6.0 ... main

Author SHA1 Message Date
Manu
ef1c90dbea Initial handling for Flag wondercards
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-11-08 22:54:36 +01:00
Manu
f8fb4485c0
Update README.md
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-10-28 02:50:59 +01:00
Manu
84ac05f77f Safely get clothing key
Some checks are pending
Linux / build (Release) (push) Waiting to run
MacOS / build (Release) (push) Waiting to run
Windows / build (Release) (push) Waiting to run
2025-10-27 18:47:36 +01:00
Manu
81cf6514f8 Compatibility with Legends ZA 2025-10-27 17:26:14 +01:00
Manu
e872275c99 Bump version
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-02-27 18:00:19 +01:00
Manu
91b3c89c63 Update text resources 2025-02-27 17:59:44 +01:00
Manu
900bd9c794 LGPE too cannot redeem wondercards with an ID over 2048
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-02-26 05:22:03 +01:00
Manu
1f23818043 Update workflows
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-02-17 21:59:03 +01:00
Manu
570e76aae8 Update to NET 9; update Readme 2025-02-17 21:22:34 +01:00
Manu
b2cccb5176 Fix WB7 FixedPID 2025-02-17 21:09:36 +01:00
Manu
fe1f9549a8 Update version 2024-10-10 03:18:30 +02:00
Manu
b683b27d06 Clean up comments and add some MgdbForm logs 2024-10-10 03:04:57 +02:00
Manu
65e690eda1
Increase Download Progress Prompt #5 2024-10-10 02:56:48 +02:00
子燏
b70c300df0 Increase Download Progress Prompt 2024-09-26 13:49:41 +08:00
Manu
eb0746a26d Simplify PokemonGift methods 2024-07-16 17:35:20 +02:00
Manu
c9f5783ce4 Update workflows 2024-06-10 15:50:34 +02:00
Manu
58874682c9 Update copyright 2024-06-10 15:46:13 +02:00
Manu
dddb3270f7 Update SCVIClothings.txt 2024-06-10 15:45:23 +02:00
Manu
3e925e0c6b Bump version 2024-01-02 19:01:57 +01:00
Manu
d0568155a9 Update text resources 2024-01-02 18:59:36 +01:00
Manu
c7f52d85ee Update species & items resources 2023-12-18 21:13:52 +01:00
Manu
37d1bcbc24
Update README.md 2023-12-13 20:52:14 +01:00
Manu
de3cdacba6 readme update 2023-12-04 16:04:31 +01:00
Manu
1f97759958 Remove PublishProfiles 2023-12-01 16:18:02 +01:00
Manu
cf6b480f90 Add MgdbForm 2023-12-01 16:13:36 +01:00
Manu
ea2547caf9 Better handle mgdb download 2023-12-01 15:04:29 +01:00
Manu098vm
095ff61113 Update to net8 2023-11-16 15:49:44 +01:00
Manu
bad20714dd Remove unused line 2023-10-14 01:51:13 +02:00
40 changed files with 2683 additions and 1048 deletions

View File

@ -1,41 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
# built on .NET Core.
# To learn how to migrate your existing application to .NET Core,
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
#
# To configure this workflow:
#
# 1. Configure environment variables
# GitHub sets default environment variables for every workflow run.
# Replace the variables relative to your project in the "env" section below.
#
# 2. Signing
# Generate a signing certificate in the Windows Application
# Packaging Project or add an existing signing certificate to the project.
# Next, use PowerShell to encode the .pfx file using Base64 encoding
# by running the following Powershell script to generate the output string:
#
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
#
# Open the output file, SigningCertificate_Encoded.txt, and copy the
# string inside. Then, add the string to the repo as a GitHub secret
# and name it "Base64_Encoded_Pfx."
# For more information on how to configure your signing certificate for
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
#
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
# See "Build the Windows Application Packaging project" below to see how the secret is used.
#
# For more information on GitHub Actions, refer to https://github.com/features/actions
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
name: Linux
on:
@ -52,35 +14,33 @@ jobs:
matrix:
configuration: [Release]
runs-on: ubuntu-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest
env:
Solution_Name: SwitchGiftDataManager.sln
Project_Path: SwitchGiftDataManager.CommandLine/SwitchGiftDataManager.CommandLine.csproj
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
# Create the app package by building and packaging
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build SwitchGiftDataManager.CommandLine/SwitchGiftDataManager.CommandLine.csproj --configuration Release --no-restore
- name: Test
run: dotnet test SwitchGiftDataManager.CommandLine/SwitchGiftDataManager.CommandLine.csproj --no-restore --verbosity normal
dotnet-version: 9.0.x
- name: Clean previous build artifacts
run: dotnet clean ${{ env.Project_Path }} --configuration ${{ matrix.configuration }}
- name: Install dependencies and build
run: |
dotnet restore ${{ env.Project_Path }}
dotnet build ${{ env.Project_Path }} --configuration ${{ matrix.configuration }} --no-restore
# Upload the artifact: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Linux CommandLine build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux.CommandLine.App
path: SwitchGiftDataManager.CommandLine/bin
path: SwitchGiftDataManager.CommandLine/bin

View File

@ -1,41 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
# built on .NET Core.
# To learn how to migrate your existing application to .NET Core,
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
#
# To configure this workflow:
#
# 1. Configure environment variables
# GitHub sets default environment variables for every workflow run.
# Replace the variables relative to your project in the "env" section below.
#
# 2. Signing
# Generate a signing certificate in the Windows Application
# Packaging Project or add an existing signing certificate to the project.
# Next, use PowerShell to encode the .pfx file using Base64 encoding
# by running the following Powershell script to generate the output string:
#
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
#
# Open the output file, SigningCertificate_Encoded.txt, and copy the
# string inside. Then, add the string to the repo as a GitHub secret
# and name it "Base64_Encoded_Pfx."
# For more information on how to configure your signing certificate for
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
#
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
# See "Build the Windows Application Packaging project" below to see how the secret is used.
#
# For more information on GitHub Actions, refer to https://github.com/features/actions
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
name: MacOS
on:
@ -52,35 +14,42 @@ jobs:
matrix:
configuration: [Release]
runs-on: macos-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: macos-latest
env:
Solution_Name: SwitchGiftDataManager.sln
Project_Path: SwitchGiftDataManager.CommandLine/SwitchGiftDataManager.CommandLine.csproj
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
# Create the app package by building and packaging
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build SwitchGiftDataManager.CommandLine/SwitchGiftDataManager.CommandLine.csproj --configuration Release --no-restore
- name: Test
run: dotnet test SwitchGiftDataManager.CommandLine/SwitchGiftDataManager.CommandLine.csproj --no-restore --verbosity normal
dotnet-version: 9.0.x
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install dependencies
run: dotnet restore ${{ env.Project_Path }}
- name: Build
run: dotnet build ${{ env.Project_Path }} --configuration ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test ${{ env.Project_Path }} --no-restore --verbosity normal
# Upload the artifact: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload MacOS CommandLine build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MacOS.CommandLine.App
path: SwitchGiftDataManager.CommandLine/bin
path: SwitchGiftDataManager.CommandLine/bin

View File

@ -1,41 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
# built on .NET Core.
# To learn how to migrate your existing application to .NET Core,
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
#
# To configure this workflow:
#
# 1. Configure environment variables
# GitHub sets default environment variables for every workflow run.
# Replace the variables relative to your project in the "env" section below.
#
# 2. Signing
# Generate a signing certificate in the Windows Application
# Packaging Project or add an existing signing certificate to the project.
# Next, use PowerShell to encode the .pfx file using Base64 encoding
# by running the following Powershell script to generate the output string:
#
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
#
# Open the output file, SigningCertificate_Encoded.txt, and copy the
# string inside. Then, add the string to the repo as a GitHub secret
# and name it "Base64_Encoded_Pfx."
# For more information on how to configure your signing certificate for
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
#
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
# See "Build the Windows Application Packaging project" below to see how the secret is used.
#
# For more information on GitHub Actions, refer to https://github.com/features/actions
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
name: Windows
on:
@ -52,52 +14,42 @@ jobs:
matrix:
configuration: [Release]
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: windows-latest
env:
Solution_Name: SwitchGiftDataManager.sln
Configuration: ${{ matrix.configuration }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
dotnet-version: 9.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Solution_Name /property:Configuration=Release
- name: Restore and build the application
run: |
msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
msbuild $env:Solution_Name /property:Configuration=$env:Configuration
# Upload the artifact: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload WinForms build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: WindowsForm.GUI.App
path: SwitchGiftDataManager.WinForm/bin
# Upload the artifact: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Windows CommandLine build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Windows.CommandLine.App
path: SwitchGiftDataManager.CommandLine/bin
path: SwitchGiftDataManager.CommandLine/bin

5
.gitignore vendored
View File

@ -3,5 +3,8 @@
.vscode
**/bin
**/obj
**/PublishProfiles
**.user
**.config
**.config
**.pubxml
**.pubxml.user

View File

@ -2,74 +2,75 @@
![immagine](https://github.com/Manu098vm/Switch-Gift-Data-Manager/assets/52102823/2c327c72-d34a-41c2-b912-fe290ea00446)
## About
This tool aims to make past Mystery Gift event contents back again in all the Pokémon games for Nintendo Switch.
Since those games won't allow event injection in the SAV file, this tool creates a forged BCAT package, injectable with homebrews like [JKSV](https://github.com/J-D-K/JKSV/releases).
This allows wondercards to be redeemed through the In-Game Mystery Gift Menu. The use of this tool does not involve hacking the game ROM nor hacking the game SAV.
This tool aims to bring back past Mystery Gift event content in all Pokémon games for Nintendo Switch.
Since these games don't allow event injection in the save file, this tool creates a forged BCAT package, which can be injected using homebrew tools like [JKSV](https://github.com/J-D-K/JKSV/releases).
This allows wondercards to be redeemed through the in-game Mystery Gift menu. The use of this tool does not involve hacking the game ROM or modifying the game save file.
### Compatible files
* Let's Go Pikachu and Let's Go Eevee wondercard full files (.wb7full)
* Sword and Shield wondercard files (.wc8)
* Brilliant Diamond and Shining Pearl wondercard files (.wb8)
* Legends Arceus wondercard files (.wa8)
* Scarlet & Violet wondercard files (.wc9)
* BCAT wondercard files, either with mutiple or single wondercards (no file format extension)
* Scarlet & Violet wondercard files (.wc9)
* Legends Z-A wondercard files (.wa9)
* BCAT wondercard files, containing either multiple or single wondercards (no file format extension)
### Compatible games
* Pokémon Let's Go Pikachu and Eevee
* Pokémon Sword and Shield
* Pokémon Brilliant Diamond and Shining Pearl
* Pokémon Legends Arceus
* Pokémon Scarlet and Violet
* Pokémon Scarlet and Violet
* Pokémon Legends Z-A
## Disclosure
Neither I nor the Project Pokémon staff takes any responsibility for possible adverse outcomes or bans due to the use of this tool. Use at your own discretion.
Neither I nor the Project Pokémon staff take any responsibility for possible adverse outcomes or bans resulting from the use of this tool. Use it at your own discretion.
**N.B:** Some BCAT files contain sensible console-specific informations, which you should keep safe. Don't share your BCAT to others!
**N.B.:** Some BCAT files contain sensitive console-specific information that you should keep secure. Do not share your BCAT with others!
## Usage
This paragraph refers to the Windows Form app. The Command Line app usage is similar and should be fairly intuitive.
* Ensure you have the required [.NET 7.0 Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) correctly installed
* Dump your game's BCAT with [JKSV](https://github.com/J-D-K/JKSV/releases) and keep some copies somewhere safe
* Open the tool and select your game of choice
* Import wondercard files of your choice (by drag & drop or by clicking the `Open Files` button)
* Eventually edit the wondercard id (WCID) if you have duplicated WCs and click `Apply`
* Click the `Save as BCAT Package` button and browse to your dumped BCAT
* A folder called "Forged_BCAT_{Game}" should appear next to your dumped BCAT
* Restore the Forged Bcat with JKSV
* To redeem the old fashion events, open your game -> Menu -> Mystery Gift -> redeem via Internet
* When you're done, restore your original BCAT package with JKSV (not doing so may cause sync issues)
This section refers to the Windows Form app. The Command Line app usage is similar and should be fairly intuitive.
* Ensure you have the required [.NET 9.0 Desktop Runtime](https://dotnet.microsoft.com/it-it/download/dotnet/9.0) installed correctly.
* Dump your game's BCAT with [JKSV](https://github.com/J-D-K/JKSV/releases) and keep some copies in a safe place.
* Open the tool and select your game of choice.
* Import the wondercard files of your choice (by drag & drop or by clicking the `Open Files` button).
* Optionally, edit the wondercard ID (WCID) if you have duplicate WCs, then click `Apply`.
* Click the `Save as BCAT Package` button and browse to your dumped BCAT.
* A folder called "Forged_BCAT_{Game}" should appear next to your dumped BCAT.
* Restore the forged BCAT using JKSV.
* To redeem the old event gifts, open your game -> Menu -> Mystery Gift -> Redeem via Internet.
* When you're done, restore your original BCAT package with JKSV (not doing so may cause sync issues).
**N.B**: BCAT Sync usually occurs between 12:00 AM (UTC) and 01:00 AM (UTC). I suggest to not follow this procedure during that timeframe to avoid a desync.
**N.B.:** BCAT sync usually occurs between 12:00 AM (UTC) and 01:00 AM (UTC). I recommend avoiding this procedure during that timeframe to prevent desynchronization.
If you experience a desync, follow one of these methods to resync:
* Open JKSV, select BCAT, hover over your game and press X to open the menu, then click `Reset Save Data`.
* Download the latest BCAT for your game from my [bcat_updates](https://github.com/Manu098vm/bcat_updates) repo or from [citrusbolt](https://github.com/citrusbolt)'s [website](http://citrusbolt.net/bcat/) and add the missing files to your dumped BCAT, then restore it with JKSV.
* Open JKSV, select BCAT, hover over your game, press X to open the menu, then click `Reset Save Data`.
* Download the latest BCAT for your game from [citrusbolt](https://github.com/citrusbolt)'s [website](http://citrusbolt.net/bcat/) and add the missing files to your dumped BCAT, then restore it with JKSV.
## Support/Troubleshooting
If you find any bug or you need support, please write in the [relevant topic on the Project Pokémon forums](https://projectpokemon.org/home/forums/topic/62491-switch-gift-data-manager-import-wondercards-into-switch-games-by-faking-bcat-packages/).
Alternatively, feel free to contact me in my [Discord server](https://discord.gg/yWveAjKbKt).
If you find any bugs or need support, please post in the [relevant topic on the Project Pokémon forums](https://projectpokemon.org/home/forums/topic/62491-switch-gift-data-manager-import-wondercards-into-switch-games-by-faking-bcat-packages/).
Alternatively, feel free to contact me on my [Discord server](https://discord.gg/yWveAjKbKt).
[<img src="https://canary.discordapp.com/api/guilds/693083823197519873/widget.png?style=banner2">](https://discord.gg/yWveAjKbKt)
## Building
* All the Switch Gift Data Manager projects require .NET 7.0.
* .WinForm is a Windows Form application and can only be built in Windows Operating Systems.
* .Core and .CommandLine can be built in any platform OS.
* Use the Debug build configuration when editing or developing code related to the .WinForm project. Build as Release only once the code is finished.
* To build the projects, open the .sln file in the root directory with an IDE such as Visual Studio 2022, click `Build` -> `Build Solution`.
* All Switch Gift Data Manager projects require .NET 9.0.
* `.WinForm` is a Windows Form application and can only be built on Windows operating systems.
* `.Core` and `.CommandLine` can be built on any platform.
* Use the Debug build configuration when editing or developing code related to the `.WinForm` project. Build as Release only once the code is finalized.
* To build the projects, open the `.sln` file in the root directory with an IDE such as Visual Studio 2022, then click `Build` -> `Build Solution`.
The .CommandLine project is currently just a simple script that calls the .Core functionalities and can run on any popular OS. Feel free to improve it and/or submit a pull request if you'd like :-)
The `.CommandLine` project is currently just a simple script that calls the `.Core` functionalities and can run on any popular OS. Feel free to improve it and/or submit a pull request if you'd like :-)
## Credits
* [PNZeml](https://github.com/PNZeml) for the CRC-16/CCITT-FALSE with lookup table [implementation](https://gist.github.com/tijnkooijmans/10981093?permalink_comment_id=3996072#gistcomment-3996072)
* [kwsch](https://github.com/kwsch), [sora10pls](https://github.com/sora10pls) and all the [PKHeX](https://github.com/kwsch/PKHeX) and [pkNX](https://github.com/kwsch/pkNX) devs and contributors
for a lot of offsets and resources
* [PP-theSLAYER](https://github.com/PP-theSLAYER) and [pasqualenardiello](https://github.com/pasqualenardiello) for their researches on the Sword & Shield fashion block and on the Scarlet and Violet fashion block respectively
* All the Project Pokémon Staff and the [Event Gallery](https://github.com/projectpokemon/EventsGallery) contributors for their archival efforts that made this possible
* [PNZeml](https://github.com/PNZeml) for the CRC-16/CCITT-FALSE with lookup table [implementation](https://gist.github.com/tijnkooijmans/10981093?permalink_comment_id=3996072#gistcomment-3996072).
* [kwsch](https://github.com/kwsch), [sora10pls](https://github.com/sora10pls), and all the [PKHeX](https://github.com/kwsch/PKHeX) and [pkNX](https://github.com/kwsch/pkNX) developers and contributors for various offsets and resources.
* [PP-theSLAYER](https://github.com/PP-theSLAYER) and [pasqualenardiello](https://github.com/pasqualenardiello) for their research on the Sword & Shield fashion block and the Scarlet & Violet fashion block, respectively.
* All the Project Pokémon staff and the [Event Gallery](https://github.com/projectpokemon/EventsGallery) contributors for their archival efforts that made this project possible.
## License
![gplv3-with-text-136x68](https://user-images.githubusercontent.com/52102823/199572700-4e02ed70-74ef-4d67-991e-3168d93aac0d.png)
Copyright © 2023 Manu098vm
Copyright © 2025 Manu098vm
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -17,11 +17,12 @@ public static class Program
$"2 - SWSH{Environment.NewLine}" +
$"3 - BDSP{Environment.NewLine}" +
$"4 - PLA{Environment.NewLine}" +
$"5 - SCVI";
$"5 - SCVI{Environment.NewLine}" +
$"6 - ZA";
Log(msg);
Games game = (Games)int.Parse(Console.ReadLine()!);
if (game is Games.None || game > Games.SCVI)
if (game is Games.None || game > Games.ZA)
{
Log("Invalid input. Aborted.");
Console.ReadKey();

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net7.0\linux-x64\publish\linux-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-08-14T11:07:02.3531810Z;True|2023-08-14T13:06:52.0751528+02:00;True|2023-06-06T22:09:41.5267582+02:00;True|2023-04-30T17:57:44.3876690+02:00;True|2023-04-10T17:40:35.1800594+02:00;True|2023-01-28T16:02:21.7075281+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-01-28T14:55:36.8109882Z;True|2023-01-28T15:48:22.9284343+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net7.0\osx-x64\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-08-14T11:05:42.5425714Z;True|2023-08-14T13:05:32.4788643+02:00;True|2023-06-06T22:11:28.7924159+02:00;True|2023-04-30T17:56:58.4384691+02:00;True|2023-04-10T17:37:41.8202016+02:00;True|2023-01-28T16:02:13.7381611+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-01-28T14:58:16.5887032Z;True|2023-01-28T15:57:34.0451151+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net7.0\win-x64\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0</TargetFramework>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-08-14T11:04:24.9139762Z;True|2023-06-06T22:12:34.4117725+02:00;True|2023-04-30T17:55:35.6583516+02:00;True|2023-04-10T17:35:59.0886698+02:00;False|2023-04-10T17:35:45.4776987+02:00;True|2023-01-28T16:02:06.8383516+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-01-28T14:45:49.3435089Z;True|2023-01-23T20:03:47.7790063+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -2,11 +2,11 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Manu098vm</Authors>
<Copyright>Copyright (C) 2022 Manu098vm</Copyright>
<Copyright>Copyright (C) 2024 Manu098vm</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>pokemon; mystery gift; wondercard; reader; nintendo; bcat; event injection;</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>

View File

@ -7,7 +7,7 @@ namespace SwitchGiftDataManager.Core;
public class BCATManager
{
public const string Version = "1.6.0";
public const string Version = "1.9.0";
private const int FileNameOffset = 0x00;
private const int UnkOffset = 0x20;
@ -35,6 +35,7 @@ public class BCATManager
Games.BDSP => new WB8(data),
Games.PLA => new WA8(data),
Games.SCVI => new WC9(data),
Games.ZA => new WA9(data),
_ => throw new ArgumentOutOfRangeException(nameof(Game)),
};
}
@ -341,10 +342,12 @@ public class BCATManager
return Games.SWSH;
else if (data.Length % (int)Wondercard.GetSize(Games.BDSP) == 0)
return Games.BDSP;
else if (data.Length % (int)Wondercard.GetSize(Games.PLA) == 0 && data[Wondercard.GenOffset] != 0)
else if (data.Length % (int)Wondercard.GetSize(Games.PLA) == 0 && data[0x0F] != 0)
return Games.PLA;
else if (data.Length % (int)Wondercard.GetSize(Games.SCVI) == 0 && data[Wondercard.GenOffset] == 0)
else if (data.Length % (int)Wondercard.GetSize(Games.SCVI) == 0 && data[0x0F] == 0 && data[0x2C0] == 0)
return Games.SCVI;
else if (data.Length % (int)Wondercard.GetSize(Games.ZA) == 0 && data[0x2C0] != 0)
return Games.ZA;
else
return Games.None;
}
@ -358,6 +361,7 @@ public class BCATManager
Games.BDSP => "99",
Games.PLA => "normal",
Games.SCVI => "normal",
Games.ZA => "normal",
_ => throw new ArgumentOutOfRangeException(nameof(game)),
};
}
@ -370,6 +374,7 @@ public class BCATManager
Games.BDSP => "99",
Games.PLA => "distribution_internet",
Games.SCVI => "distribution_internet",
Games.ZA => "distribution_internet",
_ => throw new ArgumentOutOfRangeException(nameof(game)),
};
}

View File

@ -1,4 +1,5 @@
using Enums;
using System.Runtime.CompilerServices;
namespace SwitchGiftDataManager.Core;
@ -7,11 +8,11 @@ public class OtherGift
public object? Type { get; set; }
public ushort Item { get; set; }
public uint Quantity { get; set; }
public ushort Opt { get; set; }
public uint Opt { get; set; }
public string GetItemName() => GetItemName(Item, Type!, Opt);
public static string GetItemName(ushort id, object type, ushort opt = 0)
public static string GetItemName(ushort id, object type, uint opt = 0)
{
var str = "";
@ -98,7 +99,25 @@ public class OtherGift
else
str = ((GiftType9)type).ToString();
}
else if (type.GetType() == typeof(GiftType9A))
{
if ((GiftType9A)type is GiftType9A.Item or GiftType9A.Flag)
str = Properties.Resources.Items.Split(new String[] { "\n" }, StringSplitOptions.None)[id];
else if ((GiftType9A)type is GiftType9A.Clothing)
{
if (!Clothing9A.TryGetValue(opt, out str))
str = "Unknown Clothing Item";
}
else
{
str = ((GiftType9A)type).ToString();
}
}
return str;
}
private static Dictionary<uint, string> Clothing9A = new()
{
{ 0x2E1937, "Trench Coat and Pants Set (Beige)" },
};
}

View File

@ -13,26 +13,20 @@ public class PokemonGift
public string GetSpeciesName() => GetSpeciesName(Species);
public bool IsShiny()
public bool IsShiny() => ShinyType switch
{
if (ShinyType is ShinyType.ShinyForced)
return true;
else if (ShinyType is ShinyType.ShinyPossible && PID != 0 && TID != 0 && SID != 0)
return IsShiny(PID, TID, SID);
ShinyType.ShinyForced => true,
ShinyType.ShinyPossible => (PID != 0 && TID != 0 && SID != 0) && IsShiny(PID, TID, SID),
_ => false,
};
return false;
}
public static string GetSpeciesName(uint species) => Properties.Resources.Species.Split(["\n"], StringSplitOptions.None)[species];
public static string GetSpeciesName(uint species) => Properties.Resources.Species.Split(new string[] { "\n" }, StringSplitOptions.None)[species];
public static bool IsShiny(uint pid, uint tid, uint sid) => (sid != 0 || tid != 0) && (sid ^ tid ^ (pid >> 16) ^ (pid & 0xFFFF)) < 16;
public static bool IsShiny(uint pid, uint tid, uint sid) => sid != 0 || tid != 0 ? (sid ^ tid ^ (pid >> 16) ^ (pid & 0xFFFF)) < 16 : false;
public static bool IsTIDAbusePossible(uint tid, uint sid, PIDType type)
public static bool IsTIDAbusePossible(uint tid, uint sid, PIDType type) => type switch
{
if (type is PIDType.FixedPID)
if (tid == 0)
if (sid == 0)
return true;
return false;
}
PIDType.FixedPID => tid == 0 && sid == 0,
_ => false,
};
}

View File

@ -0,0 +1,142 @@
using System.Buffers.Binary;
using Enums;
namespace SwitchGiftDataManager.Core;
public class WA9 : Wondercard
{
private const int WondercardIDOffset = 0x08;
private const int FlagOffset = 0x10;
private const int GiftTypeOffset = 0x11;
private const int ItemOffset = 0x18;
private const int QuantityOffset = 0x1A;
private const int TIDOffset = 0x18;
private const int SIDOffset = 0x1A;
private const int PIDOffset = 0x24;
private const int FlagStringOffset = 0x28;
private const int FlagItemOffset = 0x6C;
private const int FlagItemQuantityOffset = 0x6E;
private const int SpeciesOffset = 0x270;
private const int ShinyTypeOffset = 0x278;
private const int ChecksumOffset = 0x2C0;
public WA9(ReadOnlySpan<byte> data) : base(data)
{
WCID = BinaryPrimitives.ReadUInt16LittleEndian(data[WondercardIDOffset..]);
IsRepeatable = (Data![FlagOffset] & 1) == 0;
Type = (GiftType9A)Data![GiftTypeOffset];
Content = Type switch
{
GiftType9A.Pokemon => GetPokemon(),
_ => GetItems(),
};
}
private PokemonGift GetPokemon()
{
var species = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(SpeciesOffset));
var pid = BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(PIDOffset));
var tid = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(TIDOffset));
var sid = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(SIDOffset));
var pidtype = (ShinyType9)Data![ShinyTypeOffset] switch
{
ShinyType9.ShinyLocked => PIDType.RandomPID,
ShinyType9.ShinyRandom => PIDType.RandomPID,
ShinyType9.ShinyStar => PIDType.FixedPID,
ShinyType9.ShinySquare => PIDType.FixedPID,
ShinyType9.Fixed => PIDType.FixedPID,
_ => throw new ArgumentOutOfRangeException(),
};
var shinytype = (ShinyType9)Data![ShinyTypeOffset] switch
{
ShinyType9.ShinyLocked => ShinyType.ShinyLocked,
ShinyType9.ShinyRandom => ShinyType.ShinyPossible,
ShinyType9.ShinyStar or ShinyType9.ShinySquare => ShinyType.ShinyForced,
ShinyType9.Fixed => PokemonGift.IsShiny(pid, tid, sid) ? ShinyType.ShinyForced :
PokemonGift.IsTIDAbusePossible(tid, sid, pidtype) ? ShinyType.ShinyTIDAbuse : ShinyType.ShinyLocked,
_ => throw new ArgumentOutOfRangeException(),
};
return new PokemonGift
{
Species = species,
PID = pid,
TID = tid,
SID = sid,
ShinyType = shinytype,
PIDType = pidtype,
};
}
private List<OtherGift> GetItems()
{
List<OtherGift> items = new();
for (int i = 0; i < MaxItemCount; i++)
{
ushort item = 0;
uint quantity = 0;
uint opt = 0;
var type = (GiftType9A)Type!;
if (type is GiftType9A.Clothing)
{
item = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
opt = BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
}
else
{
item = type is GiftType9A.Flag ? BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(FlagItemOffset + (0x04 * i))) :
BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
quantity = type is GiftType9A.Flag ? BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(FlagItemQuantityOffset + (0x04 * i))) :
BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(QuantityOffset + (0x04 * i)));
}
var gift = new OtherGift
{
Type = type,
Item = item,
Quantity = quantity,
Opt = opt,
};
if ((type is not GiftType9A.Clothing && gift.Item != ushort.MinValue) || (type is GiftType9A.Clothing && item != ushort.MaxValue))
items.Add(gift);
}
return items;
}
public override bool IsChecksumValid()
{
if (Data is not null)
{
var oldChecksum = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ChecksumOffset));
var span = Data.ToArray().AsSpan();
BinaryPrimitives.WriteUInt16LittleEndian(span[ChecksumOffset..], 0x0);
var newchecksum = ChecksumCalculator.CalcCcittFalse(span);
if (oldChecksum == newchecksum)
return true;
}
return false;
}
public override void UpdateChecksum()
{
BinaryPrimitives.WriteUInt16LittleEndian(Data.AsSpan(ChecksumOffset), 0x0);
var checksum = ChecksumCalculator.CalcCcittFalse(Data.AsSpan());
BinaryPrimitives.WriteUInt16LittleEndian(Data.AsSpan(ChecksumOffset), checksum);
}
public override void SetID(ushort wcid)
{
BinaryPrimitives.WriteUInt16LittleEndian(Data.AsSpan(WondercardIDOffset), wcid);
WCID = wcid;
UpdateChecksum();
}
public override void SetRepeatable(bool repeatable)
{
Data![FlagOffset] = (byte)((Data![FlagOffset] & ~1) | (repeatable ? 0 : 1));
IsRepeatable = repeatable;
UpdateChecksum();
}
}

View File

@ -14,7 +14,7 @@ public class WB7 : Wondercard
private const int SIDOffset = 0x272;
private const int SpeciesOffset = 0x28A;
private const int ShinyTypeOffset = 0x2AB;
private const int PIDOffset = 0xD4;
private const int PIDOffset = 0x2DC;
private const int ChecksumOffset = 0x202;
public WB7(ReadOnlySpan<byte> data) : base(data)

View File

@ -48,7 +48,6 @@ public class WC9 : Wondercard
var pid = BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(PIDOffset));
var tid = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(TIDOffset));
var sid = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(SIDOffset));
var test = (ShinyType9)Data![ShinyTypeOffset];
var pidtype = (ShinyType9)Data![ShinyTypeOffset] switch
{
ShinyType9.ShinyLocked => PIDType.RandomPID,

View File

@ -5,7 +5,6 @@ namespace SwitchGiftDataManager.Core;
public abstract class Wondercard
{
public static int GenOffset = 0x0F;
protected const int MaxItemCount = 6;
public Games Game { get; }
@ -22,8 +21,9 @@ public abstract class Wondercard
WondercardSize.WB7 => Games.LGPE,
WondercardSize.WC8 => Games.SWSH,
WondercardSize.WB8 => Games.BDSP,
WondercardSize.WA8 when data[GenOffset] != 0 => Games.PLA,
WondercardSize.WC9 when data[GenOffset] == 0 => Games.SCVI,
WondercardSize.WA8 when data[0x0F] != 0 => Games.PLA,
WondercardSize.WC9 when data[0x0F] == 0 && data[0x2C0] == 0 => Games.SCVI,
WondercardSize.WA9 when data[0x2C0] != 0 => Games.ZA,
_ => Games.None,
};
Data = data.ToArray();
@ -67,6 +67,7 @@ public abstract class Wondercard
Games.BDSP => WondercardSize.WB8,
Games.PLA => WondercardSize.WA8,
Games.SCVI => WondercardSize.WC9,
Games.ZA => WondercardSize.WA9,
_ => throw new ArgumentOutOfRangeException(nameof(game)),
};
}

View File

@ -8,6 +8,7 @@ public enum Games : int
BDSP = 3,
PLA = 4,
SCVI = 5,
ZA = 6,
}
public enum WCType
@ -23,6 +24,7 @@ public enum WondercardSize : ushort
WB8 = 0x2DC,
WA8 = 0x2C8,
WC9 = 0x2C8,
WA9 = 0x2C8,
}
public enum GiftType7 : byte
@ -71,6 +73,15 @@ public enum GiftType9 : byte
Clothing = 4,
}
public enum GiftType9A : byte
{
None = 0,
Pokemon = 1,
Item = 2,
Flag = 3,
Clothing = 4,
}
public enum PIDType
{
RandomPID,

View File

@ -2230,64 +2230,64 @@ TM168
TM169
TM170
TM171
TM172
TM173
TM174
TM175
TM176
TM177
TM178
TM179
TM180
TM181
TM182
TM183
TM184
TM185
TM186
TM187
TM188
TM189
TM190
TM191
TM192
TM193
TM194
TM195
TM196
TM197
TM198
TM199
TM200
TM201
TM202
TM203
TM204
TM205
TM206
TM207
TM208
TM209
TM210
TM211
TM212
TM213
TM214
TM215
TM216
TM217
TM218
TM219
TM220
TM221
TM222
TM223
TM224
TM225
TM226
TM227
TM228
TM229
@ -2479,4 +2479,157 @@ Morpeko Snack
Poltchageist Powder
Fresh-Start Mochi
Roto-Stick
Glimmering Charm
Glimmering Charm
Metal Alloy
Indigo Style Card
Oddish Leaf
Tentacool Stinger
Doduo Down
Seel Fur
Exeggcute Shell
Tyrogue Sweat
Rhyhorn Fang
Horsea Ink
Elekid Fur
Magby Hair
Lapras Teardrop
Porygon Fragment
Chinchou Sparks
Snubbull Hair
Skarmory Feather
Smeargle Paint
Plusle Fur
Minun Fur
Trapinch Shell
Beldum Claw
Cranidos Spike
Shieldon Claw
Blitzle Mane Hair
Drilbur Claw
Cottonee Fluff
Scraggy Sweat
Minccino Fur
Solosis Gel
Joltik Thread
Golett Shard
Espurr Fur
Inkay Ink
Pikipek Feather
Dewpider Thread
Comfey Flower
Minior Shell
Milcery Cream
Duraludon Tarnish
Articuno Treat
Zapdos Treat
Moltres Treat
Raikou Treat
Entei Treat
Suicune Treat
Lugia Treat
Ho-Oh Treat
Latias Treat
Latios Treat
Kyogre Treat
Groudon Treat
Rayquaza Treat
Cobalion Treat
Terrakion Treat
Virizion Treat
Reshiram Treat
Zekrom Treat
Kyurem Treat
Solgaleo Treat
Lunala Treat
Necrozma Treat
Kubfu Treat
Glastrier Treat
Spectrier Treat
Indigo Disk
Fiery Pick
Stellar Tera Shard
Mythical Pecha Berry
Blueberry Tablecloth
Blueberry Chairs
Synchro Machine
Meteorite
Scarlet Book
Violet Book
Briars Book
Seed of Mastery
Clefablite
Victreebelite
Starminite
Dragoninite
Meganiumite
Feraligite
Skarmorite
Froslassite
Emboarite
Excadrite
Scolipite
Scraftinite
Eelektrossite
Chandelurite
Chesnaughtite
Delphoxite
Greninjite
Pyroarite
Floettite
Malamarite
Barbaracite
Dragalgite
Hawluchanite
Zygardite
Drampanite
Falinksite
Key to Room 202
Super Lumiose Galette
Lab Key Card A
Lab Key Card B
Lab Key Card C
Pebble
Cherished Ring
Autographed Plush
Tasty Trash
Revitalizing Twig
Lidas Things
Mega Shard
Colorful Screw
Red Canari Plush
Red Canari Plush
Red Canari Plush
Gold Canari Plush
Gold Canari Plush
Gold Canari Plush
Pink Canari Plush
Pink Canari Plush
Pink Canari Plush
Green Canari Plush
Green Canari Plush
Green Canari Plush
Blue Canari Plush
Blue Canari Plush
Blue Canari Plush

View File

@ -8061,6 +8061,8 @@ Pika-Vee Case
Scarlet Case
Violet Case
@ -8071,9 +8073,7 @@ Pika-Vee Case
Neo-Kitakami Case

View File

@ -1,4 +1,4 @@
None
---
Bulbasaur
Ivysaur
Venusaur
@ -1011,8 +1011,16 @@ Clodsire
Annihilape
Ogerpon
Dipplin
Hydrapple
Okidogi
Munkidori
Fezandipiti
Gouging Fire
Raging Bolt
Iron Crown
Iron Boulder
Terapagos
Pecharunt
Archaludon
Poltchageist
Sinistcha

View File

@ -2,11 +2,11 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Manu098vm</Authors>
<Copyright>Copyright (C) 2022 Manu098vm</Copyright>
<Copyright>Copyright (C) 2024 Manu098vm</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>pokemon; mystery gift; wondercard; reader; nintendo; bcat; event injection;</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>

View File

@ -62,6 +62,7 @@ partial class MainWindow
ToolsToolStripMenu = new ToolStripMenuItem();
MenuItemMGDB = new ToolStripMenuItem();
toolTipRedemptionMethod = new ToolTip(components);
BtnZA = new Button();
GrpBCAT.SuspendLayout();
GrpContent.SuspendLayout();
ContextMenuStripWC.SuspendLayout();
@ -76,7 +77,7 @@ partial class MainWindow
BtnLGPE.FlatStyle = FlatStyle.Flat;
BtnLGPE.Location = new Point(5, 37);
BtnLGPE.Name = "BtnLGPE";
BtnLGPE.Size = new Size(136, 60);
BtnLGPE.Size = new Size(111, 60);
BtnLGPE.TabIndex = 0;
BtnLGPE.TabStop = false;
BtnLGPE.Text = "LGPE";
@ -89,9 +90,9 @@ partial class MainWindow
BtnSWSH.AccessibleName = "";
BtnSWSH.Cursor = Cursors.Hand;
BtnSWSH.FlatStyle = FlatStyle.Flat;
BtnSWSH.Location = new Point(147, 37);
BtnSWSH.Location = new Point(122, 37);
BtnSWSH.Name = "BtnSWSH";
BtnSWSH.Size = new Size(136, 60);
BtnSWSH.Size = new Size(111, 60);
BtnSWSH.TabIndex = 1;
BtnSWSH.TabStop = false;
BtnSWSH.Text = "SWSH";
@ -104,9 +105,9 @@ partial class MainWindow
BtnBDSP.AccessibleName = "";
BtnBDSP.Cursor = Cursors.Hand;
BtnBDSP.FlatStyle = FlatStyle.Flat;
BtnBDSP.Location = new Point(289, 37);
BtnBDSP.Location = new Point(239, 37);
BtnBDSP.Name = "BtnBDSP";
BtnBDSP.Size = new Size(136, 60);
BtnBDSP.Size = new Size(111, 60);
BtnBDSP.TabIndex = 2;
BtnBDSP.TabStop = false;
BtnBDSP.Text = "BDSP";
@ -119,9 +120,9 @@ partial class MainWindow
BtnSCVI.AccessibleName = "";
BtnSCVI.Cursor = Cursors.Hand;
BtnSCVI.FlatStyle = FlatStyle.Flat;
BtnSCVI.Location = new Point(573, 37);
BtnSCVI.Location = new Point(473, 37);
BtnSCVI.Name = "BtnSCVI";
BtnSCVI.Size = new Size(136, 60);
BtnSCVI.Size = new Size(111, 60);
BtnSCVI.TabIndex = 3;
BtnSCVI.TabStop = false;
BtnSCVI.Text = "SCVI";
@ -134,9 +135,9 @@ partial class MainWindow
BtnPLA.AccessibleName = "";
BtnPLA.Cursor = Cursors.Hand;
BtnPLA.FlatStyle = FlatStyle.Flat;
BtnPLA.Location = new Point(431, 37);
BtnPLA.Location = new Point(356, 37);
BtnPLA.Name = "BtnPLA";
BtnPLA.Size = new Size(136, 60);
BtnPLA.Size = new Size(111, 60);
BtnPLA.TabIndex = 4;
BtnPLA.TabStop = false;
BtnPLA.Text = "PLA";
@ -148,7 +149,6 @@ partial class MainWindow
ListBoxWC.AllowDrop = true;
ListBoxWC.DrawMode = DrawMode.OwnerDrawFixed;
ListBoxWC.FormattingEnabled = true;
ListBoxWC.ItemHeight = 20;
ListBoxWC.Location = new Point(7, 96);
ListBoxWC.Name = "ListBoxWC";
ListBoxWC.Size = new Size(214, 304);
@ -196,7 +196,7 @@ partial class MainWindow
GrpBCAT.Enabled = false;
GrpBCAT.Location = new Point(5, 103);
GrpBCAT.Name = "GrpBCAT";
GrpBCAT.Size = new Size(704, 409);
GrpBCAT.Size = new Size(696, 409);
GrpBCAT.TabIndex = 8;
GrpBCAT.TabStop = false;
GrpBCAT.Text = "BCAT Manager";
@ -404,7 +404,7 @@ partial class MainWindow
MenuStrip.Items.AddRange(new ToolStripItem[] { ToolsToolStripMenu });
MenuStrip.Location = new Point(0, 0);
MenuStrip.Name = "MenuStrip";
MenuStrip.Size = new Size(715, 28);
MenuStrip.Size = new Size(709, 28);
MenuStrip.TabIndex = 9;
MenuStrip.Text = "menuStrip1";
//
@ -432,12 +432,28 @@ partial class MainWindow
toolTipRedemptionMethod.ToolTipIcon = ToolTipIcon.Info;
toolTipRedemptionMethod.ToolTipTitle = "Redemption Date";
//
// BtnZA
//
BtnZA.AccessibleDescription = "";
BtnZA.AccessibleName = "";
BtnZA.Cursor = Cursors.Hand;
BtnZA.FlatStyle = FlatStyle.Flat;
BtnZA.Location = new Point(590, 37);
BtnZA.Name = "BtnZA";
BtnZA.Size = new Size(111, 60);
BtnZA.TabIndex = 10;
BtnZA.TabStop = false;
BtnZA.Text = "ZA";
BtnZA.UseVisualStyleBackColor = true;
BtnZA.Click += BtnZA_Click;
//
// MainWindow
//
AllowDrop = true;
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(715, 518);
ClientSize = new Size(709, 518);
Controls.Add(BtnZA);
Controls.Add(MenuStrip);
Controls.Add(GrpBCAT);
Controls.Add(BtnPLA);
@ -498,4 +514,5 @@ partial class MainWindow
private Label lblRedemptionMethod;
private ToolTip toolTipRedemptionMethod;
private ComboBox cmbRedemptionMethod;
private Button BtnZA;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
@ -48,7 +48,7 @@
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter

View File

@ -0,0 +1,66 @@
namespace SwitchGiftDataManager.WinForm
{
partial class MgdbForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MgdbForm));
lblMessage = new Label();
SuspendLayout();
//
// lblMessage
//
lblMessage.AutoSize = true;
lblMessage.Location = new Point(94, 9);
lblMessage.Name = "lblMessage";
lblMessage.Size = new Size(190, 20);
lblMessage.TabIndex = 0;
lblMessage.Text = "Downloading, please wait...";
//
// MgdbForm
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(392, 37);
ControlBox = false;
Controls.Add(lblMessage);
Icon = (Icon)resources.GetObject("$this.Icon");
MaximizeBox = false;
MinimizeBox = false;
Name = "MgdbForm";
ShowInTaskbar = false;
StartPosition = FormStartPosition.Manual;
Text = "Mystery Gift Database";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label lblMessage;
}
}

View File

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO.Compression;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SwitchGiftDataManager.WinForm;
public partial class MgdbForm : Form
{
public MgdbForm()
{
InitializeComponent();
this.Shown += (s, e) => Task.Run(async () => await DownloadRepoMGDB()).Wait();
}
private async Task DownloadRepoMGDB()
{
var url = "https://github.com/projectpokemon/EventsGallery/archive/refs/heads/master.zip";
using (var client = new HttpClient())
{
var path = Path.Combine(Environment.CurrentDirectory, "tmp");
var mgdbPath = Path.Combine(Environment.CurrentDirectory, "mgdb");
//Delete old residual files if exist
if (Directory.Exists(path))
Directory.Delete(path, true);
if (Directory.Exists(mgdbPath))
Directory.Delete(mgdbPath, true);
Directory.CreateDirectory(path);
var zipPath = Path.Combine(path, "tmp.zip");
using (var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead))
{
var totalBytes = response.Content.Headers.ContentLength ?? 0;
using (var content = await response.Content.ReadAsStreamAsync())
using (var stream = new FileStream(zipPath, FileMode.Create, FileAccess.Write, FileShare.None))
{
var buffer = new byte[8192];
int bytesRead;
long totalRead = 0;
while ((bytesRead = await content.ReadAsync(buffer, 0, buffer.Length)) > 0)
{
await stream.WriteAsync(buffer, 0, bytesRead);
totalRead += bytesRead;
if (totalBytes > 0)
{
double progressPercentage = (double)totalRead / totalBytes * 100;
lblMessage.Text = $"Download progress: {progressPercentage:F2}%";
}
}
}
}
lblMessage.Text = $"Extracting files...";
ZipFile.ExtractToDirectory(zipPath, path);
File.Delete(zipPath);
var tmpMgbdPath = Path.Combine(path, "EventsGallery-master");
lblMessage.Text = $"Cleaning up residual files...";
File.Delete(Path.Combine(tmpMgbdPath, ".gitignore"));
Directory.Delete(Path.Combine(tmpMgbdPath, "Extras"), true);
Directory.Delete(Path.Combine(tmpMgbdPath, "Unreleased"), true);
Directory.Delete(Path.Combine(tmpMgbdPath, "PKHeX Legality"), true);
var genPath = Path.Combine(tmpMgbdPath, "Released");
Directory.Delete(Path.Combine(genPath, "Gen 1"), true);
Directory.Delete(Path.Combine(genPath, "Gen 2"), true);
Directory.Delete(Path.Combine(genPath, "Gen 3"), true);
Directory.Delete(Path.Combine(genPath, "Gen 4"), true);
Directory.Delete(Path.Combine(genPath, "Gen 5"), true);
Directory.Delete(Path.Combine(genPath, "Gen 6"), true);
var gen7Path = Path.Combine(genPath, "Gen 7");
Directory.Delete(Path.Combine(gen7Path, "3DS"), true);
Directory.Delete(Path.Combine(Path.Combine(gen7Path, "Switch"), "Wondercard Records"), true);
var swshPath = Path.Combine(Path.Combine(genPath, "Gen 8"), "SwSh");
Directory.Delete(Path.Combine(swshPath, "Wild Area Events"), true);
var svPath = Path.Combine(genPath, "Gen 9", "SV");
Directory.Delete(Path.Combine(svPath, "Raid Events"), true);
Directory.Delete(Path.Combine(svPath, "Outbreak Events"), true);
Directory.Move(tmpMgbdPath, mgdbPath);
Directory.Delete(path, true);
this.FormClosed += (s, e) => MessageBox.Show($"The Mystery Gift Database has been downloaded in {mgdbPath}", "MGDB",
MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
this.Close();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net7.0-windows\publish\win-x86\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-08-14T11:01:52.2006498Z;True|2023-06-06T22:08:02.8282040+02:00;True|2023-04-30T17:53:05.5959766+02:00;False|2023-04-30T17:52:03.7561171+02:00;True|2023-04-30T17:51:26.5642099+02:00;False|2023-04-30T17:50:29.6287729+02:00;False|2023-04-30T17:49:48.8628113+02:00;False|2023-04-30T17:49:13.6423153+02:00;False|2023-04-30T17:49:07.1768896+02:00;True|2023-04-10T17:45:17.0563608+02:00;False|2023-04-10T17:45:05.3801595+02:00;True|2023-04-10T17:44:52.3050457+02:00;False|2023-04-10T17:43:42.2422643+02:00;False|2023-04-10T17:42:40.9947818+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net7.0-windows\win-x64\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0-windows</TargetFramework>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-08-14T19:28:20.2713749Z;True|2023-08-14T21:25:34.3082675+02:00;True|2023-08-14T21:25:27.1522351+02:00;True|2023-08-14T21:00:06.6523582+02:00;True|2023-08-14T20:58:07.2152740+02:00;True|2023-08-14T20:57:44.9836572+02:00;True|2023-08-14T13:02:48.6507319+02:00;True|2023-06-06T22:06:44.0906717+02:00;True|2023-04-30T17:47:33.6719153+02:00;False|2023-04-30T17:47:20.2017341+02:00;True|2023-04-10T17:33:26.3077827+02:00;False|2023-04-10T17:32:43.9169969+02:00;True|2023-01-28T16:01:40.5830936+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-01-28T14:44:59.9510590Z;True|2023-01-23T20:01:57.3824432+01:00;False|2023-01-23T20:00:42.5423966+01:00;True|2023-01-23T19:57:25.6949583+01:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net9.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
@ -10,7 +10,7 @@
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
<Authors>Manu098vm</Authors>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<Copyright>Copyright (C) 2022 Manu098vm</Copyright>
<Copyright>Copyright (C) 2024 Manu098vm</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>pokemon; mystery gift; wondercard; reader; nintendo; bcat; event injection;</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>