Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local replacements = {
- ["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 comboReplacements = {
- ["a"] = "ɑ", ["e"] = "е", ["i"] = "і", ["o"] = "о",
- ["A"] = "Α", ["E"] = "Ε", ["I"] = "І", ["O"] = "Ο"
- }
- local function obfuscateText(str, isComboBox)
- local result = ""
- local changeCount = 0
- for i = 1, #str do
- local char = str:sub(i, i)
- if isComboBox then
- if comboReplacements[char] and changeCount < 2 then
- result = result .. comboReplacements[char]
- changeCount = changeCount + 1
- else
- result = result .. char
- end
- else
- result = result .. (replacements[char] or char)
- end
- 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[i]
- 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, false)
- end
- if (cls == "TComboBox" or cls == "TListBox") and child.Items then
- for j = 0, child.Items.Count - 1 do
- local itemText = child.Items[j]
- if itemText ~= "" then
- child.Items[j] = obfuscateText(itemText, true)
- end
- 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, false) end)
- processControls(form)
- end
- end
- collectgarbage("collect")
Advertisement
Add Comment
Please, Sign In to add comment