Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local custom_map = {
- ['a']='a', ['b']='b', ['c']='c', ['d']='d', ['e']='e', ['f']='f', ['g']='g',
- ['h']='h', ['i']='i', ['j']='j', ['k']='k', ['l']='l', ['m']='m', ['n']='n',
- ['o']='o', ['p']='p', ['q']='q', ['r']='r', ['s']='s', ['t']='t', ['u']='u',
- ['v']='v', ['w']='w', ['x']='x', ['y']='y', ['z']='z',
- ['A']='A', ['B']='B', ['C']='C', ['D']='D', ['E']='E', ['F']='F', ['G']='G',
- ['H']='H', ['I']='I', ['J']='J', ['K']='K', ['L']='L', ['M']='M', ['N']='N',
- ['O']='O', ['P']='P', ['Q']='Q', ['R']='R', ['S']='S', ['T']='T', ['U']='U',
- ['V']='V', ['W']='W', ['X']='X', ['Y']='Y', ['Z']='Z'
- }
- local function obfuscateText(str)
- local result = ""
- for i = 1, #str do
- local char = str:sub(i, i)
- result = result .. (custom_map[char] or char)
- end
- return result
- end
- local function processControls(comp)
- if not comp then return end
- local success, count = pcall(function() return comp.ComponentCount end)
- if not success then return end
- for i = 0, count - 1 do
- local child = comp.Component
- if child then
- local cls = child.ClassName
- if cls ~= "TEdit" and cls ~= "TMemo" and cls ~= "TRichEdit" then
- pcall(function()
- if child.Caption and child.Caption ~= "" then
- child.Caption = obfuscateText(child.Caption)
- end
- if cls == "TComboBox" or cls == "TListBox" then
- for j = 0, child.Items.Count - 1 do
- child.Items[j] = obfuscateText(child.Items[j])
- end
- end
- end)
- end
- processControls(child)
- end
- end
- end
- local fCount = getFormCount()
- for i = 0, fCount - 1 do
- local form = getForm(i)
- if form then
- pcall(function() form.Caption = obfuscateText(form.Caption) end)
- processControls(form)
- end
- end
- collectgarbage("collect")
Advertisement
Add Comment
Please, Sign In to add comment