From 59db771f970e70638461afb4bf8a2da895540c3c Mon Sep 17 00:00:00 2001 From: vxunderground <57078196+vxunderground@users.noreply.github.com> Date: Thu, 14 Jul 2022 22:10:59 -0500 Subject: [PATCH] Add files via upload --- String Manipulation/RfCopyMemory.cpp | 10 ++++++++++ String Manipulation/StringLength.cpp | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 String Manipulation/RfCopyMemory.cpp create mode 100644 String Manipulation/StringLength.cpp diff --git a/String Manipulation/RfCopyMemory.cpp b/String Manipulation/RfCopyMemory.cpp new file mode 100644 index 0000000..229f368 --- /dev/null +++ b/String Manipulation/RfCopyMemory.cpp @@ -0,0 +1,10 @@ +PVOID RfCopyMemory(PVOID Destination, CONST PVOID Source, SIZE_T Length) +{ + PBYTE D = (PBYTE)Destination; + PBYTE S = (PBYTE)Source; + + while (Length--) + *D++ = *S++; + + return Destination; +} diff --git a/String Manipulation/StringLength.cpp b/String Manipulation/StringLength.cpp new file mode 100644 index 0000000..92cab3d --- /dev/null +++ b/String Manipulation/StringLength.cpp @@ -0,0 +1,17 @@ +SIZE_T StringLengthA(LPCSTR String) +{ + LPCSTR String2; + + for (String2 = String; *String2; ++String2); + + return (String2 - String); +} + +SIZE_T StringLengthW(LPCWSTR String) +{ + LPCWSTR String2; + + for (String2 = String; *String2; ++String2); + + return (String2 - String); +} \ No newline at end of file