Skip to content

Commit ceb8ac9

Browse files
authored
Merge pull request #1 from L1MeN9Yu/_sligen_name
declare c extern function in swift
2 parents 4d1926c + bdbd507 commit ceb8ac9

File tree

5 files changed

+4
-48
lines changed

5 files changed

+4
-48
lines changed

appdecrypt.xcodeproj/project.pbxproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
843BAE7A26B2A2190048546B /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843BAE7926B2A2190048546B /* main.swift */; };
1111
843BAE8126B2A2500048546B /* ConsoleIO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843BAE8026B2A2500048546B /* ConsoleIO.swift */; };
1212
843BAE8326B2A26D0048546B /* dump.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843BAE8226B2A26D0048546B /* dump.swift */; };
13-
843BAE8726B2A29B0048546B /* CBridage.m in Sources */ = {isa = PBXBuildFile; fileRef = 843BAE8626B2A29B0048546B /* CBridage.m */; };
1413
/* End PBXBuildFile section */
1514

1615
/* Begin PBXCopyFilesBuildPhase section */
@@ -30,9 +29,6 @@
3029
843BAE7926B2A2190048546B /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
3130
843BAE8026B2A2500048546B /* ConsoleIO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConsoleIO.swift; sourceTree = "<group>"; };
3231
843BAE8226B2A26D0048546B /* dump.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = dump.swift; sourceTree = "<group>"; };
33-
843BAE8426B2A29B0048546B /* appdecrypt-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "appdecrypt-Bridging-Header.h"; sourceTree = "<group>"; };
34-
843BAE8526B2A29B0048546B /* CBridage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CBridage.h; sourceTree = "<group>"; };
35-
843BAE8626B2A29B0048546B /* CBridage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CBridage.m; sourceTree = "<group>"; };
3632
/* End PBXFileReference section */
3733

3834
/* Begin PBXFrameworksBuildPhase section */
@@ -68,9 +64,6 @@
6864
843BAE7926B2A2190048546B /* main.swift */,
6965
843BAE8226B2A26D0048546B /* dump.swift */,
7066
843BAE8026B2A2500048546B /* ConsoleIO.swift */,
71-
843BAE8526B2A29B0048546B /* CBridage.h */,
72-
843BAE8626B2A29B0048546B /* CBridage.m */,
73-
843BAE8426B2A29B0048546B /* appdecrypt-Bridging-Header.h */,
7467
);
7568
path = appdecrypt;
7669
sourceTree = "<group>";
@@ -135,7 +128,6 @@
135128
files = (
136129
843BAE7A26B2A2190048546B /* main.swift in Sources */,
137130
843BAE8326B2A26D0048546B /* dump.swift in Sources */,
138-
843BAE8726B2A29B0048546B /* CBridage.m in Sources */,
139131
843BAE8126B2A2500048546B /* ConsoleIO.swift in Sources */,
140132
);
141133
runOnlyForDeploymentPostprocessing = 0;
@@ -270,7 +262,6 @@
270262
);
271263
MACOSX_DEPLOYMENT_TARGET = 11.0;
272264
PRODUCT_NAME = "$(TARGET_NAME)";
273-
SWIFT_OBJC_BRIDGING_HEADER = "appdecrypt/appdecrypt-Bridging-Header.h";
274265
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
275266
SWIFT_VERSION = 5.0;
276267
};
@@ -288,7 +279,6 @@
288279
);
289280
MACOSX_DEPLOYMENT_TARGET = 11.0;
290281
PRODUCT_NAME = "$(TARGET_NAME)";
291-
SWIFT_OBJC_BRIDGING_HEADER = "appdecrypt/appdecrypt-Bridging-Header.h";
292282
SWIFT_VERSION = 5.0;
293283
};
294284
name = Release;

appdecrypt/CBridage.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

appdecrypt/CBridage.m

Lines changed: 0 additions & 16 deletions
This file was deleted.

appdecrypt/appdecrypt-Bridging-Header.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

appdecrypt/dump.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import Foundation
99
import MachO
1010

11+
@_silgen_name("mremap_encrypted")
12+
func mremap_encrypted(_: UnsafeMutableRawPointer, _: Int, _: UInt32, _: UInt32, _: UInt32) -> Int32
13+
1114
class Dump {
1215
let consoleIO = ConsoleIO()
1316
func staticMode() {
@@ -88,7 +91,7 @@ class Dump {
8891
if base == MAP_FAILED {
8992
return false
9093
}
91-
let error = CBridage.encrypted(base!, cryptsize: Int(info.cryptsize), cryptid: info.cryptid)
94+
let error = mremap_encrypted(base!, Int(info.cryptsize), info.cryptid,UInt32(CPU_TYPE_ARM64),UInt32(CPU_SUBTYPE_ARM64_ALL))
9295
if error != 0 {
9396
munmap(base!, Int(info.cryptsize))
9497
return false

0 commit comments

Comments
 (0)