Skip to content

Commit

Permalink
(fix) move to macho-ts and frida-screenshot ts
Browse files Browse the repository at this point in the history
  • Loading branch information
leonjza committed Jun 7, 2024
1 parent e6db48b commit d9c989d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 40 deletions.
55 changes: 26 additions & 29 deletions agent/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"description": "Runtime Mobile Exploration",
"private": true,
"type": "module",
"main": "src/index.ts",
"scripts": {
"prepare": "npm run build",
Expand Down Expand Up @@ -31,7 +32,7 @@
"frida-java-bridge": "^6",
"frida-objc-bridge": "^7",
"frida-screenshot": "^5",
"macho": "^1"
"macho-ts": "^0.1.0"
},
"devDependencies": {
"@types/frida-gum": "^18",
Expand Down
4 changes: 2 additions & 2 deletions agent/src/ios/binary.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// tslint:disable-next-line:no-var-requires
const macho = require("macho");
import macho from "macho-ts";

import * as iosfilesystem from "./filesystem.js";
import { IBinaryModuleDictionary } from "./lib/interfaces.js";

Expand Down
10 changes: 5 additions & 5 deletions agent/src/ios/userinterface.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// tslint:disable-next-line:no-var-requires
const sc = require("frida-screenshot");
import screenshot from "frida-screenshot";
import { colors as c } from "../lib/color.js";
import { IJob } from "../lib/interfaces.js";
import * as jobs from "../lib/jobs.js";


export const screenshot = (): any => {
export const take = (): any => {
// heavy lifting thanks to frida-screenshot!
// https://github.com/nowsecure/frida-screenshot
return sc();
return screenshot(null);
};

export const dump = (): string => {
Expand Down Expand Up @@ -131,7 +131,7 @@ export const biometricsBypass = (): void => {
if (policyJob.invocations) {
policyJob.invocations.push(lacontext1);
} else {
policyJob.invocations = [ lacontext1 ];
policyJob.invocations = [lacontext1];
}
jobs.add(policyJob);

Expand Down Expand Up @@ -193,7 +193,7 @@ export const biometricsBypass = (): void => {
if (accessControlJob.invocations) {
accessControlJob.invocations.push(lacontext2);
} else {
accessControlJob.invocations = [ lacontext2 ];
accessControlJob.invocations = [lacontext2];
}
jobs.add(accessControlJob);
};
6 changes: 3 additions & 3 deletions agent/src/rpc/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ios = {
// ios user interface
iosUiAlert: (message: string): void => userinterface.alert(message),
iosUiBiometricsBypass: (): void => userinterface.biometricsBypass(),
iosUiScreenshot: (): any => userinterface.screenshot(),
iosUiScreenshot: (): any => userinterface.take(),
iosUiWindowDump: (): string => userinterface.dump(),

// ios ssl pinning
Expand All @@ -97,8 +97,8 @@ export const ios = {
iosKeychainAdd: (account: string, service: string, data: string): boolean =>
ioskeychain.add(account, service, data),
iosKeychainRemove: (account: string, service: string): void => ioskeychain.remove(account, service),
iosKeychainUpdate: (account: string, service: string, newData: string): void =>
ioskeychain.update(account, service, newData),
iosKeychainUpdate: (account: string, service: string, newData: string): void =>
ioskeychain.update(account, service, newData),
iosKeychainEmpty: (): void => ioskeychain.empty(),
iosKeychainList: (smartDecode: boolean = false): IKeychainItem[] => ioskeychain.list(smartDecode),
iosKeychainListRaw: (): void => ioskeychain.listRaw(),
Expand Down

0 comments on commit d9c989d

Please sign in to comment.