Skip to content

Instantly share code, notes, and snippets.

@the-nose-knows
the-nose-knows / MessageBoxEx.cs
Last active June 6, 2018 08:45
RogerB's MessageBoxEx from CODEPROJECT; an include-only extension for MessageBox, supporting a timeout timer
/*
* From author RogerB: https://www.codeproject.com/script/membership/view.aspx?mid=716667
* Code source article: https://www.codeproject.com/articles/7968/messagebox-with-a-timeout-for-net
* Licensing: https://www.codeproject.com/info/cpol10.aspx
*/
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Security.Permissions;
#include <QCoreApplication>
#include <QRegularExpressionMatch>
#include <QStringList>
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QStringList results;
QRegularExpression this_regex("(\\wog)|(\\wee)");
# Ruby - A nested hash example
# Load each pair of args on the command-line as a key-value pair
# For example from CMD.exe:
# call ruby.exe ruby_nested_hash_example.rb Age 30 Name Mary Fav_Hobby Ataraxia Fav_Number 42
# Output would be:
# {
# "data_info": {
# "types": {
# "nums": {
# "Age": 30,
# Original class developed by dbjsy of StackOverflow
# User_URL: http://stackoverflow.com/users/4293919/dbjsy
# Question_URL: http://stackoverflow.com/questions/7014052/ruby-multidimensional-array
# Answer_URL: http://stackoverflow.com/a/35429385/3543437
#
# Produces a PHP/Classic-style multidimensional array.
#
# Example:
# arr = MArray.new
# arr[1][2][3] = "foo"
/*
* Derived from an answer at StackOverflow
* Answer: http://stackoverflow.com/a/40737306/3543437
* Question: http://stackoverflow.com/questions/8312459/iterate-through-object-properties
* Answer Author: http://stackoverflow.com/users/1073330/frank-roth
* Purpose: Illustrate how the single-liner can be split up into multiple lines using map((key)=>(value))
*/
Object
.keys(mock_json_complex)
var empty_obj = {};
if(Object.entries(empty_obj)==undefined)
{
console.log('is undefined');
}
else if(Object.entries(empty_obj)==null)
{
console.log('is null');
}
else if(Object.entries(empty_obj)=={})
using System;
using System.Reflection;
using System.IO;
namespace DotNetInspectorGadget
{
class DotNetInspectorGadget
{
static int Main(string[] args)
{
if(args.GetLength(0) < 1)
// Answer is a slight diff of Ed Bayiate's answer on Stack Overflow
// Answer URI: http://stackoverflow.com/a/6903367/3543437
// Question URI: http://stackoverflow.com/questions/6903256/how-to-programmatically-check-c-dll-files-and-c-sharp-dll-files-for-references
// Answer Author Profile URI: http://stackoverflow.com/users/695833/ed-bayiates
using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
/*
* Get Dependency List of DLLs
* Lists names of DLLs used to build the binary
* CAVEAT 1: Will not tell you what DLLs are loaded into the module at runtime
* CAVEAT 2: Will not tell you .NET Assembly Information
* CAVEAT 3: This app seems to crash on 64-bit applications; not sure why, exactly. Even occurs on itself when compiled as x86_amd64.
*
* I take no credit for this. It was wholly derived from a forum post of the C Boards. This is my hacked diff to only get DLL names.
*
* Forum Post Internet Archive Snapshot: http://web.archive.org/web/20090327115720/http://cboard.cprogramming.com:80/windows-programming/82906-problem-while-reading-inport-table.html
+ addy 0x000000a578d2f3a8 {0x0000000000001000} unsigned __int64 *
argc 0x00000002 int
+ argv 0x0000029771432410 {0x0000029771432428 "C:\\Users\\TheUser\\documents\\visual studio 2017\\Projects\\load_pe\\x64\\Debug\\load_pe.exe"} char * *
coverted_base_address 0x0000029771370000 unsigned __int64
data_directory_optional_header_offset 0x0000000000000070 unsigned __int64
direct_access_size_stack 0x0000000000001000 unsigned __int64
error_check 0x00000000 int
+ filesystem_image {_Mystr=L"C:\\pathToFile\\some_test.exe" } std::experimental::filesystem::v1::path
+ image_directory "C:\\pathToFile" std::basic_string<char,std::char_traits<char>,std::allocator<char> >
image_loaded true bool