-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Everything needed to run simple Rust programs #40
Conversation
|
||
using random_bytes_engine = std::independent_bits_engine<std::default_random_engine, CHAR_BIT, unsigned char>; | ||
|
||
NTSTATUS WIN_FUNC BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password hashing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust's HashMap
uses random bytes as a seed. It's not actually using a BCrypt hash, but the BCryptGenRandom
function is a good place to get random bytes, apparently.
if (nSize < len) { | ||
return len; | ||
} | ||
const uint16_t *wideValue = stringToWideString(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memory leak; should we maybe add a version of stringToWideString that returns a vector<uint16_t>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, or maybe std::wstring
? Added a free()
for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wstring is UTF-32 on Linux, alas
Various improvements to support running sjiswrap for
mwcceppc.exe
.Of note:
LoadLibraryA
,GetModuleHandleA
,GetProcAddress
, etc..clang-format
and.clang-tidy
for editors.NtAllocateVirtualMemory
andNtProtectVirtualMemory
are fun, they're forsjiswrap
to map the sub-subprocess and execute it. Wrapper inception!