Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-free committed Nov 8, 2022
1 parent 928c16b commit 649455c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# APrip GNUMakefile by Alex Free
CC=gcc
CFLAGS=-Wall -Werror -Ofast
VER=1.0
VER=1.0.1

aprip: clean
$(CC) $(CFLAGS) aprip.c -o aprip
Expand Down
23 changes: 18 additions & 5 deletions aprip.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdbool.h>
#include <string.h>

#define VER "1.0.1"
FILE *bin;
FILE *mem_dump_1;
FILE *mem_dump_2;
Expand Down Expand Up @@ -107,6 +108,12 @@ void bin_patch (const char **argv)
*/
fseek(bin, 0, SEEK_END);
bin_size = ftell(bin);
if(bin_size > 786432000) // 750MB max, no PSX software comes even close to such a size
{
printf("Error: The BIN file: %s exceeds the maximum filesize of 750MB in bin patch mode\n", argv[2]);
fclose(bin);
return;
}
fseek(bin, 0, SEEK_SET);
buf = (unsigned char *)malloc(bin_size * sizeof(unsigned char)); // Read entire BIN to memory for performance gain, I mean it's 2022 who doesn't have a free ~700MBs of RAM?!
unsigned char sectors[0x1000];
Expand Down Expand Up @@ -222,9 +229,11 @@ void gameshark_gen(const char **argv)

if(mem_dump_1_size != valid_mem_dump_size)
{
printf("Error: the original mem dump file: %s is not the expected size", argv[1]);
printf("Error: the original mem dump file: %s is not the expected size\n", argv[2]);
fclose(mem_dump_1);
free(buf);
if(mem_dump_1_size == 8388608)
printf("Do you have the 'Enable 8MB RAM' option enabled? Uncheck that option if so and make a new RAM dump\n");
return;
}

Expand Down Expand Up @@ -369,7 +378,9 @@ void sharkconv(const char **argv)

