sv_gametype ctf
code
fn main() -> u8 {
let a: u8 = rev_bin_ops!(10 / 20);
printf("%d\n", a);
return 0;
}
fn main() -> u8 {
let a: u8 = rev_bin_ops!(10 / 20);
printf("%d\n", a);
return 0;
}
Slice RevBinOps(Slice slice) {
TokenTree *tokenTree = slice.ptr;
TokenTree tmp = tokenTree[0];
tokenTree[0] = tokenTree[2];
tokenTree[2] = tmp;
return slice;
}
Slice RevBinOps(Slice slice) {
TokenTree *tokenTree = slice.ptr;
TokenTree tmp = tokenTree[0];
tokenTree[0] = tokenTree[2];
tokenTree[2] = tmp;
return slice;
}
#[no_mangle]
pub extern "C" fn RevBinOps(slice: Slice) -> Slice {
unsafe {
mem::swap(&mut *slice.ptr.offset(0), &mut slice.ptr.offset(2);
}
slice
}
#[no_mangle]
pub extern "C" fn RevBinOps(slice: Slice) -> Slice {
unsafe {
mem::swap(&mut *slice.ptr.offset(0), &mut slice.ptr.offset(2);
}
slice
}
no_mangle
required if there's extern "C"
? 0_ono_mangle
required if there's extern "C"
? 0_o free
on pointer which was gotten after leaking a vector?free
on pointer which was gotten after leaking a vector? fn main() {
let foo: Vec<u8> = Vec::new();
let r = foo.leak();
let ptr = r.as_ptr(); // Will it segfault if I call `free` on this ptr?
}
free
on this pointer, nofn main() {
let foo: Vec<u8> = Vec::new();
let r = foo.leak();
let ptr = r.as_ptr(); // Will it segfault if I call `free` on this ptr?
}
free(nullptr)
is safeBox<[u8]>
and leak thatBox<[u8]>
error: component download failed for rust-std-x86_64-linux-android
here we go again xdfn main() -> u8 {
let a: u8 = rev_bin_ops!(10 / 20);
printf("%d\n", a);
return 0;
}
thiserror
crate is goated