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.
Read more
- Physical Pentest Tools
- Black Hat Hacker Tools
- Pentest Recon Tools
- Pentest Tools Github
- Hacker Search Tools
- Pentest Tools Subdomain
- Pentest Recon Tools
- Hacker Tools 2020
- Hacking Tools Windows 10
- Hacking Tools For Mac
- Hacker Tool Kit
- Bluetooth Hacking Tools Kali
- Hack Apps
- What Is Hacking Tools
- Hacker Security Tools
- Pentest Tools For Ubuntu
- Growth Hacker Tools
- Hacker Tools For Ios
- Pentest Tools Linux
- Hacker Tools
- Pentest Tools For Mac
- Hacker Tools For Mac
- Hacker Tools
- Pentest Tools For Mac
- Hacking Apps
- Hacking Tools Software
- Hacking Tools Hardware
- Blackhat Hacker Tools
- Hacking Tools For Windows
- Pentest Tools Open Source
- Hacking Tools
- How To Install Pentest Tools In Ubuntu
- Hacking Tools For Windows
- Hackrf Tools
- Pentest Tools For Ubuntu
- What Are Hacking Tools
- Hack Tool Apk No Root
- Hack Tool Apk
- Pentest Tools List
- Hack Tool Apk
- Hacking Tools For Windows 7
- Hacker Security Tools
- Pentest Tools Windows
- Hacker Tools For Ios
- Pentest Tools For Android
- Pentest Tools Online
- Hack Tools 2019
- Pentest Tools Kali Linux
- Hacker Techniques Tools And Incident Handling
- Hacking Tools Pc
- Hacking App
- Pentest Tools Port Scanner
- Hacker Tools Free Download
- Pentest Tools Linux
- Github Hacking Tools
- Hacker Tools For Pc
- Hacking Apps
- Hacker Tools Free Download
- Hacking Tools 2020
- Pentest Tools
- Pentest Tools Linux
- Pentest Tools Windows
- Hacker Tools
- Pentest Reporting Tools
- Hacker Tools Apk Download
- Hacker Tools Free Download
- Pentest Tools For Android
- Hacks And Tools
- Hack Tools For Games
- Hacker Tools Hardware
- Kik Hack Tools
- Pentest Tools Tcp Port Scanner
- Pentest Tools Kali Linux
- Hacking Tools For Windows Free Download
- Hacking Tools 2019
- Best Pentesting Tools 2018
- World No 1 Hacker Software
- Pentest Tools Framework
- Pentest Tools Url Fuzzer
- Pentest Tools Online
- Hacking Tools Windows
- Hacking Tools Free Download
- Pentest Tools For Android
- Easy Hack Tools
- Hacking Apps
- Pentest Tools Tcp Port Scanner
- How To Install Pentest Tools In Ubuntu
- Hack Tool Apk No Root
- Underground Hacker Sites
- Hack Tools For Windows
- Hacker Tools List
- Hack Tools For Games
- Pentest Tools Review
- Hacker Search Tools
- Pentest Tools Nmap
- Hack Tools Mac
- Bluetooth Hacking Tools Kali
- Hacking Tools
- Blackhat Hacker Tools
- Hack Tools For Pc
- Hack Tools Online
- Hack Apps
- Hack Tools Download
- How To Make Hacking Tools
- Tools For Hacker
- Hacking Tools Windows
- Hacking Tools 2019
- How To Make Hacking Tools
- How To Hack
- Pentest Tools For Android
- Hacker Techniques Tools And Incident Handling
- Hack Tools
- Hackers Toolbox
- Hacking Tools Windows 10
- Beginner Hacker Tools
- Hacker Tools List
- Hacking Tools
- What Are Hacking Tools
- Hacker Tools Github
- Hacks And Tools
- Hacking Tools For Games
- Hacker Tools Mac
- Hack Tool Apk No Root
- Hack Tools
- Pentest Tools Url Fuzzer
- Install Pentest Tools Ubuntu
- Pentest Reporting Tools
- What Is Hacking Tools
- Beginner Hacker Tools
- Hacking Tools Online
- Pentest Tools Website Vulnerability
- Free Pentest Tools For Windows
No comments:
Post a Comment