if(mem_dump_1_size != valid_mem_dump_size)
{
printf("Error: the old game ver mem dump file: %s is not the expected size", argv[3]);
printf("Error: the old game ver mem dump file: %s is not the expected size\n", argv[3]);
if(mem_dump_1_size == 8388608)
printf("Do you have the 'Enable 8MB RAM' option enabled? Uncheck that option if so and make a new RAM dump\n");
fclose(mem_dump_1);
free(mem_dump_1_buf);
return;
Expand All @@ -390,8 +401,10 @@ void sharkconv(const char **argv)

if(mem_dump_2_size != valid_mem_dump_size)
{
printf("Error: the new game ver mem dump file: %s is not the expected size", argv[4]);
fclose(mem_dump_1);
printf("Error: the new game ver mem dump file: %s is not the expected size\n", argv[4]);
if(mem_dump_2_size == 8388608)
printf("Do you have the 'Enable 8MB RAM' option enabled? Uncheck that option if so and make a new RAM dump\n");
fclose(mem_dump_1);
fclose(mem_dump_2);
free(mem_dump_1_buf);
free(mem_dump_2_buf);
Expand Down Expand Up @@ -453,7 +466,7 @@ int main (int argc, const char * argv[])
{
current_fpos = 0; // Simulate position in file stream via an unsigned char array
valid_mem_dump_size = 0x200000; // The exact file size generated when dumping RAM in the DuckStation emulator.
printf("PSX Anti-Piracy Ripper (APrip) v1.0\nBy Alex Free (C)2022\n----------------------------------------\nRest In Pieces PSX Anti-Piracy Detection\n----------------------------------------\n");
printf("PSX Anti-Piracy Ripper (APrip) v%s\nBy Alex Free (C)2022\n----------------------------------------\nRest In Pieces PSX Anti-Piracy Detection\n----------------------------------------\n", VER);

if(argc == 3)
{
Expand Down
Binary file added images/duckstation-ram-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ <h2 id="links">Links</h2>
<li><a href="https://alex-free.github.io/tonyhax-international">Tonyhax International</a></li>
</ul>
<h2 id="downloads">Downloads</h2>
<h3 id="version-1.0.1-1182022">Version 1.0.1 (11/8/2022)</h3>
<ul>
<li><a href="https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-windows_x86.zip">aprip-1.0.1-windows-x86</a> <em>For Windows 95 OSR 2.5 Or Newer (32-bit Windows)</em></li>
<li><a href="https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-windows_x86_64.zip">aprip-1.0.1-windows-x86_64</a> <em>For 64-bit Windows</em></li>
<li><a href="https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-linux_x86_static.zip">aprip-1.0.1-linux-x86</a> <em>For x86 Linux Distros</em></li>
<li><a href="https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0-linux_x86_64_static.zip">aprip-1.0.1-linux-x86_64</a> <em>For x86_64 Linux Distros</em></li>
<li><a href="https://github.com/alex-free/aprip/archive/refs/tags/v1.0.1.zip">aprip-1.0.1-source</a></li>
</ul>
<p>Changes:</p>
<ul>
<li><p>Limited file size max for bin patch mode to 750MB (sanity check, no actual PSX software is even close to this).</p></li>
<li><p>Added info on DuckStation 8 MB RAM setting (must be left unchecked). APrip also warns you if you try to give it an 8MB RAM dump now after the filesize mismatch error explaining what happened.</p></li>
</ul>
<h3 id="version-1.0-1142022">Version 1.0 (11/4/2022)</h3>
<ul>
<li><a href="https://github.com/alex-free/aprip/releases/download/v1.0/aprip-1.0-windows_x86.zip">aprip-1.0-windows-x86</a> <em>For Windows 95 OSR 2.5 Or Newer (32-bit Windows)</em></li>
Expand Down Expand Up @@ -211,6 +224,10 @@ <h2 id="generating-gameshark-codes">Generating GameShark Codes</h2>
<figure>
<img src="images/duckstation-settings.png" alt="Duckstation settings" /><figcaption aria-hidden="true">Duckstation settings</figcaption>
</figure>
<p>Also, ensure that the <em>Enable 8MB RAM</em> option is <strong>left untouched</strong> as shown in the image below:</p>
<figure>
<img src="images/duckstation-ram-settings.png" alt="Duckstation RAM settings" /><figcaption aria-hidden="true">Duckstation RAM settings</figcaption>
</figure>
<p>Now you can generate some GameShark codes with APrip:</p>
<ul>
<li><p>Rip or acquire a CD image of your desired game.</p></li>
Expand Down
17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ APrip is released as open source software under the 3-BSD license. Please see th

## Downloads

### Version 1.0.1 (11/8/2022)
* [aprip-1.0.1-windows-x86](https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-windows_x86.zip) _For Windows 95 OSR 2.5 Or Newer (32-bit Windows)_
* [aprip-1.0.1-windows-x86_64](https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-windows_x86_64.zip) _For 64-bit Windows_
* [aprip-1.0.1-linux-x86](https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-linux_x86_static.zip) _For x86 Linux Distros_
* [aprip-1.0.1-linux-x86_64](https://github.com/alex-free/aprip/releases/download/v1.0.1/aprip-1.0.1-linux_x86_64_static.zip) _For x86_64 Linux Distros_
* [aprip-1.0.1-source](https://github.com/alex-free/aprip/archive/refs/tags/v1.0.1.zip)

Changes:

* Limited file size max for bin patch mode to 750MB (sanity check, no actual PSX software is even close to this).

* Added info on DuckStation 8 MB RAM setting (must be left unchecked). APrip also warns you if you try to give it an 8MB RAM dump now after the filesize mismatch error explaining what happened.

### Version 1.0 (11/4/2022)
* [aprip-1.0-windows-x86](https://github.com/alex-free/aprip/releases/download/v1.0/aprip-1.0-windows_x86.zip) _For Windows 95 OSR 2.5 Or Newer (32-bit Windows)_
* [aprip-1.0-windows-x86_64](https://github.com/alex-free/aprip/releases/download/v1.0/aprip-1.0-windows_x86_64.zip) _For 64-bit Windows_
Expand Down Expand Up @@ -75,6 +88,10 @@ You'll need the download the [DuckStation](https://github.com/stenzek/duckstatio

![Duckstation settings](images/duckstation-settings.png)

Also, ensure that the _Enable 8MB RAM_ option is **left untouched** as shown in the image below:

![Duckstation RAM settings](images/duckstation-ram-settings.png)

Now you can generate some GameShark codes with APrip:

* Rip or acquire a CD image of your desired game.
Expand Down

0 comments on commit 649455c

Please sign in to comment.