Options
All
  • Public
  • Public/Protected
  • All
Menu

reg-file-parser

Index

Type aliases

RegistryFileEncoding

RegistryFileEncoding: "ANSI" | "UTF8"

Encoding of exported registry file.

RegistryKeyAction

RegistryKeyAction: "import" | "delete"

Action taken by a registry key entry.

Default is importing, but if the key starts with an '-', then it is removing that particular entry.

Functions

GetEncoding

  • Retrieves the encoding of the reg file, checking for "REGEDIT4".

    Parameters

    • content: string

    Returns RegistryFileEncoding

    The text encoding of the .reg file.

GetKeyWithoutRootHive

  • GetKeyWithoutRootHive(parentKey: string): string
  • Strips the root hive off the passed registry key.

    function

    Parameters

    • parentKey: string

      Registry Key to parse.

    Returns string

    The passed registry key without the root hive.

GetRegEntryType

GetRootHive

GetStringRepresentation

  • GetStringRepresentation(stringArray: string[], encoding: string): string
  • Converts the byte arrays (saved as array of string) into a single string.

    Parameters

    • stringArray: string[]

      Array of strings

    • encoding: string

      Text Encoding

    Returns string

    String value

SetRegEntryType

  • SetRegEntryType(sRegDataType: RegistryValueType): "hex(b):" | "hex(a):" | "hex(9):" | "hex(8):" | "hex(7):" | "hex(6):" | "dword:" | "hex(2):" | "hex(0):" | "hex:" | ""
  • Maps a Registry data type to a Registry value type.

    function

    Parameters

    Returns "hex(b):" | "hex(a):" | "hex(9):" | "hex(8):" | "hex(7):" | "hex(6):" | "dword:" | "hex(2):" | "hex(0):" | "hex:" | ""

    Corresponding RegistryValueType.

StripBraces

  • StripBraces(sLine: string): string
  • Removes the leading and ending brackets from the given string.

    Parameters

    • sLine: string

      Given string

    Returns string

    Stripped string

StripContinueChar

  • StripContinueChar(sLine: string): string
  • Removes the ending blackslashes from the given string.

    Parameters

    • sLine: string

      Given string

    Returns string

    Stripped string

StripLeadingChars

  • StripLeadingChars(sLine: string, leadChar: string): string
  • Removes the leading and ending characters from the given string

    Parameters

    • sLine: string

      Given string

    • leadChar: string

      Lead character to strip

    Returns string

    Stripped string

Private getKeyAction

  • Determines if registry key is importing data or removing data from the registry.

    function

    Parameters

    • key: string

      Registry key to parse

    Returns RegistryKeyAction

    Action taken by key.

Private getKeyRoot

Private getKeyWithoutRoot

  • getKeyWithoutRoot(key: string): string
  • Strips off the registry hive from the passed key.

    function

    Parameters

    • key: string

      Registry key to parse

    Returns string

    Registry key stripped of the root hive.

Private getRegKey

  • getRegKey(fileLine: string): string
  • Strips brackets and returns Registry Key.

    function

    Parameters

    • fileLine: string

      Registry Key to parse

    Returns string

    Registry key stripped of the [ and ] characters

Private normalizeKeysDictionary

  • Parses registry key and values into array.

    function

    Parameters

    • content: string

      String of file contents to parse for key/values

    Returns IRegValueMap[]

    IRegValueMap of Registry Keys and their values.

Private normalizeValues

  • Parses Values entry into data:value array.

    function

    Parameters

    • content: string

      Values entry from normalizeKeys function.

    • parentKey: string

      Parent key these values belong to.

    Returns IRegistryValue[]

    Parsed values in separate key/value array.

Private prepareContent

  • prepareContent(content: string): string
  • Gets the contents of the passed file.

    function

    Parameters

    • content: string

    Returns string

    A string representing contents of the file.

toSigString

  • toSigString(parentKey: string, entry: string, type: RegistryValueType, value: string): string
  • Formats registry entries and values into an registry-export-style string.

    function

    Parameters

    Returns string

    An entry for the [Registry] section of the *.sig signature file.

Generated using TypeDoc