Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Int

Int: number | bigint

An intager (bigint or number)

Functions

buf

  • buf(f: DataArray): Uint8Array

Convert a DataArray to a Uint8Array

Parameters

  • f: DataArray

    The DataArray.

Returns Uint8Array

The result of the conversion

bufbs

  • bufbs(f: string): Uint8Array

Convert a byte string to Uint8Array. THIS DOES NOT DECODE UTF8!!!

Parameters

  • f: string

    The DataArray.

Returns Uint8Array

The result of the conversion

cat

  • cat(blocks: DataArray []): Uint8Array

Concatenate blocks

Parameters

  • blocks: DataArray []

Returns Uint8Array

The result of concatenation of those blocks

copyIn

  • copyIn(b: Uint8Array, ins: DataArray, offset: number): void

Copy in data from ins to b

Parameters

  • b: Uint8Array

    Where to copy in

  • ins: DataArray

    What to copy

  • offset: number

    The offset in b to copy

Returns void

dv

  • dv(f: DataArray): DataView

Convert a DataArray to a DataView

Parameters

  • f: DataArray

    The DataArray.

Returns DataView

The result of the conversion

dvop

  • dvop(sz: number, fn: function): Uint8Array

Do something with a dataview in a smaller form factor.

Parameters

  • sz: number

    The size of the dataview needed.

  • fn: function

    A function that takes our dataview and puts something in it

      • (dv: DataView): any
      • Parameters

        • dv: DataView

        Returns any

Returns Uint8Array

The backing buffer of the dataview.

error

  • error(s: string, ...args: any []): void

Shows an error on the standard error.

Parameters

  • s: string
  • ...args: any [] Rest

    Arguments to the format.

Returns void

fatal

  • fatal(s: string, ...args: any []): never

Shows an error on the standard error and exits.

Parameters

  • s: string
  • ...args: any [] Rest

    Arguments to the format.

Returns never

flip

  • flip(arr: DataArray): Uint8Array

Flips a DataArray

Parameters

  • arr: DataArray

    The data array to be flipped

Returns Uint8Array

The result of the conversion

fmt

  • fmt(format: string, ...args: any []): string

A nice formatter optimized with colors and everything.

How to use? Make your format string have % in places you want to place something else.

What is that something? % - just print out %

x - print out hex-encoded int.

p - print out hex-encoded long (bigint).

o - print out an object.

d - print out an int.

l - print out a long.

b - print out a boolean

Parameters

  • format: string

    The format string.

  • ...args: any [] Rest

    Format string values.

Returns string

Formatted string.

getMain

  • getMain(): string

Gets the main entrypoint to the program. This does NOT work on windows and is experimental on darwin.

TODO: Make denopwn CLI tool that enables this to work.

Returns string

hex

  • hex(f: DataArray): string

Convert a DataArray to a hex string

Parameters

  • f: DataArray

Returns string

The result of the conversion

info

  • info(format: string, ...args: any []): void

Shows an information on the standard output.

Parameters

  • format: string

    The format (fmt)

  • ...args: any [] Rest

    Arguments to the format.

Returns void

int

  • int(s: number | bigint): number

Convert an Int to number

Parameters

  • s: number | bigint

    the Int

Returns number

The result of the conversion

load

  • load(f: string): Uint8Array

Load a file as specified by a CLI flag.

Parameters

  • f: string

    The name of the flag.

Returns Uint8Array

The contents

long

  • long(s: number | bigint): bigint

Convert an Int to a bigint

Parameters

  • s: number | bigint

    the Int

Returns bigint

The result of the conversion

off

  • off(data: DataArray, start: Int, len?: Int): Uint8Array

Get an offset view to a DataArray (this is not a reference)

Parameters

  • data: DataArray

    The view to return an offset into

  • start: Int

    The start of the view.

  • len: Int = -1 Default value

    (optional) the amount of bytes to include. If not provided all the bytes will be included

