Registrarse

[Herramienta] [Tool]Make your ROM inaccessible to map editors

jiangzhengwenjz

Usuario mítico
About 1 month ago I started to learn programming and I've made this useless tool. The tool is written in C and it will make your ROM inaccessible to map editors. (a-map, meh, e-map, etc.)

Introduction:
Many players use a-map to view maps in-game so that they can go through some complicatedly-developed maps like caves in RUBY DESTINY3 - LOG quickly. Some hackers change the ROM info (by default POKEMON FIREBPRE, POKEMON EMERBPEE, POKEMON RUBYAXVE) to prevent it from happening, but Hackmew has written a tool called RHEA(ROM HEADER EDITOR ADVANCE) to change it so it's really easy for the player to change it back to default. Therefore I think we should use a new way to achieve the effect so I write this tool. (I regard the players as not being able to use hex editor.) It will also prevent people with low hacking skill from stealing tilesets from your ROM.

[tabla][fila][celda]Download link: [/celda][/fila]
[fila][celda]http://www.mediafire.com/download/pyr28y3g29y45iw/enc.exe[/celda][/fila][/tabla]

Result:


How to use:
1. Download the tool enc.exe;
2. Place your ROM in the same directory as enc.exe;
3. use "shift + right click", and open the command line prompt in that directory;
4. type "enc [ROM NAME] [VERSION]" and press "enter".
(For the [VERSION], 1=BPRE, 2=BPEE, 3=AXVE.

For example, I want to apply it on my firered ROM "pokehack.gba", then I should type:
Código:
enc pokehack.gba 1
Note:
I recommend you to apply it to your ROM right before publishing it and to keep a backup of it if you want to use the tool. BTW, I'm a newbie in programming and only know very few things, so if it has bugs, please report.

EDIT:
Source code for the program:
Código:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char * argv[])
{
    int times;
    const char filldata[] = {0x3, 0x4A, 0x80, 0, 0x89, 0, 0x80, 0x18, 0, 0x68, 9, 0x18, 8, 0x68, 0x70, 0x47};
    const long modptr[] = {0x55238 ,0x84a90, 0x53310};
    unsigned long bankptr[] = {0, 0};
    FILE * fileptr;
    if (argc < 3 || ((((times = atoi(argv[2])) != 1) && (times != 2)) && (times != 3)))
        printf("ERROR.\n");
    else
    {
    if ((fileptr = fopen(argv[1], "rb+")) == NULL)
        {
            fprintf(stderr, "Could not open %s for output.\n", argv[1]);
            exit(1);
        }
    fseek(fileptr, modptr[times-1], SEEK_SET);
    fwrite(filldata, sizeof(char), 16, fileptr);
    fseek(fileptr, (modptr[times-1] + 0x14), SEEK_SET);
    fread(bankptr, sizeof(unsigned long), 1, fileptr);
    fseek(fileptr, (modptr[times-1] + 0x10), SEEK_SET);
    fwrite(bankptr, sizeof(unsigned long), 2, fileptr);
    rewind(fileptr);
    fclose(fileptr);
    }
    printf("Press q to quit.\n");
    getchar();
    return 0;
}

EDIT2: some people may be interested in how the tool works, so i explain it here.
Source code for the modification of the function at 0x55238 in FR:
.thumb
.byte 3, 0x4a @the original "ldr"
lsl r0, r0, #2
lsl r1, r1, #2
add r0, r0, r2
ldr r0, [r0]
add r1, r1, r0
ldr r0, [r1]
bx lr
Then we just move the pointer of the map bank header table at 0x5524c to 0x55248. BINGO!
EDIT3: I forgot yesterday. We should also put 00 00 00 00 at 0x5524c which is also included in the tool.
 
Última edición por un moderador:

cosarara97

Dejad de cambiar de nick
Miembro de honor
I recommend you use the actual number of bytes instead of "sizeof(unsigned long)", since that could change its meaning depending on the compiler or architecture. Also, an explanation on what the tool is doing exactly (why are you writing this and that, here and there) would be nice.
Anyway, nice work!
 

jiangzhengwenjz

Usuario mítico
Re: Respuesta: [Tool]Make your ROM inaccessible to map editors

I recommend you use the actual number of bytes instead of "sizeof(unsigned long)", since that could change its meaning depending on the compiler or architecture.
Yes, I totally forgot that kind of thing.
Also, an explanation on what the tool is doing exactly (why are you writing this and that, here and there) would be nice.
Yes, that's true. I just rewrote the function which loads the map bank table. Source code and explanation has been added.
Anyway, nice work!
THX! :D
 

pikachu240

Junior C# Developer
i have a question. why AMAP,or any doesn't get the pointer adress to table maps like a game?
[sorry my bad english]
 

BluRose

chiste, chiste
i have a question. why AMAP,or any doesn't get the pointer adress to table maps like a game?
[sorry my bad english]
Puedes preguntar en español, creo que jiangzhengwenjz puede entender :D

Si te entiendo bastante bien, lo que ésta herramienta hace es mover la dirección del puntero a otro lugar. Lo mueve a 0x55248, 4 bytes antes del lugar donde originalmente estaba.

Si no contesté tu pregunta, lo siento~
 
Última edición:

jiangzhengwenjz

Usuario mítico
Re: Respuesta: [Tool]Make your ROM inaccessible to map editors

i have a question. why AMAP,or any doesn't get the pointer adress to table maps like a game?
[sorry my bad english]
I surely want to explain it in detail to you but it's ASM...
In short, A-map search for the data of ASM function to load the header table pointer (because it supports many languages and versions) while other editors don't.
 

pikachu240

Junior C# Developer
Según he entendido cambia el pointer que usa el ASM para encontrar la tabla no? entonces el juego que usa el ASM no podrá encontrarlo no?Porque si puede luego como lo hace?
 

jiangzhengwenjz

Usuario mítico
Re: Respuesta: [Tool]Make your ROM inaccessible to map editors

Según he entendido cambia el pointer que usa el ASM para encontrar la tabla no? entonces el juego que usa el ASM no podrá encontrarlo no?Porque si puede luego como lo hace?
As I've said, the tool bans both 2 kinds of map editors.
The first thing it does is to rewrite the ASM function to ban the A-map, and the second thing it does is to move the pointer of the map header pointer table to ban other map editors.
The 2 ways are not separate, as the function should be written appropriately since the pointer has been moved.
 
M

Miembro eliminado 28262

Invitado
You have reason is some useless, but is Terrifyingly brilliant!
some persons uses internal data to search private resources like scripts and other routines, graphics also..

By the way.. Good one!
 
Arriba