This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------- | |
// File: client-socket-shell1.cpp | |
// Brief: Basic Winsocket (Windows socket) echo client shell in C++. | |
// Author: Caio Rodrigues | |
//----------------------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <windows.h> | |
#pragma comment (lib, "Ws2_32.lib") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: c:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/um/WinBase.h | |
//@[contract("winbase"), comment("MVI_tracked - https://osgwiki.com/wiki/Microsoft_Virus_Initiative")]; | |
#include <winapifamily.h> | |
/************************************************************************ | |
* * | |
* winbase.h -- This module defines the 32-Bit Windows Base APIs * | |
* * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: listFiles.cpp | |
// Brief: List all files of a given directory | |
// Note: Windows-only - Uses API | |
// Author: Caio Rodrigues | |
//---------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <iomanip> | |
#include <functional> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File; showModulesDLL.cpp | |
// Brief: List all modules DLLs (Dynamic Linked Libraries) loaded by some process. | |
// Author: Caio Rodrigues | |
//----------------------------------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <iomanip> | |
#include <functional> | |
//- Windows Headers --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: console-utf8.cpp | |
// Brief: Sets Windows Console to UTF8 | |
// Author: Caio Rodrigues | |
//------------------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <windows.h> | |
// Uses RAII for setting console to UTF8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: winapi-enconding1.cpp | |
// Brief: Test Windows API character enconding features. | |
// Author: Caio Rodrigues | |
//----------------------------------------------------------------- | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <sstream> | |
// Enable Unicode version of Windows API compile with -DWITH_UNICODE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: copy-swap1.cpp | |
// Brief: Demonstration of copy-and-swap idiom for implementing rule-of-three and rule-of-five. | |
// Author: Caio Rodrigues | |
//----------------------------------------------------------------- | |
#include <iostream> | |
#include <ostream> // Operator (<<) overload for class ostream | |
#include <utility> // std::swap | |
#include <iterator> // std::begin, std::end | |
#include <algorithm> | |
#include <cstring> // strlen, strcpy, ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: binfo.cpp | |
// Brief: Get information about binary files and identify them using the "magic numbers". | |
// Author: Caio Rodrigues | |
// File signature or magic number database: https://gist.github.com/overtrue/0a2aec7c2fbe9621a869 | |
// C++ Standard: >= C++14 | |
//---------------------------------------------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
#include <map> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** File: rpn-calculator.cpp | |
* Author: Caio Rodrigues - caiorss <DOT> rodrigues <AT> gmail <DOT> com | |
* Brief: Reverse Polish Notation Calculator | |
* Description: A simple reverse polish notation command line calculator | |
* implemented in modern C++. | |
* Site: https://caiorss.github.io/C-Cpp-Notes/sample-modern-cpp-programs.htm | |
***************************************************************************/ | |
#include <iostream> | |
#include <cmath> | |
#include <map> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: bsd-socket-shell.cpp | |
// Brief: A telnet-like tool. It can bind a login shell to client or server socket. | |
// Objective: Model client/server sockets on U-nix like OSes and play with C++ and Posix syscalls. | |
// Author: Caio Rodrigues | |
// Url: https://caiorss.github.io/C-Cpp-Notes/sample-modern-cpp-programs.html | |
//-------------------------------------------------------------------------------------- | |
//-------- C++ specific headers> | |
#include <iostream> | |
#include <string> |