Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-free committed Apr 2, 2024
1 parent d89233f commit 00b61ba
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 17 deletions.
38 changes: 38 additions & 0 deletions build.md
@@ -0,0 +1,38 @@

# Building From Source

In the source directory, you may execute any of the following:

`make deps-apt` - installs the build dependencies required to compile the program.

`make` - creates an executable for x86_64 Linux.

`make clean` - deletes only the generated executable file created by only executing `make`.

`make clean-build` - deletes the generated build directory in it's entirety.

`make all` - **generate all of the following:**

### For Windows 95 OSR 2.5 and above, Pentium CPU minimum (32 bit)

* Windows i686 static executable file
* Portable Windows i386 release .zip file

### For Windows x86_64 (64 bit)

* Windows x86_64 static executable file
* Portable Windows x86_64 release .zip file

### For Linux 3.2.0 and above, 386 CPU minimum (32 bit)

* Linux i386 static executable file
* Portable Linux i386 release .zip file
* Linux i386 release .deb file

### For Linux 3.2.0 and above, x86_64 (64 bit)

* Linux x86_64 static executable file
* Portable Linux x86_64 release .zip file
* Linux x86_64 release .deb file

All output is found in the build directory created in the source directory.
18 changes: 18 additions & 0 deletions changelog.md
@@ -1,5 +1,23 @@
# Changelog

## Version 1.0.3 (2/29/2024)

Changes:

* Now also available as a `.deb` package for x86 Linux systems.

* More helpful usage message when given no arguments.

