add research folder
This commit is contained in:
24
research/scripts/bind.c
Normal file
24
research/scripts/bind.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct dyld_chained_ptr_64_bind
|
||||
{
|
||||
uint64_t ordinal : 24,
|
||||
addend : 8, // 0 thru 255
|
||||
reserved : 19, // all zeros
|
||||
next : 12, // 4-byte stride
|
||||
bind : 1; // == 1
|
||||
};
|
||||
|
||||
int main() {
|
||||
// 0 = 0x8010000000000000 = 9227875636482146000
|
||||
uint64_t x = 0x8000000000000010;
|
||||
uint8_t y[] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80};
|
||||
struct dyld_chained_ptr_64_bind* bind = y;
|
||||
// printf("x? %llx\n", x);
|
||||
// printf("y? %llx\n", *(uint64_t*)y);
|
||||
printf("bind? %d\n", bind->bind);
|
||||
printf("next? %d\n", bind->next);
|
||||
printf("ordinal? %d\n", bind->ordinal);
|
||||
printf("addend? %d\n", bind->addend);
|
||||
}
|
BIN
research/scripts/dyld_export_trie.bin
Normal file
BIN
research/scripts/dyld_export_trie.bin
Normal file
Binary file not shown.
7
research/scripts/go.mod
Normal file
7
research/scripts/go.mod
Normal file
@ -0,0 +1,7 @@
|
||||
module a
|
||||
|
||||
go 1.20
|
||||
|
||||
require github.com/blacktop/go-macho v1.1.155
|
||||
|
||||
require github.com/blacktop/go-dwarf v1.0.9 // indirect
|
4
research/scripts/go.sum
Normal file
4
research/scripts/go.sum
Normal file
@ -0,0 +1,4 @@
|
||||
github.com/blacktop/go-dwarf v1.0.9 h1:eT/L7gt0gllvvgnRXY0MFKjNB6+jtOY5DTm2ynVX2dY=
|
||||
github.com/blacktop/go-dwarf v1.0.9/go.mod h1:4W2FKgSFYcZLDwnR7k+apv5i3nrau4NGl9N6VQ9DSTo=
|
||||
github.com/blacktop/go-macho v1.1.155 h1:1yIFj2PxtenaPiB3eGwUSxmZki55f5b4JHGtfrJVFHs=
|
||||
github.com/blacktop/go-macho v1.1.155/go.mod h1:f2X4noFBob4G5bWUrzvPBKDVcFWZgDCM7rIn7ygTID0=
|
BIN
research/scripts/libc_export_trie.bin
Normal file
BIN
research/scripts/libc_export_trie.bin
Normal file
Binary file not shown.
16
research/scripts/parse_export_trie.go
Normal file
16
research/scripts/parse_export_trie.go
Normal file
@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import "github.com/blacktop/go-macho/pkg/trie"
|
||||
import "os"
|
||||
import "bytes"
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// buffer, _ := os.ReadFile("./dyld_export_trie.bin")
|
||||
buffer, _ := os.ReadFile("./libc_export_trie.bin")
|
||||
r := bytes.NewReader(buffer)
|
||||
nodes, _ := trie.ParseTrieExports(r, 0x7ff80715c000)
|
||||
for _, node := range nodes {
|
||||
fmt.Println(node)
|
||||
}
|
||||
}
|
BIN
research/scripts/system_exoprt_trie.bin
Normal file
BIN
research/scripts/system_exoprt_trie.bin
Normal file
Binary file not shown.
BIN
research/scripts/system_export_trie.bin
Normal file
BIN
research/scripts/system_export_trie.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user