Write up này tự nhiên có hứng viết bằng tiếng Anh. Nên sai chính tả mn thông cảm nha.
Reverse Engineer BabyRust0 pyxe babylua ChildRust Pwn Introduction to pwntools bof_1 bof_2 bof_3 int_1 bof_4 shell_1 index_1 ret2libc Stage 1: Leak libc address. Stage 2: Spawn shell fmt_1 fmt_2 Reverse Engineer BabyRust0 Open with IDA Pro. We check the main::main() function.
void __fastcall __noreturn main::main( int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15, int a16, int a17, int a18, int a19, int a20, char a21, int a22, int a23, int a24, int a25, int a26, int a27, int a28, int a29, int a30, int a31, int a32, int a33, int a34, int a35, int a36, struct _Unwind_Exception *a37, int a38) { __int64 v38; // rax __int64 v39; // rax __int64 v40; // rdx __int64 v41; // rax __int64 v42; // rdx _BYTE *v43; // rax unsigned __int64 v44; // rdx _BYTE v45[48]; // [rsp+48h] [rbp-C0h] BYREF _BYTE v46[24]; // [rsp+78h] [rbp-90h] BYREF __int64 v47; // [rsp+90h] [rbp-78h] _BYTE v48[48]; // [rsp+98h] [rbp-70h] BYREF _BYTE v49[64]; // [rsp+C8h] [rbp-40h] BYREF while ( 1 ) { core::fmt::rt::<impl core::fmt::Arguments>::new_const(v45, &off_5555555AEB70); std::io::stdio::_print(); alloc::string::String::new(v46); std::io::stdio::stdin(); v47 = v38; std::io::stdio::Stdin::read_line(); core::result::Result<T,E>::expect(v39, v40, aFailedToReadLi, 19LL, &off_5555555AEB80); v41 = <alloc::string::String as core::ops::deref::Deref>::deref(v46); v43 = (_BYTE *)core::str::<impl str>::trim(v41, v42); if ( main::check(v43, v44) ) break; core::fmt::rt::<impl core::fmt::Arguments>::new_const(v49, &off_5555555AEB98); std::io::stdio::_print(); core::ptr::drop_in_place<alloc::string::String>(v46); } core::fmt::rt::<impl core::fmt::Arguments>::new_const(v48, &off_5555555AEBA8); std::io::stdio::_print(); std::process::exit(); } Notice the main::check() function. It pass v43, v44 as argument. That is the function to check the password correct or not.
...