Add files via upload

This commit is contained in:
Ærþ 2022-04-09 04:20:48 +07:00 committed by GitHub
parent d02a5d3dfd
commit 560bc596ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1053 additions and 439 deletions

11
faxm/freeform.lua Normal file
View file

@ -0,0 +1,11 @@
return {
source = function(source)
return source:gsub("\n", ""):gsub("]", "];"):gsub(":", ":;")
end,
any_line = function(line)
return line:trim():gsub("%s+", " ")
end,
line = function(line)
return line:gsub(",", " "):gsub("%s+", " "):split" "
end
}

8
faxm/main.c Normal file
View file

@ -0,0 +1,8 @@
#include <stdio.h>
void main() {
unsigned long long int x[] = {0x6f77206f6c6c6568, 0x0000000000646c72};
char* y = (char*)x;
puts(y);
}

BIN
faxm/main.o Normal file

Binary file not shown.

26
faxm/string.lua Normal file
View file

@ -0,0 +1,26 @@
return {
source = function(source)
while source:match[[|"[^"]+"]] do
local s = source:match[[|"[^"]+"]]
local ss = s
s = s:sub(3, #s - 1)
local r = {}
for i = 0, math.floor(#s / 8) do
local t = s:sub(i * 8 + 1, (i + 1) * 8)
while #t < 8 do t = t .. "\0" end
t = {string.byte(t, 1, -1)}
local rt = {}
for i = 1, 8 do rt[9 - i] = t[i] end
for i = 1, 8 do rt[i] = string.format("%02x", rt[i]) end
if table.concat(rt, "") ~= "0000000000000000" then
r[#r + 1] = "|x" .. table.concat(rt, "")
end
end
local function regexEscape(str)
return str:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1")
end
source = source:gsub(regexEscape(ss), table.concat(r, ", "))
end
return source
end
}