-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathViewController.swift
40 lines (37 loc) · 1.37 KB
/
ViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// ViewController.swift
// InjectTest
//
// Created by paradiseduo on 2022/12/6.
//
import Cocoa
import Injection
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
Inject.injectMachO(machoPath: "/Users/admin/Desktop/Code/inject/inject",
cmdType: LC_Type.LOAD_DYLIB,
backup: false,
injectPath: "@executable_path/testMac/libtestinject.dylib") { result in
if result {
Shell.run("otool -L /Users/admin/Desktop/Code/inject/inject") { _, output in
print(output)
Inject.removeMachO(machoPath: "/Users/admin/Desktop/Code/inject/inject",
cmdType: LC_Type.LOAD_DYLIB,
backup: false,
injectPath: "@executable_path/testMac/libtestinject.dylib") { _ in
Shell.run("otool -L /Users/admin/Desktop/Code/inject/inject") { _, output in
print(output)
}
}
}
}
}
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}