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.
Related articles
- Pentest Box Tools Download
- Top Pentest Tools
- Hacking Tools And Software
- Hacking Tools Kit
- Hack Tools Download
- Wifi Hacker Tools For Windows
- Underground Hacker Sites
- Hack Tools For Mac
- Pentest Tools Port Scanner
- Hacking Tools For Windows Free Download
- Hacking Tools For Windows Free Download
- Github Hacking Tools
- Pentest Recon Tools
- Usb Pentest Tools
- Hacking App
- Hack Tools Pc
- Pentest Tools Review
- Hack Tools Online
- Hack Tools For Mac
- Hacking Tools Hardware
- Hacking Tools
- Tools 4 Hack
- Hack And Tools
- Hacking Tools Download
- Hacks And Tools
- Hacker Hardware Tools
- Hacker Search Tools
- Hack Tools Mac
- Hack Tools
- Hack Tools For Mac
- Hacker Tools For Ios
- Termux Hacking Tools 2019
- Easy Hack Tools
- Pentest Tools Nmap
- Nsa Hack Tools Download
- Pentest Automation Tools
- Hacker Tools Software
- Hack App
- Nsa Hack Tools
- How To Install Pentest Tools In Ubuntu
- Pentest Tools Nmap
- Hacker Tools Software
- Hacker Tools Online
- Pentest Tools Android
- Physical Pentest Tools
- Physical Pentest Tools
- Pentest Tools Alternative
- Pentest Tools Github
- Hack Tools Github
- Github Hacking Tools
- Pentest Tools Port Scanner
- Hacker Hardware Tools
- Hacker Tool Kit
- Hacking Tools For Beginners
- Hacking Tools Hardware
- Pentest Tools Website Vulnerability
- Pentest Tools Download
- Best Pentesting Tools 2018
- Pentest Tools Tcp Port Scanner
- Hacking Tools For Games
- Hack Tools For Ubuntu
- Hacker Tools Online
- Pentest Tools Tcp Port Scanner
- Hack Tools Mac
- Pentest Box Tools Download
- Pentest Tools List
- Nsa Hack Tools
- Hacker Tools 2019
- Ethical Hacker Tools
- Easy Hack Tools
- Hacker Tools Hardware
- Pentest Tools Alternative
- Pentest Box Tools Download
- Hack Tools Online
- Hacker Tools Software
- Github Hacking Tools
- Kik Hack Tools
- Hacker Tools
- Pentest Tools Online
- Hacking Tools Software
- Hacker Tools For Ios
- How To Install Pentest Tools In Ubuntu
- Pentest Tools Review
- Hacking Tools Hardware
- Hacker Tools
- Nsa Hack Tools
- Nsa Hack Tools
- Hack Tools
- Hacker Tools Free Download
- Hacks And Tools
- Hacking Tools Mac
- Pentest Automation Tools
- Hack Apps
- Github Hacking Tools
- Pentest Tools Subdomain
- Hacking Tools Free Download
- Hacker Tools For Windows
- Tools Used For Hacking
- Hacker Tool Kit
- Hacker Tools Free
- Hacking Apps
- Hacking Tools For Mac
- Install Pentest Tools Ubuntu
- How To Hack
- Hackers Toolbox
- Hackrf Tools
- Hacking Tools For Kali Linux
- Hacker Tools Free Download
- Hacker Techniques Tools And Incident Handling
- Hacker Tools Github
- Hack Tools For Games
- Ethical Hacker Tools
- Hacker Tool Kit
- Hacking Tools For Pc
- Hacker Tools Free Download
- Hack Tools Mac
- Hacking Tools Software
- Hacking Tools For Games
- Black Hat Hacker Tools
- Pentest Tools Windows
- Hacker Tools List
- Pentest Tools
- Github Hacking Tools
- Pentest Tools For Windows
- Free Pentest Tools For Windows
- Hacking Tools Github
- Best Hacking Tools 2020
- Computer Hacker
- Hack Tools Pc
- Hacker Tools For Pc
- Hacker Tools For Mac
- Hacking Tools For Beginners
- Hacker Search Tools
- Hacker Tools For Ios
- Hacking Tools For Windows Free Download
- Physical Pentest Tools
- Hacking Tools For Windows 7
- Bluetooth Hacking Tools Kali
- Hack App
- Tools 4 Hack
- Termux Hacking Tools 2019
- Usb Pentest Tools
- Pentest Tools List
- Blackhat Hacker Tools
- Hacking Tools Online
- Pentest Tools Open Source
- Hackers Toolbox
- Game Hacking
- Hacker Techniques Tools And Incident Handling
- Easy Hack Tools
- Hacker Tools Apk Download
- Tools For Hacker
- Hacking Tools For Beginners
- Hacking Tools Github
- Pentest Tools Free
- Underground Hacker Sites
- Nsa Hacker Tools
- Hacks And Tools
- Hacking Tools 2020
- Pentest Tools Android
- Hack And Tools
- Pentest Box Tools Download
No comments:
Post a Comment