Skip to content

Commit

Permalink
Some minimal changes
Browse files Browse the repository at this point in the history
Added more corruption functions.
Translated all to english.
Remove non needed comments.
  • Loading branch information
viti95 committed Feb 13, 2020
1 parent a3e8ba1 commit a2f24d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
7 changes: 6 additions & 1 deletion plugins/corruptella/corruptella.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"KEYCODE_E": "fuckROM(0)",
"KEYCODE_R": "fuckSound(0)",
"KEYCODE_T": "fuckMusic(0)",
"KEYCODE_Y": "fuckVideo(0)"
"KEYCODE_Y": "fuckVideo(0)",
"KEYCODE_Z": "autofuck(8,8)",
"KEYCODE_X": "autofuckdevices(8,8)",
"KEYCODE_C": "autofuckregions(8,8)",
"KEYCODE_V": "autofuckshares(8,8)",
"KEYCODE_A": "minifuck(8,64)"
}
}
26 changes: 16 additions & 10 deletions plugins/corruptella/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- license:BSD-3-Clause
-- copyright-holders:Carl
-- copyright-holders:ViTi95
local exports = {}
exports.name = "corruptella"
exports.version = "0.0.1"
Expand Down Expand Up @@ -154,12 +154,12 @@ return ln.linenoise('\x1b[1;36m[Corruptella]\x1b[0m> ')
function getInfo()
print("\nDriver: " .. manager:machine():system().name .. "(" .. manager:machine():system().parent .. ")")

print ("\nPantallas:\n")
print ("\nScreens:\n")
for k,v in pairs(manager:machine().screens) do
print (k .. " (" .. v:width() .. "x" .. v:height() .. "@" .. v:refresh() .. ")")
end

print("\nDispositivos:\n")
print("\nDevices:\n")
for k,v in pairs(manager:machine().devices) do
print(v:name() .. " (" .. k .. ") ")

Expand Down Expand Up @@ -187,13 +187,13 @@ return ln.linenoise('\x1b[1;36m[Corruptella]\x1b[0m> ')
end
end

print("\nRegiones de memoria:\n")
print("\nMemory regions:\n")

for k,v in pairs(manager:machine():memory().regions) do
print(k .. ", " .. v.size)
end

print("\nMemoria compartida:\n")
print("\nShared memory:\n")

for k,v in pairs(manager:machine():memory().shares) do
print(k .. ", " .. v.size)
Expand Down Expand Up @@ -266,12 +266,8 @@ return ln.linenoise('\x1b[1;36m[Corruptella]\x1b[0m> ')
count = count + 1
end

--print(count)

local rndFuck = math.floor(math.random(1, count))

--print(rndFuck)

count = 0

for k,v in pairs(manager:machine().devices) do
Expand Down Expand Up @@ -306,6 +302,12 @@ return ln.linenoise('\x1b[1;36m[Corruptella]\x1b[0m> ')
end

function autofuck(bits, repetitions)
autofuckdevices(bits, repetitions)
autofuckregions(bits, repetitions)
autofuckshares(bits, repetitions)
end

function autofuckdevices(bits, repetitions)
for k,v in pairs(manager:machine().devices) do
if tablelength(v.spaces) > 0 then
for i,j in pairs (v.spaces) do
Expand All @@ -316,12 +318,16 @@ return ln.linenoise('\x1b[1;36m[Corruptella]\x1b[0m> ')
end
end
end

end

function autofuckregions(bits, repetitions)
for k,v in pairs(manager:machine():memory().regions) do
fuckMEM(k, bits, repetitions)
print(k .. ", " .. v.size)
end
end

function autofuckshares(bits, repetitions)
for k,v in pairs(manager:machine():memory().shares) do
fuckSHA(k, bits, repetitions)
print(k .. ", " .. v.size)
Expand Down

0 comments on commit a2f24d2

Please sign in to comment.