Вопрос сверху (Если можно, то и гет процессора через ffi )
local MaterialAdapterInfo_t = ffi.typeof([[
struct {
char m_pDriverName[512];
unsigned int m_VendorID;
unsigned int m_DeviceID;
unsigned int m_SubSysID;
unsigned int m_Revision;
int m_nDXSupportLevel;
int m_nMinDXSupportLevel;
int m_nMaxDXSupportLevel;
unsigned int m_nDriverVersionHigh;
unsigned int m_nDriverVersionLow;
}
]])
local get_current_adapter = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 25, 'int(__thiscall*)(void*)')
local get_adapter_info = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 26, 'void(__thiscall*)(void*, int, void*)')
local current_adapter = get_current_adapter()
local adapter_struct = ffi.new(MaterialAdapterInfo_t)
get_adapter_info(current_adapter, adapter_struct)
local vendorId = tostring(adapter_struct['m_VendorID'])
local deviceId = tostring(adapter_struct['m_DeviceID'])
Можно пример использованияКод:local MaterialAdapterInfo_t = ffi.typeof([[ struct { char m_pDriverName[512]; unsigned int m_VendorID; unsigned int m_DeviceID; unsigned int m_SubSysID; unsigned int m_Revision; int m_nDXSupportLevel; int m_nMinDXSupportLevel; int m_nMaxDXSupportLevel; unsigned int m_nDriverVersionHigh; unsigned int m_nDriverVersionLow; } ]]) local get_current_adapter = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 25, 'int(__thiscall*)(void*)') local get_adapter_info = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 26, 'void(__thiscall*)(void*, int, void*)') local current_adapter = get_current_adapter() local adapter_struct = ffi.new(MaterialAdapterInfo_t) get_adapter_info(current_adapter, adapter_struct) local vendorId = tostring(adapter_struct['m_VendorID']) local deviceId = tostring(adapter_struct['m_DeviceID'])
Можно пример использования
Можно пример использования (не шарю просто)
local ffi = require 'ffi'
local hwid_lock = {
"3369050214" -- ME
}
local MaterialAdapterInfo_t = ffi.typeof([[
struct {
char m_pDriverName[512];
unsigned int m_VendorID;
unsigned int m_DeviceID;
unsigned int m_SubSysID;
unsigned int m_Revision;
int m_nDXSupportLevel;
int m_nMinDXSupportLevel;
int m_nMaxDXSupportLevel;
unsigned int m_nDriverVersionHigh;
unsigned int m_nDriverVersionLow;
}
]])
local get_current_adapter = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 25, 'int(__thiscall*)(void*)')
local get_adapter_info = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 26, 'void(__thiscall*)(void*, int, void*)')
local current_adapter = get_current_adapter()
local adapter_struct = ffi.new(MaterialAdapterInfo_t)
get_adapter_info(current_adapter, adapter_struct)
local vendorId = tostring(adapter_struct['m_VendorID'])
local deviceId = tostring(adapter_struct['m_DeviceID'])
local you = vendorId..deviceId
local gayporno = string.format("%x", you * 255)
local access = false
for you, value in pairs(hwid_lock) do
if value == gayporno then
access = true
end
end
if access then
do_smth()
else
close_with_error()
end
не работаетне пробовал, но должно работатьКод:local ffi = require 'ffi' local hwid_lock = { "3369050214" -- ME } local MaterialAdapterInfo_t = ffi.typeof([[ struct { char m_pDriverName[512]; unsigned int m_VendorID; unsigned int m_DeviceID; unsigned int m_SubSysID; unsigned int m_Revision; int m_nDXSupportLevel; int m_nMinDXSupportLevel; int m_nMaxDXSupportLevel; unsigned int m_nDriverVersionHigh; unsigned int m_nDriverVersionLow; } ]]) local get_current_adapter = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 25, 'int(__thiscall*)(void*)') local get_adapter_info = vtable_bind('materialsystem.dll', 'VMaterialSystem080', 26, 'void(__thiscall*)(void*, int, void*)') local current_adapter = get_current_adapter() local adapter_struct = ffi.new(MaterialAdapterInfo_t) get_adapter_info(current_adapter, adapter_struct) local vendorId = tostring(adapter_struct['m_VendorID']) local deviceId = tostring(adapter_struct['m_DeviceID']) local you = vendorId..deviceId local gayporno = string.format("%x", you * 255) local access = false for you, value in pairs(hwid_lock) do if value == gayporno then access = true end end if access then do_smth() else close_with_error() end
плохоне работает
мне не нужна архетиктура процессора , надо названиеплохо
local vtable = {}
local __thiscall = function(func, this)
return function(...) return func(this, ...) end
end
local interface_ptr = ffi.typeof("void***")
vtable.bind = function(module, interface, index, typedef)
local addr = ffi.cast("void***", utils.create_interface(module, interface)) or error(interface .. " was not found")
return __thiscall(ffi.cast(typedef, addr[0][index]), addr)
end
vtable.entry = function(instance, i, ct)
return ffi.cast(ct, ffi.cast(interface_ptr, instance)[0][i])
end
local MaterialAdapterInfo_t = ffi.typeof([[
struct {
char m_pDriverName[512];
unsigned int m_VendorID;
unsigned int m_DeviceID;
unsigned int m_SubSysID;
unsigned int m_Revision;
int m_nDXSupportLevel;
int m_nMinDXSupportLevel;
int m_nMaxDXSupportLevel;
unsigned int m_nDriverVersionHigh;
unsigned int m_nDriverVersionLow;
}
]])
local get_current_adapter = vtable.bind('materialsystem.dll', 'VMaterialSystem080', 25, 'int(__thiscall*)(void*)')
local get_adapter_info = vtable.bind('materialsystem.dll', 'VMaterialSystem080', 26, 'void(__thiscall*)(void*, int, void*)')
local current_adapter = get_current_adapter()
local adapter_struct = ffi.new(MaterialAdapterInfo_t)
get_adapter_info(current_adapter, adapter_struct)
local driverName = tostring(ffi.string(adapter_struct['m_pDriverName']))
tyreally aint that hard
code_language.lua:local vtable = {} local __thiscall = function(func, this) return function(...) return func(this, ...) end end local interface_ptr = ffi.typeof("void***") vtable.bind = function(module, interface, index, typedef) local addr = ffi.cast("void***", utils.create_interface(module, interface)) or error(interface .. " was not found") return __thiscall(ffi.cast(typedef, addr[0][index]), addr) end vtable.entry = function(instance, i, ct) return ffi.cast(ct, ffi.cast(interface_ptr, instance)[0][i]) end local MaterialAdapterInfo_t = ffi.typeof([[ struct { char m_pDriverName[512]; unsigned int m_VendorID; unsigned int m_DeviceID; unsigned int m_SubSysID; unsigned int m_Revision; int m_nDXSupportLevel; int m_nMinDXSupportLevel; int m_nMaxDXSupportLevel; unsigned int m_nDriverVersionHigh; unsigned int m_nDriverVersionLow; } ]]) local get_current_adapter = vtable.bind('materialsystem.dll', 'VMaterialSystem080', 25, 'int(__thiscall*)(void*)') local get_adapter_info = vtable.bind('materialsystem.dll', 'VMaterialSystem080', 26, 'void(__thiscall*)(void*, int, void*)') local current_adapter = get_current_adapter() local adapter_struct = ffi.new(MaterialAdapterInfo_t) get_adapter_info(current_adapter, adapter_struct) local driverName = tostring(ffi.string(adapter_struct['m_pDriverName']))
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz