Merge pull request #445 from DrChat/kernel_trampolines

Generate trampoline functions for GetProcAddress on kernel modules
This commit is contained in:
Ben Vanik
2015-10-24 17:16:33 -07:00
4 changed files with 94 additions and 5 deletions

View File

@@ -61,6 +61,12 @@ bool RawModule::LoadFile(uint32_t base_address, const std::wstring& path) {
return true;
}
void RawModule::SetAddressRange(uint32_t base_address, uint32_t size) {
base_address_ = base_address;
low_address_ = base_address;
high_address_ = base_address + size;
}
bool RawModule::ContainsAddress(uint32_t address) {
return address >= low_address_ && address < high_address_;
}

View File

@@ -24,7 +24,12 @@ class RawModule : public Module {
bool LoadFile(uint32_t base_address, const std::wstring& path);
// Set address range if you've already allocated memory and placed code
// in it.
void SetAddressRange(uint32_t base_address, uint32_t size);
const std::string& name() const override { return name_; }
void set_name(const std::string& name) { name_ = name; }
bool ContainsAddress(uint32_t address) override;