Code Monkey home page Code Monkey logo

Comments (7)

tandasat avatar tandasat commented on June 9, 2024

Hi,

To compile code with STL (containers), kernel_stl.h needs to be included before including any STL headers. Please try with the header and let me know if that works for you.

Thank you,

from ddimon.

mor619dx avatar mor619dx commented on June 9, 2024

It does compile now, however I had some problems.
After isolating the problem it seems that std::vector is not working if the std::vector variable is a class variable.

I instead created pointer to the vector and initialize it using "new" in the initialize function,
when I'm done I use delete of course.

There is another thing that i've seen happening, wierdly happening only when using the ddimon (without any of my additional code) - I use WinDBG to track debug prints. Sometimes after using WinDBG and closing it while ddimon is installed I reopen it and try to capture kernel debug output and I get this message:

ddimon_windbg

Only after restarting I can use WinDBG again. Did you experience something like this / do you know why it's happening?

from ddimon.

tandasat avatar tandasat commented on June 9, 2024

Hi,

As for the first issue. are you using the vector inside a global object? If you place a std::vector object directly as a global object, its contractor should be called, but I am not sure when it is placed inside a plain struct (w/ no constructor). Can you share the struct declaration?

For the issue with DebugView, does this happen only when DdiMon (or HyperPlatform) is loaded? I have seen the same issue on Windows 10, but I seemed to happen regardless of if you installed DdiMon.

from ddimon.

mor619dx avatar mor619dx commented on June 9, 2024

I think the constructor of std::vector is just not being called since creating class object is not calling the constructor of the class (this is the reason for the seperate initialize function),
to create the class object I allocate it using ExAllocatePoolWithTag and than in the initialize function I create the std::vector and save it's pointer.

If I use it as a class member:

class container
{
public:
    container(); // If I create class object this is not being called
    ~container(); // Neither is this

    bool add_module(module* app_module);
    module* get_module(void* addr);
    bool is_in_container(void* addr);

    bool initialize();
    void finalize();
private:
    ModulesMap* m_modules_map;

    std::vector<module*> m_modules; // I instead use std::vector<module*>* to later create the std::vector
};

and the initialize function:

bool
container::initialize() {
    m_modules_map = static_cast<ModulesMap*>(ModulesMapInitialization());
    if (nullptr == m_modules_map) {
        return false;
    }

    m_modules = new std::vector<module*>;

    return true;
}

and just use it as:
m_modules->push_back(app_module);

The second issue:
I do use windows 10 for testing, you are right I recheck and it seems it happens after I open windbg second time with kernel debugging turn on.

Accidently close the issue

from ddimon.

tandasat avatar tandasat commented on June 9, 2024

Thank you for sharing the code. Right, constructor would not be called when ExAllocatePoolWithTag() or anything other than 'new' is used. It is an expected behaviour. If you use new or construct an object on stack or as a global object, its constructor should be called. To avoid new/delete, this can be an option.

from ddimon.

mor619dx avatar mor619dx commented on June 9, 2024

Yeah I remember trying to use new but without kernel_stl functionality it didn't work, therefor I used allocation function instead of just creating class object (now that I know I can use new I will convert the code).

I have another unrelated question: When I install ddimon I see some lag in the programs running (the most obvious is gui apps), so for example if I run calc and move it's window fast it seems smooth but after I install ddimon and move the window it seems like it's stuttering.
I thought it might be the hooks, but after removing them it still seem to stutter.

Have any idea why this is happening / what part of the hypervisor causing it?

edit: nevermind I have kinda weird behavior of sometimes it stutter and sometimes it doesn't, if I will find the cause I will update.

Thanks for all the help!

from ddimon.

tandasat avatar tandasat commented on June 9, 2024

You are welcome.

from ddimon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.