-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstat_file.js
39 lines (30 loc) · 985 Bytes
/
stat_file.js
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
const { Corellium } = require("corellium-api");
const process = require('process');
const config_data = require('./config.json');
async function main() {
// Configure the API.
let corellium = new Corellium({
endpoint: config_data.endpoint,
username: config_data.username,
password: config_data.password
});
await corellium.login();
let projects = await corellium.projects();
let project = projects.find((project) => project.name === config_data.project);
let instances = await project.instances();
let instance = instances.find(
(instance) => instance.id === config_data.instance,
);
let agent = await instance.newAgent();
await agent.ready();
try {
let result = await agent.stat(process.argv[2]);
console.log(JSON.stringify(result));
} catch(err) {
console.log('NotFound')
}
await agent.disconnect();
}
main().catch((err) => {
console.error(err);
});