mirror of
https://github.com/emptyynes/LIVM.git
synced 2025-10-28 21:28:55 +03:00
Add files via upload
This commit is contained in:
parent
d02a5d3dfd
commit
560bc596ad
16 changed files with 1053 additions and 439 deletions
11
faxm/freeform.lua
Normal file
11
faxm/freeform.lua
Normal 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
8
faxm/main.c
Normal 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
BIN
faxm/main.o
Normal file
Binary file not shown.
26
faxm/string.lua
Normal file
26
faxm/string.lua
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue