Compare commits

..

No commits in common. "master" and "v2.0" have entirely different histories.
master ... v2.0

18 changed files with 156 additions and 27061 deletions

View File

@ -1,7 +0,0 @@
language: c
script:
- make
#before_install:
# - sudo apt install libunistring-dev

View File

@ -1,23 +1,7 @@
CFLAGS=-std=c99 all: decode recode recode110 extractbmp makever fixbmpheader
all: decode recode extractbmp makever fixbmpheader
decode: decode:
recode: recode.c recode:
gcc recode.c -o recode -l unistring recode110:
translate: translate.c
gcc translate.c -o translate -l unistring
extractbmp: extractbmp:
makever: makever:
fixbmpheader: fixbmpheader:
clean:
rm -f fixbmpheader extractbmp recode decode makever
trans: PF090JPJPN.LNG PF110JPJPN.LNG PF090JPJPN_0047.LNG PF090JPJPN_0047_RU.LNG PF090JPJPN_RU.LNG
PF090JPJPN.LNG: translated.txt recode
./recode translated.txt PF090JPJPN.LNG
PF110JPJPN.LNG: translated_110.txt recode
./recode translated_110.txt PF110JPJPN.LNG
PF090JPJPN_0047.LNG: translated_0047.txt recode
./recode translated_0047.txt PF090JPJPN_0047.LNG
PF090JPJPN_0047_RU.LNG: translated_0047_ru.txt recode
./recode translated_0047_ru.txt PF090JPJPN_0047_RU.LNG
PF090JPJPN_RU.LNG: translated_ru.txt recode
./recode translated_ru.txt PF090JPJPN_RU.LNG

Binary file not shown.

Binary file not shown.

View File

