Skip to content

Commit 49ce577

Browse files
committed
Update README.md
1 parent d2cd4a4 commit 49ce577

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
# swift-pd-guess
22

3-
Try to guess the file name from a private discriminator of a private Swift symbol.
3+
Try to guess the file name from private discriminator of a Swift symbol.
4+
5+
## Usgae
6+
7+
```shell
8+
swift-pd-guess <hash> <words> --prefix <prefix> [--suffix <suffix>] [--max-count <max-count>]
9+
```
410

511
## Example
612

7-
See Example/README.md for detail.
13+
For DemoKit binary, we can see some private symbol have "_00D91DAB7748ABA327DC94E69D678CAF" in their demangled name.
814

9-
## Usgae
15+
Eg. _$s7DemoKit3FooV7Private33_00D91DAB7748ABA327DC94E69D678CAFLLVMn --demangle--> nominal type descriptor for DemoKit.Foo.(Private in _00D91DAB7748ABA327DC94E69D678CAF)
16+
17+
We can then use `swift-pd-guess` to guess the file name using a given words array.
1018

1119
```shell
12-
swift-pd-guess <hash> <words> --prefix <prefix> [--suffix <suffix>] [--max-count <max-count>]
20+
swift-pd-guess 00D91DAB7748ABA327DC94E69D678CAF Foo,Private,API,_,+, --prefix DemoKit
21+
# Try brute force hash: 00D91DAB7748ABA327DC94E69D678CAF with dictionary ["Foo", "Private", "API", "_", "+"] max-4
22+
# Found match: DemoKitFoo+Private.swift
1323
```
1424

25+
The result is `DemoKit/Foo+Private.swift` since we are lucky to find a good words array.
26+
27+
## Related Projects
28+
29+
https://github.com/OpenSwiftUIProject/SwiftPrivateImportExample
30+
1531
## License
1632

1733
MIT. See LICENSE for detail.

0 commit comments

Comments
 (0)