added cackle???

Cackle is a acl for rust crates, to prevent dependency injection attacks. Maybe??
This commit is contained in:
raphy 2023-10-20 00:25:59 +02:00
parent 40daf685ff
commit f64747dc93
3 changed files with 129 additions and 94 deletions

126
cackle.toml Normal file
View File

@ -0,0 +1,126 @@
[common]
version = 2
import_std = [
"fs",
"net",
"process",
]
[sandbox]
kind = "Disabled"
[pkg.time-macros]
allow_proc_macro = true
allow_unsafe = true
[pkg.clap_derive]
allow_proc_macro = true
[pkg.bitflags]
allow_unsafe = true
[pkg.anstyle-query]
allow_unsafe = true
[pkg.utf8parse]
allow_unsafe = true
[pkg.unicode-ident]
allow_unsafe = true
[pkg.lazy_static]
allow_unsafe = true
[pkg.anstyle]
allow_unsafe = true
[pkg.itoa]
allow_unsafe = true
[pkg.quote]
build.allow_apis = [
"process",
]
[pkg.io-lifetimes]
build.allow_apis = [
"process",
]
allow_unsafe = true
[pkg.rustix]
build.allow_apis = [
"fs",
"process",
]
allow_unsafe = true
[pkg.proc-macro2]
build.allow_apis = [
"process",
]
allow_unsafe = true
[pkg.libc]
build.allow_apis = [
"process",
]
allow_unsafe = true
[pkg.clap_lex]
allow_unsafe = true
[pkg.linux-raw-sys]
allow_unsafe = true
[pkg.log]
allow_unsafe = true
[pkg.once_cell]
allow_unsafe = true
[pkg.anstyle-parse]
allow_unsafe = true
[pkg.atty]
allow_unsafe = true
[pkg.colored]
allow_unsafe = true
[pkg.time]
allow_unsafe = true
[pkg.syn]
allow_unsafe = true
[pkg.is-terminal]
allow_unsafe = true
[pkg.simple_logger]
allow_unsafe = true
[pkg.anstream]
allow_unsafe = true
[pkg.dekejit]
test.allow_unsafe = true
allow_unsafe = true
allow_apis = [
"fs",
]
[pkg.clap_builder]
allow_apis = [
"fs",
]
[pkg.num_threads]
allow_apis = [
"fs",
]
[api.process]
include = [
"rustix::process",
]

View File

@ -1,10 +1,10 @@
use std::mem::transmute; use std::mem::transmute;
pub mod assembler;
pub mod cli;
pub mod cpu; pub mod cpu;
pub mod jit; pub mod jit;
pub mod loader; pub mod loader;
pub mod cli;
pub mod assembler;
pub mod pretty_printers; pub mod pretty_printers;
// //
@ -23,7 +23,6 @@ pub fn interpret_as_unsigned(x: i16) -> u16 {
} }
pub fn transmute_to_vecu16_as_is(x: Vec<u8>) -> Vec<u16> { pub fn transmute_to_vecu16_as_is(x: Vec<u8>) -> Vec<u16> {
let mut rb = x.iter(); let mut rb = x.iter();
// raw_bytes must be converted to u16. // raw_bytes must be converted to u16.
// //
@ -56,7 +55,6 @@ pub fn transmute_to_vecu16_as_is(x: Vec<u8>) -> Vec<u16> {
} }
pub fn transmute_to_vecu8_as_is(x: Vec<u16>) -> Vec<u8> { pub fn transmute_to_vecu8_as_is(x: Vec<u16>) -> Vec<u8> {
let mut bytes = vec![]; let mut bytes = vec![];
for b in x.iter() { for b in x.iter() {

View File

@ -76,7 +76,7 @@ fn draw_section(sec: Section) -> String {
} }
}, },
SectionContent::CString(s) => res.push_str(&s), SectionContent::CString(s) => res.push_str(&format_line(&s, 8, TERMSIZE)),
SectionContent::CVec() => todo!(), SectionContent::CVec() => todo!(),
} }
@ -131,92 +131,3 @@ fn draw_separator(len: u8) -> String {
} }
// fn wrap_in_bars(&str, indentation: u8) -> String {
//
//
//
// }
// ┄
// ┅
// ┆
// ┇
// ┈
// ┉
// ┊
// ┋
// ┌
// ┍
// ┎
// ┏
// ┐
// ┑
// ┒
// ┓
// └
// ┕
// ┖
// ┗
// ┘
// ┙
// ┚
// ┛
// ├
// ┝
// ┞
// ┟
// ┠
// ┡
// ┢
// ┣
// ┤
// ┥
// ┦
// ┧
// ┨
// ┩
// ┪
// ┫
// ┬
// ┭
// ┮
// ┯
// ┰
// ┱
// ┲
// ┳
// ┴
// ┵
// ┶
// ┷
// ┸
// ┹
// ┺
// ┻
// ┼
// ┽
// ┾
// ┿
// ╀
// ╁
// ╂
// ╃
// ╄
// ╅
// ╆
// ╇
// ╈
// ╉
// ╊
// ╋
// ╌
// ╍
// ╎
// ╏
// ═
// ║
// ╒
// ╓