Home

rustlings-structs

struct1 // structs1.rs // Address all the TODOs to make the tests pass! struct ColorClassicStruct { // TODO: Something goes here } struct ColorTupleStruct(/* TODO: Something goes here */); #[derive(Debug)] struct UnitStruct; #[cfg(test)] mod tests { use super::*; #[test] fn classic_c_structs() { // TODO: Instantiate...

Read more

rustlings-primitive_types

primitive_types1 // primitive_types1.rs // Fill in the rest of the line that has code missing! // No hints, there's no tricks, just get used to typing these :) fn main() { // Booleans (`bool`) let is_morning = true; if is_morning { println!("Good morning!"); } let is_evening = true;// Finish the rest of this line ...

Read more

rustlings-move_semantics

move_semantics1 // move_semantics1.rs // Make me compile! Execute `rustlings hint move_semantics1` for hints :) fn main() { let vec0 = Vec::new(); //let v = vec![1, 2, 3]; let mut v = vec![1, 2, 3]; println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1); vec1.push(88); println!("{} has length {} content...

Read more

rustlings-if

if1 // if1.rs pub fn bigger(a: i32, b: i32) -> i32 { // Complete this function to return the bigger number! // Do not use: // - another function call // - additional variables // Execute `rustlings hint if1` for hints } // Don't mind this for now :) #[cfg(test)] mod tests { use super::*; #[test] fn ten_is_bi...

Read more

rustlings-functions

function1 // functions1.rs // Make me compile! Execute `rustlings hint functions1` for hints :) fn call_me fn main() { call_me(); } 函数遍布于Rust中,用fn声明。Rust代码中的函数和变量名使用snake case规范风格。与C不同,Rust不关心函数定义于何处,只要定义了就行。上述是缺少对函数的定义。我们观察到call_me()没有参数。 fn call_me() { print!("123!"); } 其实函数的完整形式为 fn call_me() -> () { print!("123!"); } 如...

Read more

rustlings-variables

variables1 // variables1.rs // Make me compile! Execute the command `rustlings hint variables1` if you want a hint :) // About this `I AM NOT DONE` thing: // We sometimes encourage you to keep trying things on a given exercise, // even after you already figured it out. If you got everything working and // feel ready for the next exercise, remov...

Read more

指令(MIPS-32)

指令(MIPS-32)(working) 计算机语言中的基本单词就是指令。 各种语言的指令集能体现出一定的相似性,因为所有计算机都是基于基本原理相似的硬件技术所构建的。计算机设计者致力于找到一种语言,既能方便硬件和编译器的设计,使性能达到最佳,又使成本和功耗最低。计组读了很久,沿着书中的习惯,详细的了解该指令集。 冯诺依曼体系结构 五大功能部件 输入设备 输出设备 运算器 控制器 存储器:存储数据结构,下标从0开始的一维数组(抽象) MIPS-32指令集概况 32个寄存器,大小为32位。 2^30个存储器字,32位为一组。 字节编址,故需要遵照对齐限制(数据地址与存储器的自然边界对齐的需求)。 采用大端编址 单位与约定 ...

Read more

xctf-pwn-新手区

int_overflow file命令查看一下 int_overflow: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=aaef797b1ad6698f0c629966a879b42e92de3787, not stripped 拖入IDA反编译 main函数如下 int __cdecl main(int argc, const char **argv, const char **envp) { int v4; // [esp+Ch]...

Read more