Initial commit

This commit is contained in:
2021-10-30 17:37:06 +03:00
commit 54f368e205
5 changed files with 267 additions and 0 deletions

28
brute_crc32.lua Normal file
View File

@@ -0,0 +1,28 @@
local crc32 = require 'crc32'
function edit_file(input_file, line, content)
local file = io.open(input_file, 'r')
local file_content = {}
for line in file:lines() do
table.insert(file_content, line)
end
io.close(file)
file_content[line] = content
file = io.open(input_file, 'w')
for index, value in ipairs(file_content) do
file:write(value..'\n')
end
io.close(file)
end
local attempts = 0
repeat
local random_crc32 = crc32.hash(attempts)
edit_file('i_know_my_crc32.lua', 13, "local crc32_expected = '" .. random_crc32 .. "'")
local match = require('i_know_my_crc32')
attempts = attempts + 1
print(attempts)
until(match)