libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
CryptGenRandom.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/* This file is automatically generated. Do not edit. */
17#pragma once
18
19#include <cstdint>
23#include <ostream>
24#include <string>
25
26namespace introvirt {
27namespace windows {
28namespace advapi32 {
29
35class CryptGenRandom final : public WindowsFunctionCall {
36 public:
39
40 uint32_t dwLen() const;
41 void dwLen(uint32_t dwLen);
42
44 void pbBuffer(const guest_ptr<uint8_t[]>& pbBuffer);
45
46 const std::string& function_name() const override;
47 const std::string& library_name() const override;
48 void write(std::ostream& os = std::cout) const override;
49 Json::Value json() const override;
50
51 bool result() const;
52 void result(bool result);
53
55 ~CryptGenRandom() override;
56
57 /* Injection helper */
58 static bool inject(HCRYPTPROV hProv, uint32_t dwLen, const guest_ptr<uint8_t[]>& pbBuffer);
59
60 static constexpr int ArgumentCount = 3;
61 inline static const std::string LibraryName = "advapi32";
62 inline static const std::string FunctionName = "CryptGenRandom";
63
64 private:
65 /* Injection constructor */
66 CryptGenRandom(Event& event, HCRYPTPROV hProv, uint32_t dwLen,
67 const guest_ptr<uint8_t[]>& pbBuffer);
68
69 private:
70 HCRYPTPROV hProv_;
71 uint32_t dwLen_;
72 guest_ptr<void> pbBuffer_;
73};
74
75} // namespace advapi32
76} // namespace windows
77} // namespace introvirt
Interface class for hypervisor events.
Definition Event.hh:43
Definition guest_ptr.hh:88
Helper class to transparently convert between guest size and a value.
Definition guest_size_t_ptr.hh:498
Definition WindowsFunctionCall.hh:31
Handler for advapi32!CryptGenRandom.
Definition CryptGenRandom.hh:35
void write(std::ostream &os=std::cout) const override
Write out a textual representation of the function for display.
static const std::string LibraryName
Definition CryptGenRandom.hh:61
static bool inject(HCRYPTPROV hProv, uint32_t dwLen, const guest_ptr< uint8_t[]> &pbBuffer)
void pbBuffer(const guest_ptr< uint8_t[]> &pbBuffer)
guest_ptr< uint8_t[]> pbBuffer() const
static const std::string FunctionName
Definition CryptGenRandom.hh:62
const std::string & function_name() const override
Get the function name.
const std::string & library_name() const override
Get the name of the library this call is for.
Json::Value json() const override
Get the function as Json.
static constexpr int ArgumentCount
Definition CryptGenRandom.hh:60
Type-safe guest virtual address pointer and guest_ptr template.
Core IntroVirt classes.
Definition Cr0.hh:20