---
name: "libregf"
section: "3"
platform: "linux"
package: "libregf-dev"
version: "20240421-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libregf"
---

# libregf(3)

Library to access the Windows NT Registry File (REGF) format

## NAME

**libregf.h** – Library to access the Windows NT Registry File (REGF) format

## SYNOPSIS

**#include \<libregf.h\>**

Support functions

*const* *char* *\**\

**libregf\_get\_version**(*void*);

*int*\

**libregf\_get\_access\_flags\_read**(*void*);

*int*\

**libregf\_get\_codepage**(*int \*codepage*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_set\_codepage**(*int codepage*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_check\_file\_signature**(*const char \*filename*, *libregf\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libregf\_check\_file\_signature\_wide**(*const wchar\_t \*filename*, *libregf\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libregf\_check\_file\_signature\_file\_io\_handle**(*libbfio\_handle\_t \*bfio\_handle*, *libregf\_error\_t \*\*error*);

Notify functions

*void*\

**libregf\_notify\_set\_verbose**(*int verbose*);

*int*\

**libregf\_notify\_set\_stream**(*FILE \*stream*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_notify\_stream\_open**(*const char \*filename*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_notify\_stream\_close**(*libregf\_error\_t \*\*error*);

Error functions

*void*\

**libregf\_error\_free**(*libregf\_error\_t \*\*error*);

*int*\

**libregf\_error\_fprint**(*libregf\_error\_t \*error*, *FILE \*stream*);

*int*\

**libregf\_error\_sprint**(*libregf\_error\_t \*error*, *char \*string*, *size\_t size*);

*int*\

**libregf\_error\_backtrace\_fprint**(*libregf\_error\_t \*error*, *FILE \*stream*);

*int*\

**libregf\_error\_backtrace\_sprint**(*libregf\_error\_t \*error*, *char \*string*, *size\_t size*);

File functions

*int*\

**libregf\_file\_initialize**(*libregf\_file\_t \*\*file*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_free**(*libregf\_file\_t \*\*file*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_signal\_abort**(*libregf\_file\_t \*file*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_open**(*libregf\_file\_t \*file*, *const char \*filename*, *int access\_flags*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_close**(*libregf\_file\_t \*file*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_is\_corrupted**(*libregf\_file\_t \*file*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_get\_ascii\_codepage**(*libregf\_file\_t \*file*, *int \*ascii\_codepage*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_set\_ascii\_codepage**(*libregf\_file\_t \*file*, *int ascii\_codepage*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_get\_format\_version**(*libregf\_file\_t \*file*, *uint32\_t \*major\_version*, *uint32\_t \*minor\_version*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_get\_type**(*libregf\_file\_t \*file*, *uint32\_t \*file\_type*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_get\_root\_key**(*libregf\_file\_t \*file*, *libregf\_key\_t \*\*key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_get\_key\_by\_utf8\_path**(*libregf\_file\_t \*file*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libregf\_key\_t \*\*key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_file\_get\_key\_by\_utf16\_path**(*libregf\_file\_t \*file*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libregf\_key\_t \*\*key*, *libregf\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libregf\_file\_open\_wide**(*libregf\_file\_t \*file*, *const wchar\_t \*filename*, *int access\_flags*, *libregf\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libregf\_file\_open\_file\_io\_handle**(*libregf\_file\_t \*file*, *libbfio\_handle\_t \*file\_io\_handle*, *int access\_flags*, *libregf\_error\_t \*\*error*);

Key functions

*int*\

**libregf\_key\_free**(*libregf\_key\_t \*\*key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_is\_corrupted**(*libregf\_key\_t \*key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_offset**(*libregf\_key\_t \*key*, *off64\_t \*offset*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_name\_size**(*libregf\_key\_t \*key*, *size\_t \*name\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_name**(*libregf\_key\_t \*key*, *uint8\_t \*name*, *size\_t name\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf8\_name\_size**(*libregf\_key\_t \*key*, *size\_t \*utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf8\_name**(*libregf\_key\_t \*key*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf16\_name\_size**(*libregf\_key\_t \*key*, *size\_t \*utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf16\_name**(*libregf\_key\_t \*key*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_class\_name\_size**(*libregf\_key\_t \*key*, *size\_t \*class\_name\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_class\_name**(*libregf\_key\_t \*key*, *uint8\_t \*class\_name*, *size\_t class\_name\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf8\_class\_name\_size**(*libregf\_key\_t \*key*, *size\_t \*utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf8\_class\_name**(*libregf\_key\_t \*key*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf16\_class\_name\_size**(*libregf\_key\_t \*key*, *size\_t \*utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_utf16\_class\_name**(*libregf\_key\_t \*key*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_last\_written\_time**(*libregf\_key\_t \*key*, *uint64\_t \*filetime*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_security\_descriptor\_size**(*libregf\_key\_t \*key*, *size\_t \*security\_descriptor\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_security\_descriptor**(*libregf\_key\_t \*key*, *uint8\_t \*security\_descriptor*, *size\_t security\_descriptor\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_number\_of\_values**(*libregf\_key\_t \*key*, *int \*number\_of\_values*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_value\_by\_index**(*libregf\_key\_t \*key*, *int value\_index*, *libregf\_value\_t \*\*value*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_value\_by\_utf8\_name**(*libregf\_key\_t \*key*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libregf\_value\_t \*\*value*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_value\_by\_utf16\_name**(*libregf\_key\_t \*key*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libregf\_value\_t \*\*value*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_number\_of\_sub\_keys**(*libregf\_key\_t \*key*, *int \*number\_of\_sub\_keys*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_sub\_key\_by\_index**(*libregf\_key\_t \*key*, *int sub\_key\_index*, *libregf\_key\_t \*\*sub\_key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_sub\_key\_by\_utf8\_name**(*libregf\_key\_t \*key*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libregf\_key\_t \*\*sub\_key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_sub\_key\_by\_utf8\_path**(*libregf\_key\_t \*key*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libregf\_key\_t \*\*sub\_key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_sub\_key\_by\_utf16\_name**(*libregf\_key\_t \*key*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libregf\_key\_t \*\*sub\_key*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_key\_get\_sub\_key\_by\_utf16\_path**(*libregf\_key\_t \*key*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libregf\_key\_t \*\*sub\_key*, *libregf\_error\_t \*\*error*);

Value functions

*int*\

**libregf\_value\_free**(*libregf\_value\_t \*\*value*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_is\_corrupted**(*libregf\_value\_t \*value*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_offset**(*libregf\_value\_t \*value*, *off64\_t \*offset*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_name\_size**(*libregf\_value\_t \*value*, *size\_t \*name\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_name**(*libregf\_value\_t \*value*, *uint8\_t \*name*, *size\_t name\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_utf8\_name\_size**(*libregf\_value\_t \*value*, *size\_t \*utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_utf8\_name**(*libregf\_value\_t \*value*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_utf16\_name\_size**(*libregf\_value\_t \*value*, *size\_t \*utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_utf16\_name**(*libregf\_value\_t \*value*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_type**(*libregf\_value\_t \*value*, *uint32\_t \*value\_type*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_data\_size**(*libregf\_value\_t \*value*, *size\_t \*value\_data\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_data**(*libregf\_value\_t \*value*, *uint8\_t \*value\_data*, *size\_t value\_data\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_32bit**(*libregf\_value\_t \*value*, *uint32\_t \*value\_32bit*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_64bit**(*libregf\_value\_t \*value*, *uint64\_t \*value\_64bit*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_utf8\_string\_size**(*libregf\_value\_t \*value*, *size\_t \*utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_utf8\_string**(*libregf\_value\_t \*value*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_utf16\_string\_size**(*libregf\_value\_t \*value*, *size\_t \*utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_utf16\_string**(*libregf\_value\_t \*value*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_binary\_data\_size**(*libregf\_value\_t \*value*, *size\_t \*size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_binary\_data**(*libregf\_value\_t \*value*, *uint8\_t \*binary\_data*, *size\_t size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_value\_get\_value\_multi\_string**(*libregf\_value\_t \*value*, *libregf\_multi\_string\_t \*\*multi\_string*, *libregf\_error\_t \*\*error*);

Multi string functions

*int*\

**libregf\_multi\_string\_free**(*libregf\_multi\_string\_t \*\*multi\_string*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_multi\_string\_get\_number\_of\_strings**(*libregf\_multi\_string\_t \*multi\_string*, *int \*number\_of\_strings*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_multi\_string\_get\_utf8\_string\_size**(*libregf\_multi\_string\_t \*multi\_string*, *int string\_index*, *size\_t \*utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_multi\_string\_get\_utf8\_string**(*libregf\_multi\_string\_t \*multi\_string*, *int string\_index*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_multi\_string\_get\_utf16\_string\_size**(*libregf\_multi\_string\_t \*multi\_string*, *int string\_index*, *size\_t \*utf16\_string\_size*, *libregf\_error\_t \*\*error*);

*int*\

**libregf\_multi\_string\_get\_utf16\_string**(*libregf\_multi\_string\_t \*multi\_string*, *int string\_index*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libregf\_error\_t \*\*error*);

## DESCRIPTION

The **libregf\_get\_version**() function is used to retrieve the library version.

## RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libregf.h".

## ENVIRONMENT

None

## FILES

None

## NOTES

libregf can be compiled with wide character support (wchar\_t).

To compile libregf with wide character support use: *./configure* *--enable-wide-character-type=yes*\
  or define: *\_UNICODE*\
  or *UNICODE*\
  during compilation.

*LIBREGF\_WIDE\_CHARACTER\_TYPE*\
  in libregf/features.h can be used to determine if libregf was compiled with wide character support.

## BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libregf/issues

## AUTHOR

These man pages are generated from "libregf.h".

## COPYRIGHT

Copyright (C) 2009-2024, Joachim Metz \<joachim.metz@gmail.com\>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

the libregf.h include file
