Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to copy the names of all these classes?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 86

PostPosted: Sun Aug 30, 2026 9:48 pm    Post subject: How to copy the names of all these classes? Reply with quote

AI wrote a wrong piece of Lua code.

Code:

LaunchMonoDataCollector()

-- ==========================================
local MODULE_NAME = "Assembly-CSharp"
-- ==========================================

local assemblies = mono_enumAssemblies()
local found = false

for i, assemblyId in ipairs(assemblies) do
  local imageId = mono_getImageFromAssembly(assemblyId)
  local imageName = mono_image_get_name(imageId)

  if imageName and imageName == MODULE_NAME then
    print("--- 精确匹配到模块: " .. imageName .. " ---")
   
    local classes = mono_image_enumClasses(imageId)
    print("共枚举到 " .. #classes .. " 个类:")
    print("----------------------------------------")
   
    for j, classId in ipairs(classes) do
      local className = mono_class_getName(classId)
      local namespace = mono_class_getNamespace(classId)
      local fullName = (namespace and #namespace > 0) and (namespace .. "." .. className) or className
      print(fullName)
    end
   
    found = true
    break
  end
end


if not found then
  print("错误:未找到名为 '" .. MODULE_NAME .. "' 的模块。")
  print("当前进程加载的模块列表如下(请复制正确的名字):")
  print("----------------------------------------")
  for i, assemblyId in ipairs(assemblies) do
    local imageId = mono_getImageFromAssembly(assemblyId)
    local imageName = mono_image_get_name(imageId)
    if imageName then
      print(imageName)
    end
  end
end



leiming.JPG
 Description:
 Filesize:  205.43 KB
 Viewed:  426 Time(s)

leiming.JPG


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25997
Location: The netherlands

PostPosted: Sun Aug 30, 2026 11:15 pm    Post subject: Reply with quote

rightclick the class and choose copy to clipboard
_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 86

PostPosted: Sun Aug 30, 2026 11:51 pm    Post subject: Reply with quote

chatgpt has changed. Not long ago, it refused to provide the code for CE, but apparently it was persuaded otherwise.

change dotnetinfo.lua

Code:

-- Copy currently displayed Classes
frmDotNetInfo.btnCopyClasses=createButton(frmDotNetInfo.gbClasses)
frmDotNetInfo.btnCopyClasses.Caption='复制当前显示 Classes'
frmDotNetInfo.btnCopyClasses.Width=230
frmDotNetInfo.btnCopyClasses.Height=25

frmDotNetInfo.btnCopyClasses.AnchorSideLeft.Control=frmDotNetInfo.lblClasses
frmDotNetInfo.btnCopyClasses.AnchorSideLeft.Side=asrRight
frmDotNetInfo.btnCopyClasses.AnchorSideTop.Control=frmDotNetInfo.lblClasses
frmDotNetInfo.btnCopyClasses.AnchorSideTop.Side=asrTop
frmDotNetInfo.btnCopyClasses.BorderSpacing.Left=8
frmDotNetInfo.btnCopyClasses.Left=frmDotNetInfo.btnCopyClasses.Left+100
frmDotNetInfo.btnCopyClasses.Top=frmDotNetInfo.btnCopyClasses.Top-30


frmDotNetInfo.btnCopyClasses.OnClick=function(sender)

  local lv=frmDotNetInfo.lvClasses

  if not lv then
    showMessage('找不到 Classes 列表')
    return
  end

  local result={}

  -- 直接读取当前 ListView 显示的每一行
  local count=lv.Items.Count

  for i=0,count-1 do

    local item=lv.Items[i]

    if item then

      local text=item.Caption

      if text and text~='' then
        table.insert(result,text)
      end

    end

  end

  if #result==0 then
    showMessage(
      'Classes 列表中没有读取到项目。\n\n'..
      'Items.Count = '..tostring(count)
    )
    return
  end

  writeToClipboard(table.concat(result,'\r\n'))

  showMessage(
    '已复制 '..#result..' 个 Classes 到剪贴板。'
  )

end
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites