Skip to content

Commit

Permalink
export
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed May 26, 2024
2 parents 762035b + 04bea76 commit 823c6c8
Show file tree
Hide file tree
Showing 44 changed files with 379 additions and 39 deletions.
22 changes: 22 additions & 0 deletions docs/archive/bluekiller.htm

Large diffs are not rendered by default.

Binary file added docs/archive/bluekiller_files/Image_001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_002.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_006.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_007.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_014.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_015.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_016.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_017.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_018.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_019.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_020.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_021.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_022.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_023.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_024.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_025.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/archive/bluekiller_files/Image_026.jpg
Binary file added docs/archive/bluekiller_files/Image_027.jpg
Binary file added docs/archive/bluekiller_files/Image_028.png
Binary file added docs/archive/bluekiller_files/Image_029.jpg
Binary file added docs/archive/bluekiller_files/Image_030.jpg
Binary file added docs/archive/bluekiller_files/Image_031.jpg
Binary file added docs/archive/bluekiller_files/Image_032.jpg
Binary file added docs/archive/bluekiller_files/Image_033.jpg
Binary file added docs/archive/bluekiller_files/Image_034.png
Binary file added docs/archive/bluekiller_files/Image_035.png
1 change: 1 addition & 0 deletions docs/archive/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
本文件夹内为互联网中存档,版权归原作者所有。
16 changes: 12 additions & 4 deletions docs/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,35 @@
使用实机Debug有很多好处