* [libcrypt-patcher-v1.0.3-windows-x86](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-windows-x86.zip) _Portable Release For Windows 95 OSR 2.5 Or Newer (32-bit Windows)_
* [libcrypt-patcher-v1.0.3-windows-x86\_64](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-windows-x86_64.zip) _Portable Release For 64-bit Windows_
* [libcrypt-patcher-v1.0.3-linux-x86-static](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86-static.zip) _Portable Release For x86 Linux_
* [libcrypt-patcher-v1.0.3-linux-x86-static.deb](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86-static.deb) _Deb package file For x86 Linux_
* [libcrypt-patcher-v1.0.3-linux-x86\_64-static](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86_64-static.zip) _Portable Release For x86\_64 Linux_
* [libcrypt-patcher-v1.0.3-linux-x86\_64-static.deb](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86_64-static.deb) _Deb package file for x86_64 Linux_
* [libcrypt-patcher-v1.0.3-source](https://github.com/alex-free/libcrypt-patcher/archive/refs/tags/v1.0.3.zip)

[About Previous Versions](changelog.md)

## Version 1.0.2 (2/22/2024)

Changes:
Expand Down
2 changes: 1 addition & 1 deletion control-i386
@@ -1,5 +1,5 @@
Package: libcrypt-patcher
Version: 1.0.3
Version: 1.0.4
Maintainer: Alex Free
Architecture: i386
Homepage: https://alex-free.github.io/libcrypt-patcher
Expand Down
2 changes: 1 addition & 1 deletion control-x86_64
@@ -1,5 +1,5 @@
Package: libcrypt-patcher
Version: 1.0.3
Version: 1.0.4
Maintainer: Alex Free
Architecture: amd64
Homepage: https://alex-free.github.io/libcrypt-patcher
Expand Down
64 changes: 61 additions & 3 deletions lcp.c
Expand Up @@ -19,21 +19,77 @@ const unsigned char SLES[] = {
0x53, 0x4C, 0x45, 0x53, 0x5F // SLES_
};

#if defined WIN32 // system("pause"); sucks we can do better
#include <conio.h>

void pause()
{
printf("\nPress any key to continue...\n");
_getch();
}
#endif

void do_exit(unsigned char exit_code)
{
#if defined WIN32
pause();
#endif
exit(exit_code);
}

int main (int argc, const char * argv[])
{
unsigned int bin_size;
printf("LibCrypt Patcher %s By Alex Free (C)2023-2024 (3-BSD)\nhttps://alex-free.github.io/libcrypt-patcher\n\n", VERSION);

if(argc != 2) {
printf("incorrect number of arguments\n\nUsage:\n\nlcp <track 1 bin file of libcrypt protected game>\n");
return 1;
do_exit(1);
}

bin = fopen(argv[1], "rb+");

if(bin == NULL)
{
printf("Error: Can not open: %s\n", argv[1]);
return 1;
do_exit(1);
}

fseek(bin, 0, SEEK_END);
bin_size = ftell(bin);

if(bin_size < 0x930 * 25) // Minimum expected for correctness of detection functions below - 22-25
{
printf("Error: %s is too small to be a patchable track 01 bin file\n", argv[1]);
fclose(bin);
do_exit(1);
}
unsigned char psx_string[] = {
0x50, 0x4C, 0x41, 0x59, 0x53, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x20 // PLAYSTATION<space>
};

bool is_psx_string;
is_psx_string = true;

unsigned char check;

for(int i = 0; i < 12; i++)
{
fseek(bin, (0x9320 + i), SEEK_SET);
check = fgetc(bin);

if(check != psx_string[i])
{
is_psx_string = false;
}
}

if(!is_psx_string)
{
printf("Error: %s does not appear to be a PlayStation data track bin file.\n", argv[1]);
fclose(bin);
do_exit(1);
}

fseek(bin, (0xCA20 + 0x18), SEEK_SET);// 0x930 * 22 = Directory Record Sector + 0x18 to skip header

Expand Down Expand Up @@ -1452,8 +1508,10 @@ int main (int argc, const char * argv[])

else {
printf("Unknown game\n");
return(1);
fclose(bin);
do_exit(1);
}

fclose(bin);
do_exit(0);
}
35 changes: 24 additions & 11 deletions readme.md
Expand Up @@ -17,28 +17,41 @@ If you know of a game/revision this patcher does not yet support, can supply a b
* [Wanted Games](#wanted-games)
* [Credits](#credits)
* [License](#license)
* [Building From Source](build.md)

## Links

| [GitHub](https://github.com/alex-free/libcrypt-patcher) | [Homepage](https://alex-free.github.io/libcrypt-patcher) | [GBATemp Thread](https://gbatemp.net/threads/libcrypt-patcher-single-executable-capable-of-patching-222-psx-game-discs.642132/) |

## Downloads

### Version 1.0.3 (2/29/2024)
### Version 1.0.4 (4/1/2024)

Changes:

* Now also available as a `.deb` package for x86 Linux systems.
* Windows version now says "Press any key to continue..." before exiting (for drag 'n drop of file to patch).

* More helpful usage message when given no arguments.
* Fixed version string displayed by executable.

* [libcrypt-patcher-v1.0.3-windows-x86](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-windows-x86.zip) _Portable Release For Windows 95 OSR 2.5 Or Newer (32-bit Windows)_
* [libcrypt-patcher-v1.0.3-windows-x86\_64](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-windows-x86_64.zip) _Portable Release For 64-bit Windows_
* [libcrypt-patcher-v1.0.3-linux-x86-static](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86-static.zip) _Portable Release For x86 Linux_
* [libcrypt-patcher-v1.0.3-linux-x86-static.deb](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86-static.deb) _Deb package file For x86 Linux_
* [libcrypt-patcher-v1.0.3-linux-x86\_64-static](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86_64-static.zip) _Portable Release For x86\_64 Linux_
* [libcrypt-patcher-v1.0.3-linux-x86\_64-static.deb](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.3/libcrypt-patcher-v1.0.3-linux-x86_64-static.deb) _Deb package file for x86_64 Linux_
* [libcrypt-patcher-v1.0.3-source](https://github.com/alex-free/libcrypt-patcher/archive/refs/tags/v1.0.3.zip)
* Now utilizes my new [EzRe](https://github.com/alex-free/ezre) build system.

* Vastly improved detection of valid input files.

----------------------------------------------------

* [libcrypt-patcher-v1.0.4-windows-i686-static.zip](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.4/libcrypt-patcher-v1.0.4-windows-i686-static.zip) _Portable Release For Windows 95 OSR 2.5 and above, Pentium CPU minimum (32 bit)_

* [libcrypt-patcher-v1.0.4-windows-x86\_64-static.zip](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.4/libcrypt-patcher-v1.0.4-windows-x86_64-static.zip) _Portable Release For x86_64 Windows (64 bit)_

* [libcrypt-patcher-v1.0.4-linux-i386-static.zip](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.4/libcrypt-patcher-v1.0.4-linux-i386-static.zip) _Portable Release For Linux 3.2.0 and above, 386 CPU minimum (32 bit)_

* [libcrypt-patcher-v1.0.4-linux-i386-static.deb](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.4/libcrypt-patcher-v1.0.4-linux-i386-static.deb) _Deb package file For Linux 3.2.0 and above, 386 CPU minimum (32 bit)_

* [libcrypt-patcher-v1.0.4-linux-x86\_64-static.zip](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.4/libcrypt-patcher-v1.0.4-linux-x86_64-static.zip) _Portable Release For x86\_64 Linux 3.2.0 and above (64 bit)_

* [libcrypt-patcher-v1.0.4-linux-x86\_64-static.deb](https://github.com/alex-free/libcrypt-patcher/releases/download/v1.0.4/libcrypt-patcher-v1.0.4-linux-x86_64-static.deb) _Deb package file for x86_64 Linux 3.2.0 and above (64 bit)_

---------------------------------------

[About Previous Versions](changelog.md)

Expand Down Expand Up @@ -161,7 +174,7 @@ Alternatively you may start your terminal and run `lcp` with the first/only data

[Disneys Tarzan (Germany)](http://redump.org/disc/19124/)

[Disneys Tarzan (Italy)](http://redump.org/disc/28199/)
[Disneys Tarzan (Italy)](http://redump.org/disc/27824/)

[EA Sports Superbike 2000 (Europe) (En,Fr,De,Es,It,Sv)](http://redump.org/disc/26580/)

Expand Down
2 changes: 1 addition & 1 deletion variables.mk
Expand Up @@ -3,7 +3,7 @@
# Basename of all release files (.zip, .deb)
RELEASE_BASE_NAME=libcrypt-patcher
# Version number, passed as 'VERSION' string to $(SOURCE_FILES)
VERSION=v1.0.3
VERSION=v1.0.4
# Appeneded to end of release file name
LINUX_I386_RELEASE_NAME_SUFFIX=linux-i386-static
LINUX_X86_64_RELEASE_NAME_SUFFIX=linux-x86_64-static
Expand Down

0 comments on commit 00b61ba

Please sign in to comment.