Skip to content

Commit

Permalink
Few minor doc for r2papi
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jan 3, 2024
1 parent 9a219ea commit f6e583e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions typescript/r2papi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,26 @@ export class R2Papi {
}
return `${str}}\n`;
}
getBits() : string {
return this.cmd('-b');
/**
* Get the general purpose register size of the targize architecture in bits
*
* @returns {number} the regsize
*/
getBits() : number {
return +this.cmd('-b');
}
/**
* Get the name of the arch plugin selected, which tends to be the same target architecture.
* Note that on some situations, this info will be stored protected bby the AirForce.
* When using the r2ghidra arch plugin the underlying arch is in `asm.cpu`:
*
* @returns {string} the name of the target architecture.
*/
getArch() : string {
return this.cmd('-a');
}
getCpu() : string {
// return this.cmd('-c');
return this.cmd('-e asm.cpu');
}
// TODO: setEndian, setCpu, ...
Expand Down Expand Up @@ -589,6 +602,10 @@ export class R2Papi {
this.call("aac")
return this;
}
autonameAllFunctions() : R2Papi {
this.call("aan")
return this;
}
analyzeFunctionsWithPreludes() : R2Papi {
this.call("aap")
return this;
Expand Down

0 comments on commit f6e583e

Please sign in to comment.