:
:

Powered by GetResponse email marketing software

Anyone Can Make Money Online

Why You Need To Read This Blog About "Anyone Can Make Money Online"

Saturday, August 29, 2020

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.

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.




More articles


  1. Hacker Tools For Ios
  2. What Is Hacking Tools
  3. Hacking Tools Hardware
  4. Hacker Techniques Tools And Incident Handling
  5. Kik Hack Tools
  6. Hacker Search Tools
  7. Hacker Tools Github
  8. Free Pentest Tools For Windows
  9. How To Hack
  10. Pentest Tools Url Fuzzer
  11. Hacking Tools For Beginners
  12. Hacking App
  13. Hacker Search Tools
  14. Hacker Tools List
  15. Hack Tools Download
  16. Hacking Tools For Windows 7
  17. Pentest Tools Subdomain
  18. Hacker Tools For Windows
  19. Hacker Tools List
  20. Hacking Tools For Kali Linux
  21. Pentest Reporting Tools
  22. Hacking Tools For Windows 7
  23. Hacks And Tools
  24. Hacker Hardware Tools
  25. Hacker Tools Free
  26. Hackrf Tools
  27. Nsa Hack Tools Download
  28. Pentest Tools Bluekeep
  29. Hacking Tools For Windows
  30. Pentest Tools For Windows
  31. Hacker Tools 2020
  32. Hack Rom Tools
  33. New Hacker Tools
  34. How To Hack
  35. Ethical Hacker Tools
  36. Hack And Tools
  37. Pentest Box Tools Download
  38. Pentest Tools Find Subdomains
  39. Pentest Tools Online
  40. Best Hacking Tools 2019
  41. Hacking Tools And Software
  42. Hacker Tools Linux
  43. Free Pentest Tools For Windows
  44. Hacking Tools Software
  45. Hack Website Online Tool
  46. How To Install Pentest Tools In Ubuntu
  47. Hackers Toolbox
  48. Hacking Tools Windows 10
  49. Hacker Techniques Tools And Incident Handling
  50. Android Hack Tools Github
  51. Pentest Tools Bluekeep
  52. Hack Tools 2019
  53. Hacking Tools Windows 10
  54. Pentest Tools Tcp Port Scanner
  55. Easy Hack Tools
  56. Hack Tools For Ubuntu
  57. Easy Hack Tools
  58. Pentest Tools Github
  59. Hack Website Online Tool
  60. New Hack Tools
  61. Hacker Tools 2020
  62. Hacker Tools List
  63. Hacking Tools And Software
  64. Pentest Tools Apk
  65. Hacker Tools List
  66. Pentest Tools Windows
  67. Hacking Tools Kit
  68. Hacker Tools For Mac
  69. Easy Hack Tools
  70. Hak5 Tools
  71. Hacking App
  72. Pentest Tools Website Vulnerability
  73. Pentest Tools For Mac
  74. Black Hat Hacker Tools
  75. Hack Tools 2019
  76. Underground Hacker Sites
  77. Bluetooth Hacking Tools Kali
  78. Pentest Tools Tcp Port Scanner
  79. Pentest Tools For Mac
  80. Hacking Tools 2020
  81. Hack Tools
  82. Nsa Hacker Tools
  83. Hack Tools For Windows
  84. Hacking Tools For Windows
  85. Beginner Hacker Tools
  86. Hacker Tools Apk
  87. What Is Hacking Tools
  88. Pentest Recon Tools
  89. Pentest Tools Subdomain
  90. Hack Rom Tools
  91. Pentest Tools Find Subdomains
  92. Pentest Tools Apk
  93. Hack Website Online Tool
  94. Hacking Tools Usb
  95. Hacking Tools For Windows 7
  96. Hacker
  97. Hacking Tools For Mac
  98. Pentest Tools Github
  99. Hacking Tools For Games
  100. Hackrf Tools
  101. Hacker Tools List
  102. Hack App
  103. Hacker Tools Apk
  104. Hacker Tools Online
  105. Ethical Hacker Tools
  106. Pentest Tools Free
  107. Pentest Tools Android
  108. Tools Used For Hacking
  109. Hack Tools For Windows
  110. Hacking Tools For Windows 7
  111. Hacker Tools 2019
  112. Android Hack Tools Github
  113. Hacking Tools For Games
  114. Hack Website Online Tool
  115. Hacker Hardware Tools
  116. Hacking Tools Software
  117. Bluetooth Hacking Tools Kali
  118. Termux Hacking Tools 2019
  119. Hack Tools
  120. Hacker Tools Mac
  121. Pentest Tools For Ubuntu
  122. Pentest Tools Free
  123. Growth Hacker Tools
  124. Tools Used For Hacking
  125. Hacking Apps
  126. Hack Rom Tools
  127. Pentest Tools Review
  128. Pentest Tools Framework
  129. Pentest Tools Review
  130. Hacker Tools Free
  131. Hack Tools For Games
  132. Pentest Tools Url Fuzzer
  133. Hacker Tools For Ios
  134. Hacks And Tools
  135. What Is Hacking Tools
  136. Hack Tools Online
  137. Hacker Tools Mac
  138. Hacker Tools Software
  139. Hack Tools For Mac
  140. Hacker Tools Hardware
  141. Tools For Hacker
  142. Kik Hack Tools
  143. Usb Pentest Tools
  144. Best Hacking Tools 2019
  145. Hacking App
  146. Pentest Tools For Mac
  147. Computer Hacker
  148. Pentest Tools Nmap
  149. Usb Pentest Tools
  150. Hack And Tools
  151. Usb Pentest Tools
  152. Hacker Tools For Ios
  153. Hack Tools
  154. Hack Tools Online
  155. Hack Tools Online
  156. Pentest Tools Github
  157. Beginner Hacker Tools
  158. Hacking Tools Usb
  159. Usb Pentest Tools
  160. Kik Hack Tools
  161. How To Install Pentest Tools In Ubuntu
  162. Pentest Tools Alternative
  163. Hack Website Online Tool
  164. Hack Tools For Games
  165. Pentest Tools Open Source
  166. Hacking Tools Pc
  167. How To Install Pentest Tools In Ubuntu
  168. Hacking Tools 2019
  169. How To Install Pentest Tools In Ubuntu
  170. Growth Hacker Tools
  171. Pentest Tools Linux
  172. Hacking Tools Name

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home