Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
✨ v1.6.2 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
JumperBot authored Dec 22, 2022
1 parent 12fa411 commit 34a9c69
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 162 deletions.
47 changes: 0 additions & 47 deletions .devcontainer/devcontainer.json

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

17 changes: 8 additions & 9 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| LATEST | :white_check_mark: |
Expand All @@ -15,19 +12,21 @@ currently being supported with security updates.

## Reporting a Vulnerability

After reading this, you should be all means go [**over here**](https://github.com/JumperBot/Unsafe-4-Bit/security/advisories/new).
After reading this, you should be, by all means go [**over here**](https://github.com/JumperBot/Unsafe-4-Bit/security/advisories/new).

A `security issue` can be something that strikes through someone's privacy or destroy the host machine by any manner.
A `security issue` can be something that strikes through someone's privacy or destroy the host's machine by any manner.

---

## Submitting Troll Issues
`Trolls` or `Troll issues` will be `declined`, if ever you submit at least one troll issue:
`Trolls` or `Troll issues` will be `declined`.

If ever you submit at least one troll issue:
- That issue will be `declined`.
- You are to never to be believed forever.
- Future issues from you, normal issues or security issues, will be labeled as `invalid` or `declined`.
- You are never to be believed forever.
- Any future issues from you, will be labeled as `invalid`, `declined` or `troll`.

Security is very seriouss, there is no valid reason to troll about it.
Security is very serious, there is no valid reason to troll about it.

---

Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified build/aarch64-unknown-linux-gnu/ufb
Binary file not shown.
Binary file modified build/aarch64-unknown-linux-musl/ufb
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions src/Cargo.lock

This file was deleted.

2 changes: 1 addition & 1 deletion src/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ufb"
version = "1.6.1"
version = "1.6.2"
edition = "2021"
license = "GPL-3.0-or-later"

Expand Down
9 changes: 7 additions & 2 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@ UFB_RELEASE_BIN_DIR="../build/aarch64-unknown-linux-gnu"
UFB_RELEASE_BIN_MUSL_DIR="../build/aarch64-unknown-linux-musl"
UFB_RELEASE_BIN="$UFB_RELEASE_BIN_DIR/ufb"
UFB_RELEASE_BIN_MUSL="$UFB_RELEASE_BIN_MUSL_DIR/ufb"
RUSTFLAGS="--remap-path-prefix $HOME=~"

rustfmt src/*
rm $UFB_RELEASE_BIN
rm $UFB_RELEASE_BIN_MUSL
rm ../build/*.tar
cargo clean

cargo build -r
cargo build -r --target=aarch64-unknown-linux-musl
mv -f "$UFB_RELEASE_BIN_TEMP" "$UFB_RELEASE_BIN"
mv -f "$UFB_RELEASE_BIN_TEMP_MUSL" "$UFB_RELEASE_BIN_MUSL"

UFB_RELEASE_VERSION="$(cat Cargo.toml | grep "version" | cut -d'"' -f 2)"
tar -cf "../build/Unsafe-4-Bit_v"$UFB_RELEASE_VERSION"_aarch64-unknown-linux-gnu.tar" -C $UFB_RELEASE_BIN_DIR .
tar -cf "../build/Unsafe-4-Bit_v"$UFB_RELEASE_VERSION"_aarch64-unknown-linux-musl.tar" -C $UFB_RELEASE_BIN_MUSL_DIR .
tar -cf "../build/Unsafe-4-Bit_v"$UFB_RELEASE_VERSION"_aarch64-unknown-linux-gnu.tar" -C $UFB_RELEASE_BIN_DIR . --numeric-owner
tar -cf "../build/Unsafe-4-Bit_v"$UFB_RELEASE_VERSION"_aarch64-unknown-linux-musl.tar" -C $UFB_RELEASE_BIN_MUSL_DIR . --numeric-owner
sudo rm target -r

rm Cargo.lock
39 changes: 12 additions & 27 deletions src/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
use crate::memory_map::MemoryMap;
use crate::universal::Universal;

pub struct Command {
pub compiled: Vec<u8>,
pub errors: String,
pub cancel_optimization: bool,
}
pub struct Command {}

impl Command {
/*
Expand All @@ -44,18 +40,16 @@ impl Command {
* 19 - 00010011 - wfunc
* 20 - 00010100 - dfunc
**/
pub fn new(line: &Vec<String>, real_line: &Vec<String>, binary_map: &MemoryMap) -> Command {
if !binary_map.contains_key(&line[0].to_lowercase()) {
let unrecognized: Box<UnrecognizedCommand> =
UnrecognizedCommand::create(&real_line, &line);
return Command {
compiled: Vec::<u8>::new(),
errors: unrecognized.analyze(),
cancel_optimization: true,
};
pub fn new(
line: &Vec<String>,
real_line: &Vec<String>,
binary_map: &MemoryMap,
) -> Result<Vec<u8>, String> {
let com_str: String = line[0].to_lowercase();
if !binary_map.contains_key(&com_str) {
return Err(UnrecognizedCommand::create(&real_line, &line).analyze());
}
let mut cancel_optimization: bool = false;
let ind: u64 = binary_map.get(&line[0].to_lowercase());
let ind: u64 = binary_map.get(&com_str);
let command: Box<dyn GenericCommand> = match ind {
0 => WvarCommand::create(&real_line, &line),
1 => NvarCommand::create(&real_line, &line),
Expand All @@ -65,7 +59,6 @@ impl Command {
(10..=13) => JumpCommand::create(&real_line, &line),
14 => PrintCommand::create(&real_line, &line),
(15..=20) => {
cancel_optimization = true;
match ind {
15 => ReadCommand::create(&real_line, &line),
16 => WfileCommand::create(&real_line, &line),
Expand All @@ -80,17 +73,9 @@ impl Command {
};
let err: String = command.analyze();
if !err.is_empty() {
return Command {
compiled: Vec::<u8>::new(),
errors: err,
cancel_optimization: true,
};
return Err(err);
}
return Command {
compiled: command.compile(),
errors: String::new(),
cancel_optimization: cancel_optimization,
};
return Ok(command.compile());
}

pub fn check_arg_length_using_limit(
Expand Down
2 changes: 1 addition & 1 deletion src/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() {
let flags: FlagManager = FlagManager::new(&env::args().collect::<Vec<String>>());
if flags.version_flag {
// TODO: Always Change Version Tag Here And At Cargo.toml
println!("UFB Version: v1.6.1\nFlag Triggered, Continuing Anyway...\n\n");
println!("UFB Version: v1.6.2\nFlag Triggered, Continuing Anyway...\n\n");
}
if flags.license_flag {
println!(
Expand Down
25 changes: 11 additions & 14 deletions src/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,22 +357,19 @@ impl Runner {
while com != &(self.byte_ind.len() as u16) && self.ptr < self.file_size {
self.byte_ind.push(self.ptr.clone());
let cur: u8 = self.next();
match cur{
0 => self.ptr+=self.next() as u64,
1 => self.ptr+=1,
2..=8 => self.ptr+=2,
match cur {
0 => self.ptr += self.next() as u64,
1 => self.ptr += 1,
2..=8 => self.ptr += 2,
9 => (),
10..=13 => self.ptr+=4,
14 => self.ptr+=self.next() as u64,
15 => self.ptr+=1,
16 => self.ptr+=self.next() as u64,
17 => self.ptr+=self.next() as u64,
18 => self.ptr+=self.next() as u64,
10..=13 => self.ptr += 4,
14 => self.ptr += self.next() as u64,
15 => self.ptr += 1,
16 => self.ptr += self.next() as u64,
17 => self.ptr += self.next() as u64,
18 => self.ptr += self.next() as u64,
// TODO: Add Other Commands
_ => panic!(
"You Forgot To Add Command Number {cur} To The Skip Index... As Always...\n{}, {}, {}, {}, {}, {}",
self.next(), self.next(), self.next(), self.next(), self.next(), self.next()
),
_ => panic!("You Forgot To Add Command Number {cur} To The Skip Index..."),
}
}
}
Expand Down
40 changes: 15 additions & 25 deletions src/src/ufbc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,25 @@ impl UFBC {
);
let command: String = real_line[0].clone().to_lowercase();
if !command.eq("label") {
if line.len() < 2
&& !(command.eq("nop") || line[0].eq("\n") || line[0].trim().is_empty())
{
warnings.push(format!("Warning{}", {
let temp: String = Universal::format_error(
if line.len() < 2 && !(command.eq("nop") || line[0].trim().is_empty()) {
warnings.push(format!(
"Warning{}",
&Universal::format_error(
&line,
&[
"Command",
&real_line[0],
"Will Be Ignored For It Has No Arguments",
],
);
temp[5..].to_string()
}));
)[5..]
));
} else {
let command: Command = Command::new(&line, &real_line, &binary_map);
if !command.errors.is_empty() {
errors.push(command.errors);
} else {
for x in command.compiled {
compiled.push(x);
match Command::new(&line, &real_line, &binary_map) {
Err(x) => errors.push(x),
Ok(x) => {
for y in x {
compiled.push(y);
}
}
}
}
Expand Down Expand Up @@ -154,20 +152,12 @@ impl UFBC {
let mut out: Vec<String> = Vec::<String>::new();
for x in real_line.clone() {
if x.starts_with("\"") && x.ends_with("\"") {
let temp: String = x.clone()[1..].to_string();
for x2 in Universal::convert_to_mem(
&temp[..temp.len() - 1],
true,
&labels,
&default_memory_map,
) {
let temp: String = x[1..x.len() - 1].to_string();
for x2 in Universal::convert_to_mem(&temp, true, &labels, &default_memory_map) {
out.push(x2);
}
} else if x.starts_with("${") && x.ends_with("}") {
let key: String = {
let temp: String = x.clone()[2..].to_string();
temp[..temp.len() - 1].to_string()
};
let key: String = x[2..x.len() - 1].to_string();
if labels.contains_key(&key) {
out.push(labels.get(&key).to_string());
} else {
Expand Down
15 changes: 0 additions & 15 deletions src/test_compiler.sh

This file was deleted.

10 changes: 0 additions & 10 deletions src/test_runner.sh

This file was deleted.

1 change: 0 additions & 1 deletion wiki
Submodule wiki deleted from 1c0aa4

0 comments on commit 34a9c69

Please sign in to comment.