Adobe-GenP icon indicating copy to clipboard operation
Adobe-GenP copied to clipboard

Error allocating memory

Open ByteLabDev opened this issue 2 years ago • 4 comments

The tool seems to patch most of my files successfully, except for photoshop.exe (2023). Whenever it gets to that part, it crashes with the error:

Error allocating memory.

ByteLabDev avatar Feb 13 '23 10:02 ByteLabDev

image

ByteLabDev avatar Feb 13 '23 10:02 ByteLabDev

That's a 'known' bug. Patching process is extremely memory wasteful.

The whole file is read into memory. Converted to hex string and then a regular Expression search and replace is applied.

The hex string quirk is probably there because there maybe some problems when applying the regexp on the real binary data. As I know from Python that stupid string encoding / decoding thing is always I source for 'surprises'. In general I understood the idea and the examples however when it comes to 'real data' I mostly see that some unexpected byte mutations going on. Or maybe because there are limitation of the search string like it gets cut of after some /00 char.

I just decompiled the thing. Renamed the vars and functions and did some refracturing. As well as fully understood the code and saw it design weaknesses. But haven't the time and energy to do something about them and to improve it.

cw2k avatar Feb 13 '23 16:02 cw2k

Oh I understand. Sorry I misunderstood this repository

ByteLabDev avatar Feb 13 '23 19:02 ByteLabDev

@ByteLabDev Are you running the raw Adobe-GenP-3.0.au3 script or an executable?

If you're running the script directly, the problem might stem from the interpreter limiting the memory allocated to each script.

Compiling the script first as an executable (making sure to select x64) should solve it.

hexfactor avatar Oct 07 '23 07:10 hexfactor