ReactOS 0.4.16-dev-197-g92996da
encode.c File Reference
#include <rtl.h>
#include <debug.h>
Include dependency graph for encode.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI RtlRunDecodeUnicodeString (IN UCHAR Hash, IN OUT PUNICODE_STRING String)
 
VOID NTAPI RtlRunEncodeUnicodeString (IN OUT PUCHAR Hash, IN OUT PUNICODE_STRING String)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file encode.c.

Function Documentation

◆ RtlRunDecodeUnicodeString()

VOID NTAPI RtlRunDecodeUnicodeString ( IN UCHAR  Hash,
IN OUT PUNICODE_STRING  String 
)

Definition at line 20 of file encode.c.

22{
23 PUCHAR ptr;
24 USHORT i;
25
26 ptr = (PUCHAR)String->Buffer;
27 if (String->Length > 1)
28 {
29 for (i = String->Length; i > 1; i--)
30 {
31 ptr[i - 1] ^= ptr[i - 2] ^ Hash;
32 }
33 }
34
35 if (String->Length >= 1)
36 {
37 ptr[0] ^= Hash | (UCHAR)0x43;
38 }
39}
static int Hash(const char *)
Definition: reader.c:2257
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
if(dx< 0)
Definition: linetemp.h:194
static PVOID ptr
Definition: dispmode.c:27
unsigned short USHORT
Definition: pedump.c:61
unsigned char * PUCHAR
Definition: typedefs.h:53
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by LsaApLogonUserEx2().

◆ RtlRunEncodeUnicodeString()

VOID NTAPI RtlRunEncodeUnicodeString ( IN OUT PUCHAR  Hash,
IN OUT PUNICODE_STRING  String 
)

Definition at line 43 of file encode.c.

45{
46 LARGE_INTEGER CurrentTime;
47 PUCHAR ptr;
48 USHORT i;
50
51 ptr = (PUCHAR) String->Buffer;
52 if (*Hash == 0)
53 {
54 Status = NtQuerySystemTime (&CurrentTime);
55 if (NT_SUCCESS(Status))
56 {
57 for (i = 1; i < sizeof(LARGE_INTEGER) && (*Hash == 0); i++)
58 *Hash |= *(PUCHAR)(((PUCHAR)&CurrentTime) + i);
59 }
60
61 if (*Hash == 0)
62 *Hash = 1;
63 }
64
65 if (String->Length >= 1)
66 {
67 ptr[0] ^= (*Hash) | (UCHAR)0x43;
68 if (String->Length > 1)
69 {
70 for (i = 1; i < String->Length; i++)
71 {
72 ptr[i] ^= ptr[i - 1] ^ (*Hash);
73 }
74 }
75 }
76}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:569
union _LARGE_INTEGER LARGE_INTEGER