Skip to content

Commit

Permalink
Add AppVeyor builds and fix small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
VitaSmith committed Dec 5, 2020
1 parent c7c7a6e commit ca227ec
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.d
*.db
*.dat
*.dec
*.dll
*.doc
*.exe
Expand Down
6 changes: 1 addition & 5 deletions .vs/cdecrypt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(AppVersion)' != ''">
<ClCompile>
<AdditionalOptions>/DGUST_TOOLS_VERSION=$(AppVersion) %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/DAPP_VERSION=$(AppVersion) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -123,7 +123,6 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Program Files (x86)\OpenSSL-Win32\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -142,7 +141,6 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Program Files\OpenSSL-Win64\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -164,7 +162,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Program Files (x86)\OpenSSL-Win32\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -186,7 +183,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Program Files\OpenSSL-Win64\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# cdecrypt

[![Build status](https://img.shields.io/appveyor/ci/VitaSmith/cdecrypt.svg?style=flat-square)](https://ci.appveyor.com/project/VitaSmith/cdecrypt)
[![Github stats](https://img.shields.io/github/downloads/VitaSmith/gust_tools/total.svg?style=flat-square)](https://github.com/VitaSmith/gust_tools/releases)
[![Latest release](https://img.shields.io/github/release-pre/VitaSmith/gust_tools?style=flat-square)](https://github.com/VitaSmith/gust_tools/releases)

A commandline utility that can be used to decrypt Wii U NUS content files.

This is a fork of fork of https://code.google.com/p/cdecrypt intended for modders,
This is a fork of https://code.google.com/p/cdecrypt intended for modders,
who want to explore or modify the content of the Wii U applications they own.

Unlike other clones, this version of cdecrypt has **no** external dependencies
such as OpenSSL libraries and whatnot. A single executable file is all you need.
2 changes: 1 addition & 1 deletion aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ int aes_setkey_dec(aes_context* ctx, const uint8_t* key, unsigned int keybits)

ctx->nr = cty.nr;

SK = cty.rk + cty.nr * 4;
SK = cty.rk + (uintptr_t)cty.nr * 4;

*RK++ = *SK++;
*RK++ = *SK++;
Expand Down
30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
image: Visual Studio 2019

skip_non_tags: true

environment:
PROJECT_NAME: cdecrypt
FRIENDLY_NAME: cdecrypt

build_script:
ps: |-
msbuild "$env:PROJECT_NAME.sln" /m /p:Configuration=Release /p:Platform=x86 /p:AppVersion=$env:APPVEYOR_REPO_TAG_NAME /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
after_build:
ps: |-
7z a "$env:PROJECT_NAME.zip" .\x86\Release\*.exe README.md LICENSE.txt
Get-FileHash "$env:PROJECT_NAME.zip" -Algorithm SHA256 | Format-List
artifacts:
- path: $(PROJECT_NAME).zip
name: $(FRIENDLY_NAME)

deploy:
release: $(APPVEYOR_REPO_TAG_NAME)
description: $(FRIENDLY_NAME) $(APPVEYOR_REPO_TAG_NAME)
provider: GitHub
auth_token:
secure: NJtYKU1LEV3Y13rBlM/EU93LwU7di/h2o/Sa0niABhIhFqD5Q2/jjbHYbS45IPhf
artifact: /.*\.zip/
draft: false
prerelease: false
4 changes: 2 additions & 2 deletions cdecrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static bool ExtractFileHash(FILE* in, uint64_t PartDataOffset, uint64_t FileOffs
goto out;
}

Size -= fwrite(decdata + soffset, sizeof(char), WriteSize, dst);
Size -= fwrite(decdata + soffset, sizeof(char), (size_t)WriteSize, dst);

Wrote += WriteSize;

Expand Down Expand Up @@ -328,7 +328,7 @@ static bool ExtractFile(FILE* in, uint64_t PartDataOffset, uint64_t FileOffset,

aes_crypt_cbc(&ctx, AES_DECRYPT, BLOCK_SIZE, IV, (const uint8_t*)(encdata), (uint8_t*)decdata);

Size -= fwrite(decdata + soffset, sizeof(char), WriteSize, dst);
Size -= fwrite(decdata + soffset, sizeof(char), (size_t)WriteSize, dst);

Wrote += WriteSize;

Expand Down

0 comments on commit ca227ec

Please sign in to comment.