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.
In this situations dont obfuscate with the vector pointer vec initialization at the begining, in this case the logic is quite clear.
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"
As we see, save implememtation is quite straightforward.
Continue reading
- Hacking Tools Windows 10
- Hacker Tools Free
- Hacking Tools For Windows Free Download
- Tools Used For Hacking
- Hacking Tools Name
- Hacker Techniques Tools And Incident Handling
- Nsa Hack Tools Download
- How To Install Pentest Tools In Ubuntu
- Underground Hacker Sites
- Physical Pentest Tools
- Hacker Tools
- Pentest Box Tools Download
- Hack App
- Pentest Tools Github
- Hack Tools For Games
- Hack Tools For Pc
- Hackers Toolbox
- Hacking Tools For Windows
- Github Hacking Tools
- What Is Hacking Tools
- Pentest Tools Website Vulnerability
- Pentest Tools Github
- Pentest Tools For Ubuntu
- Hacker Tools List
- Hacking Apps
- Top Pentest Tools
- Hack Tools For Pc
- Hacker Tools 2020
- Hacking Tools Name
- Pentest Tools For Mac
- Pentest Tools Free
- How To Make Hacking Tools
- Hacker Tools For Windows
- Pentest Tools Tcp Port Scanner
- Github Hacking Tools
- Top Pentest Tools
- Bluetooth Hacking Tools Kali
- Pentest Tools Linux
- Hacks And Tools
- Hacking Tools Github
- Hack Apps
- Hack Tools For Ubuntu
- Hacking Tools For Windows Free Download
- Pentest Tools Android
- Pentest Tools Review
- Hack Tools Download
- Hacker Tools Apk Download
- Pentest Tools Website Vulnerability
- Hacks And Tools
- Hack Tools For Games
- Pentest Tools For Ubuntu
- Hak5 Tools
- Hack Tools Mac
- Blackhat Hacker Tools
- Hack Tools Github
- Pentest Box Tools Download
- Hacking Apps
- How To Install Pentest Tools In Ubuntu
- Pentest Tools Apk
- New Hack Tools
- Hack Tools For Pc
- How To Install Pentest Tools In Ubuntu
- Pentest Tools List
- Pentest Tools Download
- Android Hack Tools Github
- Hacker Tools For Pc
- Game Hacking
- Pentest Tools Framework
- Computer Hacker
- Hacker Tools For Ios
- Pentest Automation Tools
- Hacking Tools Software
- Pentest Tools Windows
- Hacker Tools
- Hacking App
- Pentest Tools Github
- Pentest Tools Nmap
- Hacking Tools For Mac
- Pentest Tools Alternative
- Hacking Tools Kit
- New Hacker Tools
- Android Hack Tools Github
- Hack Tools Online
- Pentest Tools Alternative
- Hack Rom Tools
- Pentest Tools Framework
- Hack Tools 2019
- Hacker Tools Free
- Hacker Tool Kit
- Hacks And Tools
- Hacker Tools Hardware
- Hacker Tools Apk Download
- Best Hacking Tools 2020
- Hacker Tool Kit
- Hacking Tools 2020
- Pentest Tools Url Fuzzer
- Pentest Tools Find Subdomains
- Nsa Hack Tools
- Hacker Tools Linux
- Hack Tool Apk No Root
- Hacker Tools Free
- Pentest Tools Free
- Pentest Recon Tools
- Pentest Tools Download
- Hacker Hardware Tools
- Tools 4 Hack
- Nsa Hacker Tools
- Hacker
- Pentest Tools Linux
- Hacking Tools For Beginners
- Pentest Tools For Windows
- Install Pentest Tools Ubuntu
- Pentest Tools Framework
- Hacking Tools Windows 10
- Pentest Tools Windows
- Hack Tools For Games
- Hacking Tools Software
- Hacking Tools Windows
- Hacking Tools For Windows Free Download
- Hacker Tools Windows
- Pentest Tools For Ubuntu
- Pentest Tools Online
- Hacking Apps
- Tools Used For Hacking
- Hacking Tools For Windows Free Download
Tidak ada komentar:
Posting Komentar