Sync frida-gum typings with Frida 12.8.15 (#43358)

Changelog at:

        https://frida.re/news/2019/12/18/frida-12-8-released/
This commit is contained in:
Ole André Vadla Ravnås 2020-03-27 16:54:09 +01:00 committed by GitHub
parent 9ea38ba16c
commit a4c01b7736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 1 deletions

View File

@ -1,5 +1,29 @@
Frida.version; // $ExpectType string
// $ExpectType NativePointer
const p = ptr(1234);
// $ExpectType NativePointer
p.sign();
// $ExpectType NativePointer
p.sign("ia", 42);
// $ExpectError
p.sign("invalid", 42);
// $ExpectType NativePointer
p.strip();
// $ExpectType NativePointer
p.strip("ia");
// $ExpectError
p.strip("invalid");
// $ExpectType NativePointer
p.blend(1337);
// $ExpectError
p.blend(ptr(42));
// $ExpectError
p.blend();
const otherPuts = new NativeCallback(() => {
return 0;
}, "int", ["pointer"]);

View File

@ -1,4 +1,4 @@
// Type definitions for non-npm package frida-gum 15.1
// Type definitions for non-npm package frida-gum 15.2
// Project: https://github.com/frida/frida
// Definitions by: Ole André Vadla Ravnås <https://github.com/oleavr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -1420,6 +1420,35 @@ declare class NativePointer {
*/
not(): NativePointer;
/**
* Makes a new NativePointer by taking the bits of `this` and adding
* pointer authentication bits, creating a signed pointer. This is a
* no-op if the current process does not support pointer
* authentication, returning `this` instead of a new value.
*
* @param key The key to use. Defaults to `ia`.
* @param data The data to use. Defaults to `0`.
*/
sign(key?: PointerAuthenticationKey, data?: NativePointerValue | UInt64 | Int64 | number | string): NativePointer;
/**
* Makes a new NativePointer by taking the bits of `this` and
* removing its pointer authentication bits, creating a raw pointer.
* This is a no-op if the current process does not support pointer
* authentication, returning `this` instead of a new value.
*
* @param key The key that was used to sign `this`. Defaults to `ia`.
*/
strip(key?: PointerAuthenticationKey): NativePointer;
/**
* Makes a new NativePointer by taking `this` and blending it with
* a constant, which may in turn be passed to `sign()` as `data`.
*
* @param smallInteger Value to blend with.
*/
blend(smallInteger: number): NativePointer;
/**
* Returns a boolean indicating whether `v` is equal to `this`; i.e. it contains the same memory address.
*/
@ -1497,6 +1526,8 @@ declare class NativePointer {
writeAnsiString(value: string): NativePointer;
}
type PointerAuthenticationKey = "ia" | "ib" | "da" | "db";
interface ObjectWrapper {
handle: NativePointer;
}