Aproximación al cifrado y descifrado en PowerShell

 

Codificar en Base64 paso a paso con PowerShell

Windows services (detailed)

 

Windows services

 

Realizar captura de pantalla y guardar con formato de imagen de mapa de bits (BMP)

 

shmctl (System Call)

NAME

shmctl – XSI shared memory control operations

SYNOPSIS

DESCRIPTION

The shmctl() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object). It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.

The shmctl() function provides a variety of shared memory control operations as specified by cmd. The following values for cmd are available:

IPC_STAT

Place the current value of each member of the shmid_ds data structure associated with shmid into the structure pointed to by buf. The contents of the structure are defined in <sys/shm.h>.

IPC_SET

Set the value of the following members of the shmid_ds data structure associated with shmid to the corresponding value found in the structure pointed to by buf:
shm_perm.uid
shm_perm.gid
shm_perm.mode Low-order nine bits.
IPC_SET can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of shm_perm.cuid or shm_perm.uid in the shmid_ds data structure associated with shmid.

IPC_RMID

Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and shmid_ds data structure associated with it. IPC_RMID can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of shm_perm.cuid or shm_perm.uid in the shmid_ds data structure associated with shmid.

RETURN VALUE

Upon successful completion, shmctl() shall return 0; otherwise, it shall return -1 and set errno to indicate the error.

ERRORS

The shmctl() function shall fail if:

[EACCES]
The argument cmd is equal to IPC_STAT and the calling process does not have read permission; see XSI Interprocess Communication.
[EINVAL]
The value of shmid is not a valid shared memory identifier, or the value of cmd is not a valid command.
[EPERM]
The argument cmd is equal to IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of a process with appropriate privileges and it is not equal to the value of shm_perm.cuid or shm_perm.uid in the data structure associated with shmid.

The shmctl() function may fail if:

[EOVERFLOW]
The cmd argument is IPC_STAT and the gid or uid value is too large to be stored in the structure pointed to by the buf argument.

ftok (System Call)

NAME

ftok – generate an IPC key

SYNOPSIS

DESCRIPTION

The ftok() function shall return a key based on path and id that is usable in subsequent calls to msgget(), semget(), and shmget(). The application shall ensure that the path argument is the pathname of an existing file that the process is able to stat().

The ftok() function shall return the same key value for all paths that name the same file, when called with the same id value, and return different key values when called with different id values or with paths that name different files existing on the same file system at the same time. It is unspecified whether ftok() shall return the same key value when called again after the file named by path is removed and recreated with the same name.

Only the low-order 8-bits of id are significant. The behavior of ftok() is unspecified if these bits are 0.

RETURN VALUE

Upon successful completion, ftok() shall return a key. Otherwise, ftok() shall return (key_t)-1 and set errno to indicate the error.

ERRORS

The ftok() function shall fail if:

[EACCES]
Search permission is denied for a component of the path prefix.

[ELOOP]
A loop exists in symbolic links encountered during resolution of the path argument

[ENAMETOOLONG]
The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.

[ENOENT]
A component of path does not name an existing file or path is an empty string

[ENOTDIR]
A component of the path prefix is not a directory.

The ftok() function may fail if:

[ELOOP]
More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.

[ENAMETOOLONG]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.

umask (System Call)

NAME

umask – set and get the file mode creation mask

SYNOPSIS

DESCRIPTION

The umask() function shall set the process‘ file mode creation mask to cmask and return the previous value of the mask. Only the file permission bits of cmask (see <sys/stat.h>) are used; the meaning of the other bits is implementation-defined.

The process‘ file mode creation mask is used to turn off permission bits in the mode argument supplied during calls to the following functions:

  • open(), creat(), mkdir(), and mkfifo()
  • mknod()
  • mq_open()
  • sem_open()

Bit positions that are set in cmask are cleared in the mode of the created file.

RETURN VALUE

The file permission bits in the value returned by umask() shall be the previous value of the file mode creation mask. The state of any other bits in that value is unspecified, except that a subsequent call to umask() with the returned value as cmask shall leave the state of the mask the same as its state before the first call, including any unspecified use of those bits.

ERRORS

No errors are defined.