Returns Uint8Array

The offset view

oneUserFrame

  • oneUserFrame(): string

A function for getting a single stack frame from outside of denopwn.

Returns string

The first stack trace outside of denopwn

pack

  • pack<T>(def: T, output: function, raw: UnpackMap<T>): void

Directly repack the buffer. struct

Type parameters

  • T: StructDef

Parameters

  • def: T

    The definition of the structure

  • output: function

    A callback that will be called for every chunk of the output

      • (data: DataArray): void
      • Parameters

        • data: DataArray

        Returns void

  • raw: UnpackMap<T>

    The unpacked data

Returns void

path

  • path(f: string): string

Gets the path to file as specified by a CLI flag.

Parameters

  • f: string

    The name of the flag.

Returns string

The path

prompt

  • prompt(str?: string): Promise<string>

Prompt the user for data

Parameters

  • str: string = "> " Default value

    The prompt (optional, defaults to '> ', is made bold-red)

Returns Promise<string>

roundUp

  • roundUp(n: Int, to: Int): bigint

This function rounds n to the nearest to. Useful for paging stuff.

Parameters

  • n: Int

    the number to be rounded.

  • to: Int

    the number n should be rounded to.

Returns bigint

The result of rounding.

searchInSearchable

  • searchInSearchable(x: string): number

Find an index in a searchable

Parameters

  • x: string

Returns number

searchable

  • searchable(len: number): string

Generate searchable string

Parameters

  • len: number

    The length of a searchable

Returns string

stacktrace

  • stacktrace(): string []

A function for getting the entire stack trace by file names

Returns string []

The stack trace.

str

  • str(f: DataArray): string

Convert a DataArray to a string.

Parameters

  • f: DataArray

    The DataArray.

Returns string

The result of the conversion

struct

  • struct<T>(structId: string, main?: string): Struct<T>

A convenience function to automatically load a structure from a file in the same directory as main (must be local) called struct.ts.

Type parameters

  • T: StructDef

Parameters

  • structId: string

    The name of the structure

  • main: string Optional

    (optional) set the main entrypoint.

Returns Struct<T>

unhex

  • unhex(s: string): Uint8Array

Convert a hex string to an Uint8Array

Parameters

  • s: string

    The hex string

Returns Uint8Array

The result of the conversion

unpack

  • unpack<T>(def: T, nrbin: DataArray, obj: object): number

Directly unpack the buffer. struct

Type parameters

  • T: StructDef

Parameters

  • def: T

    The definition of the structure

  • nrbin: DataArray

    the binary to be unpacked

  • obj: object

    an object with a single property, ret, which is used for the actual value.

Returns number

The amount of bytes used.

warn

  • warn(s: string, ...args: any []): void

Shows a warning on the standard error.

Parameters

  • s: string
  • ...args: any [] Rest

    Arguments to the format.

Returns void

Object literals

Const ps

ps: object

Exports utilities for dealing with Process

local

  • local(invocation: string, options?: RunOptionsNoCmd): Promise<Process>

Spawn a local process

Parameters

  • invocation: string

    Processes invocation as you would type into bash(1)

  • options: RunOptionsNoCmd = {} Default value

    (optional) Extra options to pass to Deno.run

Returns Promise<Process>

The process

remote

  • remote(host: string, port: number): Promise<Process>

Connect to a remote host in order to connect to a process

Parameters

  • host: string

    The host

  • port: number

    Port on which the connection should be made

Returns Promise<Process>

The process

Const radare2

radare2: object

Convenience functions for radare2/rabin2

strings

  • strings(mode: "data" | "raw" | "even-rawer", binpath: string): Promise<string []>

Asks rabin2 about strings.

Parameters

  • mode: "data" | "raw" | "even-rawer"

    How should we get the strings?

  • binpath: string

    Path to the binary with the strings

Returns Promise<string []>

Strings

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.