Reversing Some C++ Io Operations
In general decompilers are not friendly with c++ let's analyse a simple program to get familiar with it.
Let's implement a simple code that loads a file into a vector and then save the vector with following functions:
- err
- load
- save
- main
Lets identify the typical way in C++ to print to stdout with the operator "<<"
The basic_ostream is initialized writing the word "error" to the cout, and then the operator<< again to add the endl.
The Main function simply calls "vec = load(filename)" but the compiler modified it and passed the vector pointer as a parámeter. Then it bulds and prints "loaded " << size << " users".
And finally saves the vector to /tmp/pwd and print "saved".
Most of the mess is basically the operator "<<" to concat and print values.
Also note that the vectors and strings are automatically deallocated when exit the function.
And here is the code:
Let's take a look to the load function, which iterates the ifs.getline() and push to the vector.
First of all there is a mess on the function definition, __return_storage_ptr is the vector.
the ifstream object ifs is initialized as a basic_ifstream and then operator! checks if it wasn't possible to open the file and in that case calls err()
We see the memset and a loop, getline read a cstr like line from the file, and then is converted to a string before pushing it to the vector. lVar1 is the stack canary value.
The function save is a bit more tricky, but it's no more than a vector iteration and ofs writing.
Looping a simple "for (auto s : *vec)" in the decompiler is quite dense, but we can see clearly two write, the second write DAT_0010400b is a "\n"
More articles
- Hack Tools For Mac
- Pentest Tools Bluekeep
- Pentest Tools Review
- Pentest Tools For Mac
- Hack Tools Github
- Hackers Toolbox
- Pentest Tools Android
- Best Hacking Tools 2020
- Hak5 Tools
- Install Pentest Tools Ubuntu
- Hacker Tools For Mac
- Install Pentest Tools Ubuntu
- What Is Hacking Tools
- Termux Hacking Tools 2019
- Hacking Tools Name
- Pentest Tools Subdomain
- Pentest Tools Port Scanner
- New Hack Tools
- Hacking Tools Free Download
- Hack Tool Apk No Root
- Hacker Tools Hardware
- Hacker Tools
- Hacking Tools Pc
- Hacking Tools For Beginners
- Pentest Tools Subdomain
- How To Make Hacking Tools
- Hackers Toolbox
- Hacking Tools And Software
- Hack Tools For Ubuntu
- Hacker Tools Apk
- Hacking Tools Kit
- Hackrf Tools
- Hack Tool Apk No Root
- Pentest Tools Windows
- Hacking App
- Nsa Hack Tools Download
- Nsa Hacker Tools
- Growth Hacker Tools
- Termux Hacking Tools 2019
- Pentest Tools Alternative
- Hack App
- Hacking Tools Pc
- Hacker Tools For Ios
- Hacker Tools Free Download
- Pentest Recon Tools
- Pentest Recon Tools
- Hacks And Tools
- Hack Tools
- What Is Hacking Tools
- Pentest Automation Tools
- Pentest Recon Tools
- Hacker Tools
- Pentest Tools List
- Hack App
- Pentest Tools Download
- Hack Tools For Pc
- Hack Tools For Windows
- Pentest Tools Github
- Hacking Tools Github
- Hack Tools
- Hack Tools For Ubuntu
- Best Hacking Tools 2020
- Pentest Tools Url Fuzzer
- Android Hack Tools Github
- Hacker Tools Linux
- Best Pentesting Tools 2018
- Pentest Tools Tcp Port Scanner
- Computer Hacker
- Tools Used For Hacking
- Kik Hack Tools
- Hacker Tools For Pc
- Physical Pentest Tools
- Hacking Tools Kit
- Easy Hack Tools
- Ethical Hacker Tools
- Pentest Tools Apk
- Termux Hacking Tools 2019
- Nsa Hacker Tools
- Hacker
- Hack Tools For Games
- Hacking Tools Name
- Pentest Tools Review
- Hack Tools For Games
- Hacker Tools Windows
- Pentest Tools For Ubuntu
- Hacker Tools For Windows
- Hacking Tools Windows 10
- Install Pentest Tools Ubuntu
- Hacker Tools Free Download
- Hack Tools
- Hacker Tools List
- Hacker Tools Apk Download
- Hacker Tools Free
- Hack Tools Online
- Computer Hacker
- Hackrf Tools
- Hack Tool Apk
- Pentest Tools Apk
- Hack Tools
- Usb Pentest Tools
- Pentest Tools Website
- Pentest Tools Online
- Beginner Hacker Tools
- Pentest Tools Apk
- Pentest Reporting Tools
- Hacking Tools Online
- Easy Hack Tools
- Hack Tool Apk
- Hacker Tools
- Physical Pentest Tools
- Best Hacking Tools 2019
- How To Install Pentest Tools In Ubuntu
- Hack Tools 2019
- Pentest Tools Online
- How To Make Hacking Tools
- Hacking App
- Hack Apps
- How To Hack
- Hacker Tools For Pc
- Hack Rom Tools
- Hack Tools 2019
- Pentest Tools Framework
- Nsa Hack Tools
- Hacking Tools Windows 10
- Hacker Tools Windows
- How To Hack
- Hacker Tools Hardware
- Pentest Tools Open Source
- Hack App
- Hacking Tools For Beginners
- Hack Tools For Pc
- Github Hacking Tools
- Install Pentest Tools Ubuntu
- Best Hacking Tools 2020
- Hacking Tools Name
- Hacker Tools For Windows
- Hack Tools Github
- Pentest Tools Subdomain
- Hacking Tools For Windows
- Easy Hack Tools
- How To Hack
- Tools For Hacker
- Hacking Tools 2019
- Game Hacking
- Hacking Tools For Games
- Computer Hacker
- How To Make Hacking Tools
- Github Hacking Tools
- Hacking Tools Pc
- Pentest Tools Framework
- Pentest Tools Free
- Hacking Tools
- Easy Hack Tools
- Pentest Tools Open Source
- Android Hack Tools Github
- Hak5 Tools
- Android Hack Tools Github
- Pentest Tools Url Fuzzer
- Hacking Tools Online
- Tools 4 Hack
- Pentest Box Tools Download
- Hacking Tools For Kali Linux
- Hacking Tools For Beginners
- Hacker Security Tools
- Hacker Tools Linux
- Install Pentest Tools Ubuntu
0 Comments:
Publicar un comentario
<< Home