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"
Related word
- Nsa Hacker Tools
- Pentest Tools Windows
- Pentest Automation Tools
- Hack Tools Online
- Hacker Tools Apk
- Pentest Recon Tools
- World No 1 Hacker Software
- Pentest Tools Subdomain
- Hacking Tools Windows 10
- Hacker Tools Mac
- Ethical Hacker Tools
- Hacking Tools For Windows Free Download
- Android Hack Tools Github
- Pentest Tools Nmap
- Hacker Tools 2019
- Pentest Recon Tools
- Nsa Hack Tools Download
- Physical Pentest Tools
- Hacking Tools Windows
- Top Pentest Tools
- Wifi Hacker Tools For Windows
- Hacker Tools Online
- Blackhat Hacker Tools
- Pentest Tools Github
- Black Hat Hacker Tools
- Hacker
- Pentest Tools For Mac
- Hacking Tools Download
- Top Pentest Tools
- Hacking Tools
- Pentest Tools Alternative
- Hacker Tools Linux
- Pentest Tools Kali Linux
- How To Install Pentest Tools In Ubuntu
- Pentest Tools For Mac
- Hacking Tools Software
- Hacker Techniques Tools And Incident Handling
- Hacker Tools Apk
- Physical Pentest Tools
- Pentest Tools Apk
- Pentest Tools Github
- Hack Tools Github
- Nsa Hack Tools Download
- Pentest Tools Download
- Easy Hack Tools
- New Hacker Tools
- Hack And Tools
- Hacking Tools Download
- Hacking Tools Mac
- Pentest Tools Alternative
- Pentest Box Tools Download
- Pentest Tools Windows
- Best Hacking Tools 2019
- Hack Tools
- Pentest Tools Framework
- Hack Tools For Windows
- Nsa Hacker Tools
- Hacks And Tools
- Hacker Tools Free
- How To Hack
- Hacker Tools Free Download
- Hacking Tools Name
- Hack Tools For Windows
- Hackers Toolbox
- How To Hack
- Pentest Tools For Android
- Physical Pentest Tools
- Pentest Tools Apk
- Hack Rom Tools
- Ethical Hacker Tools
- Hacker Tools Free
- Hacker Tools 2019
- Hacks And Tools
- Hacking App
- Beginner Hacker Tools
- Hacking Tools Windows
- Hacking Tools For Windows Free Download
- Hacking Tools Online
- Pentest Tools Subdomain
- Hacker Tools Windows
- Pentest Tools
No comments:
Post a Comment