## Debug Using `PPSSPP`
> [《诡计对逻辑》汉化研究](https://pbteam.cn/posts/txl-hack/)
> https://datacrystal.romhacking.net/wiki/Blaze_Union/Tutorials
> https://github.com/Bunkai9448/digipet_PSP/blob/main/RE_Guide.md
> + [《诡计对逻辑》汉化研究](https://pbteam.cn/posts/txl-hack/)
> + https://datacrystal.romhacking.net/wiki/Blaze_Union/Tutorials
> + https://github.com/Bunkai9448/digipet_PSP/blob/main/RE_Guide.md
PPSSPP自带的调试工具算很强大了。简要介绍一下它的功能。

+ 查看寄存器
+ 查看内存
+ 给系统调用打断点

具体用法可以参考链接。

几种内存地址的变换

+ psp的内存地址空间
+ Dump出的内存
+ ELF中的vmaddr
+ ELF的二进制文件

<<<<<<< HEAD
## Remote debug for `PPSSPP`
PPSSPP supports WebSocket Debugging.

## Makefile Example (From RetroArch)
=======
### Debug using `PPSSPP` with `Ghidra`

## Makefile Example (From `RetroArch`)
>>>>>>> 04bea76e94d934b878c995d594ce433b4f3be225
+ After `include`
```Makefile
debug:
Expand All @@ -49,4 +57,4 @@ debug:

> If you are using Ubuntu and install PPSSPP from snap.
> + Program Location: /snap/bin/ppsspp-emu.ppsspp-sdl
> + `PSP` Folder Location: ~/snap/ppsspp-emu/common/.config/ppsspp
> + `PSP` Folder Location: ~/snap/ppsspp-emu/common/.config/ppsspp
111 changes: 111 additions & 0 deletions docs/libs/font.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,117 @@ Unicode 中的一个编码区段,编码从 U+0000 至 U+FFFF,也称基本多

Unicode 编码规定以下字符范围为控制字符,\U0000 - \U001F, \U007F, \U0080 - \U009F。

<<<<<<< HEAD
UCS-2 用 0x0000 - 0xFFFF 代表所有UTF-8的字符。 假设一个字符为16x16, 一个byte(8Bit)可以代表8个点, 32个byte就可以代表一个字, 2Mib刚好表示整个UCS-2字库。

PSP在使用的时候, 跟据UCS2编码可以直接算出偏移量, 并取出32个byte, 进行位运算, 打印出一个字符.
=======
# PGF

26.9 PGF

The PSP font format (.PGF files) is a bitmap based font format. Each letter (as well as its shadow) is a single, 4bpp bitmap, saved in the font file in a RLE compressed form. The bitmaps are encoded using either vertical or horizontal rows, depending on a certain 2-bit field in character metrics. Every [character, shadow] bitmap pair is preceded by a character metrics record. For Latin fonts the length of this record appears to be 12 bytes (with an optional 7-byte extension), for other families it's different. It's not known at this time what is the determinant of the record length. The metrics record contains the following fields:
14-bit offset of the shadow header record
7-bit width
7-bit height
7-bit signed horizontal adjustment
7-bit ascender
2-bit transposition (1 - horizontal rows, 2 - vertical rows)
1-bit modified record field (adds a 7-byte extension to the 12-byte header for ltn0.pgf)
46 bits of unknown data
5-bit horizontal advance
To find the character metrics one has to read the main pointer table. The table is constructed of N-bit pointers, where N is found in the file header at offset 0x1C. The number of pointers (and characters) can be found in the file header at offset 0x14. It is not known yet how to locate the main pointer table. The RLE compression works on 4-bit nibbles (the low nibble of a byte is considered to precede the high nibble in the stream). There are two sequences defined for this RLE:
a nibble N<8: take next nibble and replicate N+1 times into the output stream
a nibble N>7: take next 16-N nibbles and copy directly into the output stream

上面的文章好像是针对拉丁字符的,中文字符感觉要参考一下国内的程序,或者PPSSPP。

`liquidzigong`?
`TPU`?

怪物猎人?
梦幻之星携带版2等?
`oldfont.prx`?

```
Name: fontfuck
Attrib: 0000
Version: 1.1
GP: 00008EF0
Exports:
Export 0, Name syslib, Functions 1, Variables 1, flags 80000000
Export 1, Name sceLibFont, Functions 15, Variables 0, flags 00010000
Imports:
Import 0, Name sceLibFttt, Functions 27, Variables 0, flags 00090011
Import 1, Name IoFileMgrForUser, Functions 5, Variables 0, flags 40010000
Import 2, Name ModuleMgrForUser, Functions 2, Variables 0, flags 40010000
Import 3, Name StdioForUser, Functions 1, Variables 0, flags 40010000
Import 4, Name ThreadManForUser, Functions 4, Variables 0, flags 40010000
```

https://gist.github.com/TellowKrinkle/3414f704ba39d4dea5773df5a6f53f3c

new Module("sceLibFttt",
new SCE(0x67f17ed7, "sceFontNewLib", 'x', "xx"),
new SCE(0x574b6fbc, "sceFontDoneLib", 'i', "x"),
new SCE(0x48293280, "sceFontSetResolution", 'i', "xff"),
new SCE(0x27f6e642, "sceFontGetNumFontList", 'i', "xx"),
new SCE(0xbc75d85b, "sceFontGetFontList", 'i', "xxi"),
new SCE(0x099ef33c, "sceFontFindOptimumFont", 'i', "xxx"),
new SCE(0x681e61a7, "sceFontFindFont", 'i', "xxx"),
new SCE(0x2f67356a, "sceFontCalcMemorySize", 'i', ""),
new SCE(0x5333322d, "sceFontGetFontInfoByIndexNumber", 'i', "xxx"),
new SCE(0xa834319d, "sceFontOpen", 'x', "xxxx"),
new SCE(0x57fcb733, "sceFontOpenUserFile", 'x', "xsxx"),
new SCE(0xbb8e7fe6, "sceFontOpenUserMemory", 'x', "xxxx"),
new SCE(0x3aea8cb6, "sceFontClose", 'i', "x"),
new SCE(0x0da7535e, "sceFontGetFontInfo", 'i', "xx"),
new SCE(0xdcc80c2f, "sceFontGetCharInfo", 'i', "xxx"),
new SCE(0xaa3de7b5, "sceFontGetShadowInfo", 'i', "xxx"),
new SCE(0x5c3e4a9e, "sceFontGetCharImageRect", 'i', "xxx"),
new SCE(0x48b06520, "sceFontGetShadowImageRect", 'i', "xxx"),
new SCE(0x980f4895, "sceFontGetCharGlyphImage", 'i', "xxx"),
new SCE(0xca1e6945, "sceFontGetCharGlyphImage_Clip", 'i', "xxxiiii"),
new SCE(0x74b21701, "sceFontPixelToPointH", 'f', "ifx"),
new SCE(0xf8f0752e, "sceFontPixelToPointV", 'f', "ifx"),
new SCE(0x472694cd, "sceFontPointToPixelH", 'f', "ifx"),
new SCE(0x3c4b7e82, "sceFontPointToPixelV", 'f', "ifx"),
new SCE(0xee232411, "sceFontSetAltCharacterCode", 'i', "xx"),
new SCE(0x568be516, "sceFontGetShadowGlyphImage", 'i', "xxx"),
new SCE(0x5dcf6858, "sceFontGetShadowGlyphImage_Clip", 'i', "xxxiiii"),
new SCE(0x02d7f94b, "sceFontFlush", 'i', "x")
),

Module("sceLibFont",
new SCE(0x67f17ed7, "sceFontNewLib", 'x', "xx"),
new SCE(0x574b6fbc, "sceFontDoneLib", 'i', "x"),
new SCE(0x48293280, "sceFontSetResolution", 'i', "xff"),
new SCE(0x27f6e642, "sceFontGetNumFontList", 'i', "xx"),
new SCE(0xbc75d85b, "sceFontGetFontList", 'i', "xxi"),
new SCE(0x099ef33c, "sceFontFindOptimumFont", 'i', "xxx"),
new SCE(0x681e61a7, "sceFontFindFont", 'i', "xxx"),
new SCE(0x2f67356a, "sceFontCalcMemorySize", 'i', ""),
new SCE(0x5333322d, "sceFontGetFontInfoByIndexNumber", 'i', "xxx"),
new SCE(0xa834319d, "sceFontOpen", 'x', "xxxx"),
new SCE(0x57fcb733, "sceFontOpenUserFile", 'x', "xsxx"),
new SCE(0xbb8e7fe6, "sceFontOpenUserMemory", 'x', "xxxx"),
new SCE(0x3aea8cb6, "sceFontClose", 'i', "x"),
new SCE(0x0da7535e, "sceFontGetFontInfo", 'i', "xx"),
new SCE(0xdcc80c2f, "sceFontGetCharInfo", 'i', "xxx"),
new SCE(0xaa3de7b5, "sceFontGetShadowInfo", 'i', "xxx"),
new SCE(0x5c3e4a9e, "sceFontGetCharImageRect", 'i', "xxx"),
new SCE(0x48b06520, "sceFontGetShadowImageRect", 'i', "xxx"),
new SCE(0x980f4895, "sceFontGetCharGlyphImage", 'i', "xxx"),
new SCE(0xca1e6945, "sceFontGetCharGlyphImage_Clip", 'i', "xxxiiii"),
new SCE(0x74b21701, "sceFontPixelToPointH", 'f', "ifx"),
new SCE(0xf8f0752e, "sceFontPixelToPointV", 'f', "ifx"),
new SCE(0x472694cd, "sceFontPointToPixelH", 'f', "ifx"),
new SCE(0x3c4b7e82, "sceFontPointToPixelV", 'f', "ifx"),
new SCE(0xee232411, "sceFontSetAltCharacterCode", 'i', "xx"),
new SCE(0x568be516, "sceFontGetShadowGlyphImage", 'i', "xxx"),
new SCE(0x5dcf6858, "sceFontGetShadowGlyphImage_Clip", 'i', "xxxiiii"),
new SCE(0x02d7f94b, "sceFontFlush", 'i', "x")
)
>>>>>>> 04bea76e94d934b878c995d594ce433b4f3be225
Binary file added docs/libs/libfont_dis.txt
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/profiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Profiling
PSP Toolchain 支持 `gprof`(GNU Prof)。
## GNU Prof
### 使用方法
1. 编译程序
直接编译:
链接:
2. 生成.out
3. 使用gprof分析.out文件。

参考资料:gprof官网
3 changes: 2 additions & 1 deletion docs/prx2stub.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


1. 使用`prxtool``prx`模块提取得到导出表(`Export Table`,`.exp`文件)
`prxtool sample.prx -p`生成exports.exp
> **导出表(Export Table)**
>
> `prx`文件的导出表可以类比Windows PE文件(如DLL文件)中的导出表。
Expand Down Expand Up @@ -105,4 +106,4 @@

通过这种方法,得到包含头文件和存根库的整个PSPSDK开发环境。

目前PSPSDK中有一些库的头文件中函数名仍带有奇怪的字符串,这实际上就是直接从导出表中得到的函数的`NID`,由于彼时尚不理解其具体实现,没有办法为其取名。
目前PSPSDK中有一些库的头文件中函数名仍带有奇怪的字符串,这实际上就是直接从导出表中得到的函数的`NID`,由于彼时尚不理解其具体实现,没有办法为其取名。
Loading

0 comments on commit 823c6c8

Please sign in to comment.