Skip to content

Commit ba31089

Browse files
author
Your Name
committed
Fix handling of regs for corpse
1 parent cce365a commit ba31089

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frida-cshell",
3-
"version": "1.8.1",
3+
"version": "1.8.2",
44
"description": "Frida's CShell",
55
"scripts": {
66
"prepare": "npm run version && npm run build && npm run package && npm run copy",

src/cmdlets/misc/corpse/corpse.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,7 @@ corpse - create a corpse file`;
179179
path: m.path,
180180
};
181181
});
182-
const regs = Regs.all().map(([name, value]) => {
183-
return {
184-
name: name,
185-
addr: value.toPointer(),
186-
value: value.getLiteral(),
187-
};
188-
});
182+
const regs = this.tryGetRegs();
189183
const vars = Vars.all().map(([name, value]) => {
190184
return {
191185
name: name,
@@ -226,6 +220,20 @@ corpse - create a corpse file`;
226220
cursor.writeUtf8String(data);
227221
}
228222

223+
private tryGetRegs(): { name: string; addr: NativePointer; value: string }[] {
224+
try {
225+
return Regs.all().map(([name, value]) => {
226+
return {
227+
name: name,
228+
addr: value.toPointer(),
229+
value: value.getLiteral(),
230+
};
231+
});
232+
} catch {
233+
return [];
234+
}
235+
}
236+
229237
private checkCorpse(corePath: string) {
230238
const corpse = new File(corePath, 'rb');
231239
corpse.seek(0, File.SEEK_END);

0 commit comments

Comments
 (0)