@ -18,22 +18,17 @@ int main(int argc,char *argv[]) {
offset=0; offset=0;
fread(&offset, 2, 1, f); fread(&offset, 2, 1, f);
offset=offset*2+0x40; offset=offset*2+0x40;
/* next=0; next=0;
fread(&next, 2, 1, f); fread(&next, 2, 1, f);
next=next*2+0x40; next=next*2+0x40;
*/
ch=1; ch=1;
putchar('"'); putchar('"');
putchar(0); putchar(0);
fseek(f,offset,SEEK_SET); fseek(f,offset,SEEK_SET);
int ch1=1; while(offset<next-2) {
while(1) {
fread(&ch,1,1,f); fread(&ch,1,1,f);
fread(&ch1,1,1,f); offset++;
if(ch==0 && ch1==0)
break;
putchar(ch&255); putchar(ch&255);
putchar(ch1&255);
} }
putchar('"'); putchar('"');
putchar(0); putchar(0);

Binary file not shown.

View File

@ -1,24 +1,15 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistr.h>
#include <stdlib.h>
void readstring(FILE *f, char *p) { void readstring(FILE *f, char *p) {
char c; char c;
c=fgetc(f); c=fgetc(f);
if(feof(f)) return; if(c!='\"')
if(c!='\"') { puts("ERRRRRRRR");
puts("ERROR: mismatched quotes");
exit(1);
}
while((c=fgetc(f))!='"' && !feof(f)) while((c=fgetc(f))!='"' && !feof(f))
*p++=c; *p++=c;
*p++=0; *p++=0;
// c=fgetc(f); while((c=fgetc(f))!=10 && !feof(f));
if((c=fgetc(f))!=10 && !feof(f)) {
puts("ERROR: mismatched quotes");
exit(1);
}
} }
unsigned short crc16(const unsigned char *data, int len) { unsigned short crc16(const unsigned char *data, int len) {
@ -36,9 +27,7 @@ unsigned short crc16(const unsigned char *data, int len) {
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
char data[200000]; char data[200000];
char st[1024]; char st[10240];
short st_u16[1024];
char *infile="translated.txt",*outfile="PF090JPJPN.LNG";
FILE *f,*g; FILE *f,*g;
int i; int i;
unsigned *id=(unsigned *) data; unsigned *id=(unsigned *) data;
@ -59,55 +48,52 @@ int main(int argc,char *argv[]) {
id[14]=0xaaaaaaaa; id[14]=0xaaaaaaaa;
id[15]=0xaaaaaaaa; id[15]=0xaaaaaaaa;
if(argc>1) g=fopen("translated.txt","rb");
infile=argv[1]; f=fopen("PF090JPENG.LNG","rb");
if(argc>2)
outfile=argv[2];
g=fopen(infile,"rb");
int start=0x40; int start=0x40;
unsigned short *idx=(unsigned short *)(data+0x40); unsigned short *idx=(unsigned short *)(data+0x40);
short nstrings=0; fseek(f,0x40,SEEK_SET);
short nstrings;
int offset=0; int offset=0;
int next=0; int next=0;
short ch; short ch;
while(!feof(g)) { fread(&nstrings, 2, 1, f);
readstring(g,st);
// printf("%d %s\n",nstrings,st);
nstrings++;
}
nstrings+=2;
rewind(g);
nstrings=nstrings-3; nstrings=nstrings-3;
printf("Found %d strings\n",nstrings);
unsigned short *strptr=idx+nstrings; unsigned short *strptr=idx+nstrings;
int off=0x40+(nstrings+3)*2; int off=0x40+(nstrings+3)*2;
int ntrans=0; int ntrans=0;
char **strings=malloc(sizeof(char *)*nstrings);
for(i=0;i<nstrings;i++) { for(i=0;i<nstrings;i++) {
/*
fseek(f,0x40+i*2,SEEK_SET);
offset=0;
fread(&offset, 2, 1, f);
offset=offset*2+0x40;
next=0;
fread(&next, 2, 1, f);
next=next*2+0x40;
ch=1;
putchar('"');
fseek(f,offset,SEEK_SET);
while(offset<next-2) {
fread(&ch,2,1,f);
offset+=2;
putchar(ch&127);
}
putchar('"');
putchar(10);
*/
readstring(g,st); readstring(g,st);
strings[i]=malloc(strlen(st)+1); puts(st);
strcpy(strings[i],st);
int j;
for(j=0;j<i;j++)
if(!strcmp(st,strings[j]))
break;
if(j<i) {
idx[i]=idx[j];
} else {
// puts(st);
idx[i]=(off-0x40)/2; idx[i]=(off-0x40)/2;
if((off-0x40)/2>65535) { if((off-0x40)/2>65535)
printf("ERROR: index too large %x\n",(off-0x40)/2); printf("Error index too large %x\n",(off-0x40)/2);
exit(1); int j=0;
for(j=0;st[j]!=0;j++) {
data[off++]=st[j];
data[off++]=0;
} }
size_t sz=512;
u8_to_u16(st,strlen(st),(short *)(data+off),&sz);
off+=sz*2;
data[off++]=0; data[off++]=0;
data[off++]=0; data[off++]=0;
}
} }
idx[i]=(off-0x40)/2; idx[i]=(off-0x40)/2;
id[8]=off; id[8]=off;
@ -118,9 +104,8 @@ int main(int argc,char *argv[]) {
data[off++]=0x8d; // it doesn't seem to matter if it's wrong data[off++]=0x8d; // it doesn't seem to matter if it's wrong
id[6]=off; id[6]=off;
printf("%d strings\n",nstrings); printf("%d strings\n",nstrings);
f=fopen(outfile,"wb"); f=fopen("PF090JPJPN.LNG","wb");
fwrite(data,off,1,f); fwrite(data,off,1,f);
fclose(f); fclose(f);
return(0);
} }

98
recode110.c Normal file
View File

@ -0,0 +1,98 @@
#include <stdio.h>
#include <string.h>
void readstring(FILE *f, char *p) {
char c;
c=fgetc(f);
if(c!='\"')
puts("ERRRRRRRR");
while((c=fgetc(f))!='"' && !feof(f))
*p++=c;
*p++=0;
while((c=fgetc(f))!=10 && !feof(f));
}
int main(int argc,char *argv[]) {
char data[200000];
char st[10240];
FILE *f,*g;
int i;
unsigned *id=(unsigned *) data;
id[0]=0xa55a5aa5;
id[1]=0x01000001;
id[2]=0x39304650;
id[3]=0x45504a30;
id[4]=0;
id[5]=0;
id[6]=0;// len
id[7]=0x40;
id[8]=0;//last
id[9]=0xaaaaaa02;
id[10]=0xaaaaaaaa;
id[11]=0xaaaaaaaa;
id[12]=0xaaaaaaaa;
id[13]=0xaaaaaaaa;
id[14]=0xaaaaaaaa;
id[15]=0xaaaaaaaa;
g=fopen("translated_110.txt","rb");
f=fopen("PF110JPJPN.LNG","rb");
int start=0x40;
unsigned short *idx=(unsigned short *)(data+0x40);
fseek(f,0x40,SEEK_SET);
short nstrings;
int offset=0;
int next=0;
short ch;
fread(&nstrings, 2, 1, f);
nstrings=nstrings-3;
unsigned short *strptr=idx+nstrings;
int off=0x40+(nstrings+3)*2;
int ntrans=0;
for(i=0;i<nstrings;i++) {
fseek(f,0x40+i*2,SEEK_SET);
offset=0;
fread(&offset, 2, 1, f);
offset=offset*2+0x40;
next=0;
fread(&next, 2, 1, f);
next=next*2+0x40;
ch=1;
putchar('"');
fseek(f,offset,SEEK_SET);
while(offset<next-2) {
fread(&ch,2,1,f);
offset+=2;
putchar(ch&127);
}
putchar('"');
putchar(10);
readstring(g,st);
puts(st);
idx[i]=(off-0x40)/2;
if((off-0x40)/2>65535)
printf("Error index too large %x\n",(off-0x40)/2);
int j=0;
for(j=0;st[j]!=0;j++) {
data[off++]=st[j];
data[off++]=0;
}
data[off++]=0;
data[off++]=0;
}
idx[i]=(off-0x40)/2;
id[8]=off;
strcpy(data+off,"RG_VOICE_DATA");
off+=strlen("RG_VOICE_DATA");
data[off++]=0xf1; // this looks like a checksum at the end of the file but
data[off++]=0x8d; // it doesn't seem to matter if it's wrong
id[6]=off;
printf("%d strings\n",nstrings);
f=fopen("PF110JPJPN1.LNG","wb");
fwrite(data,off,1,f);
fclose(f);
}

View File

@ -1,186 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <unistr.h>
#include <stdlib.h>
#define MAX_STRING_LENGTH 2048
#define MAX_STRINGS 8192
void readstring(FILE *f, char *p) {
char c;
int i;
char *op=p;
c=fgetc(f);
if(feof(f)) return;
if(c!='\"') {
puts("ERROR: mismatched quotes");
exit(1);
}
for(i=0;i<MAX_STRING_LENGTH;i++) {
p[i]=fgetc(f);
if(i>0 && p[i]<15 && p[i-1]==34)
break;
}
if(i>0)
p[i-1]=0;
c=p[i];
if(c==13)
c=fgetc(f);
if(c!=10 && !feof(f)) {
printf("ERROR: mismatched eol quotes %d %s\n",c, op);
}
// printf("read(%s)\n",op);
}
unsigned short crc16(const unsigned char *data, int len) {
unsigned short crc = 0xFFFF;
int i;
if (len) do {
crc ^= *data++;
for (i=0; i<8; i++) {
if (crc & 1) crc = (crc >> 1) ^ 0x8408;
else crc >>= 1;
}
} while (--len);
return(~crc);
}
int nstrings=0;
char **original=0;
char **translation=0;
void load_dictionary(char *untran,char *tran) {
FILE *f,*g;
if(original==0) {
original=malloc(MAX_STRINGS*sizeof(char *));
translation=malloc(MAX_STRINGS*sizeof(char *));
}
g=fopen(untran,"rb");
f=fopen(tran,"rb");
char st[MAX_STRING_LENGTH],st1[MAX_STRING_LENGTH];
int j;
while(!feof(g)) {
readstring(g,st);
readstring(f,st1);
printf("[%s -> %s]\n",st,st1);
for(j=0;j<nstrings;j++)
if(!strcmp(st,original[j]))
break;
if(j==nstrings) {
original[j]=malloc(strlen(st)+1);
translation[j]=malloc(strlen(st1)+1);
strcpy(original[j],st);
strcpy(translation[j],st1);
nstrings++;
}// else printf("Done Already %d\n",nstrings);
}
}
char *get_translation(char *s) {
int j;
for(j=0;j<nstrings;j++)
if(!strcmp(s,original[j]))
return translation[j];
printf("%s could not be translated\n",s);
return s;
}
int main(int argc,char *argv[]) {
char data[200000];
char st[MAX_STRING_LENGTH];
short st_u16[MAX_STRING_LENGTH];
char *infile="untranslated.txt",*outfile="PF090JPJPN.LNG";
FILE *f,*g;
int i;
unsigned *id=(unsigned *) data;
id[0]=0xa55a5aa5;
id[1]=0x01000001;
id[2]=0x39304650;
id[3]=0x45504a30;
id[4]=0;
id[5]=0;
id[6]=0;// len
id[7]=0x40;
id[8]=0;//last
id[9]=0xaaaaaa02;
id[10]=0xaaaaaaaa;
id[11]=0xaaaaaaaa;
id[12]=0xaaaaaaaa;
id[13]=0xaaaaaaaa;
id[14]=0xaaaaaaaa;
id[15]=0xaaaaaaaa;
if(argc>1)
infile=argv[1];
if(argc>2)
outfile=argv[2];
g=fopen(infile,"rb");
int start=0x40;
unsigned short *idx=(unsigned short *)(data+0x40);
short nstrings=0;
int offset=0;
int next=0;
short ch;
load_dictionary("untranslated_090.txt","translated_090.txt");
load_dictionary("untranslated_110.txt","translated_110.txt");
while(!feof(g)) {
readstring(g,st);
// printf("%d %s\n",nstrings,st);
nstrings++;
}
nstrings+=2;
rewind(g);
nstrings=nstrings-3;
printf("Found %d strings\n",nstrings);
unsigned short *strptr=idx+nstrings;
int off=0x40+(nstrings+3)*2;
int ntrans=0;
char *tr;
char **strings=malloc(sizeof(char *)*nstrings);
for(i=0;i<nstrings;i++) {
readstring(g,st);
tr=get_translation(st);
printf("%s -> %s\n",st,tr);
strings[i]=malloc(strlen(tr)+1);
strcpy(strings[i],tr);
int j;
for(j=0;j<i;j++)
if(!strcmp(tr,strings[j]))
break;
if(j<i) {
idx[i]=idx[j];
} else {
// puts(st);
idx[i]=(off-0x40)/2;
if((off-0x40)/2>65535) {
printf("ERROR: index too large %x\n",(off-0x40)/2);
exit(1);
}
size_t sz=512;
u8_to_u16(tr,strlen(tr),(short *)(data+off),&sz);
off+=sz*2;
data[off++]=0;
data[off++]=0;
}
}
idx[i]=(off-0x40)/2;
id[8]=off;
strcpy(data+off,"RG_VOICE_DATA");
off+=strlen("RG_VOICE_DATA");
data[off++]=0xf1; // this looks like a checksum at the end of the file but
data[off++]=0x8d; // it doesn't seem to matter if it's wrong
id[6]=off;
printf("%d strings\n",nstrings);
f=fopen(outfile,"wb");
fwrite(data,off,1,f);
fclose(f);
return(0);
}

View File

@ -12,8 +12,8 @@
"" ""
"Destination" "Destination"
"Configuration" "Configuration"
"Communication" "communication"
"Info" "info"
"Configuration" "Configuration"
"Edit" "Edit"
"Destination" "Destination"
@ -24,7 +24,7 @@
"Surroundings" "Surroundings"
"Registered" "Registered"
"Search history" "Search history"
"Home" "Return Home"
"Root erase" "Root erase"
"Info" "Info"
"Congestion info" "Congestion info"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4538,69 +4538,3 @@ Call %s?"
"No" "No"
"Delete probe, OK?" "Delete probe, OK?"
"AUX Volume with FM ref" "AUX Volume with FM ref"
"menu"
"This screen will not be displayed."
"Startup lock setting"
"When replacing the battery"
"When the engine switch is on"
"Not set"
"-"
"Password authentication timing"
"Change Password"
"When ON is selected,
A password input screen is displayed each time."
"Password changed."
"Please enter a new password."
"For confirmation, please re-enter the same password
Please enter. "
"Passwords do not match.
Please try again from the beginning. "
"Set startup lock.
Please enter the password.
* When setting for the first time
Please enter your initial password. "
"The password is in correct.
Letters of the alphabet are
Please check whether it is wrong. "
"Change Password"
"Password confirmation"
"The activation lock is on."
"Failed to unlock.
Whether the upper and lower case letters of the alphabet are incorrect
please confirm. "
"Reset the internal memory to the factory default settings.
Data such as registered location and password etc.
All setting contents are erased. Is it OK? "
"Password authentication"
"Startup lock setting"
"Destination search"
"(Outing Menu)"
"Data excluding home such as registered places and history,
The setting is deleted. Is it OK? "
"Data including registered places and history including home,
The setting is deleted. Is it OK? "
"Latitude longitude (Japan geodetic system)"
"Latitude and longitude (world geodetic system)"
"Northern latitude %c%c.%c%c%c%c%c%c degree east longitude %c%c%c.%c%c%c%c%c%c degrees"
"Degree input"
"Degrees minute and second"
"Datum"
"Data used%s
[Map data:%s]
[Search data:%s]
Model information Corporate model B1 "
"Data used%s
[Map data:%s]
[Search data:%s]
Model information Corporate model B2 "
"Data used%s
[Map data:%s]
[Search data:%s]
Model information Corporate model B3 "
"Data used%s
[Map data:%s]
[Search data:%s]
Model information Corporate model B4 "
"I did a route search without considering time regulation.
Please follow the actual road signs. "
"Destination search"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB