Skip to content

Instantly share code, notes, and snippets.

@benpturner
benpturner / JS from VBA
Created July 9, 2017 19:39
JS from VBA
Sub RunMe()
'
' Menu -> Tool -> References -> Microsoft Script Control 1.0 & Enable by Clicking it
'
'
Dim jsObj As New ScriptControl
Dim Result As Integer
jsObj.Language = "JScript"
With jsObj
@benpturner
benpturner / Dll.cpp
Created June 14, 2017 09:31
Simple DLL
#include <windows.h>
#include <stdio.h>
//////////////////////////////////////////////////////////////////////
BOOLEAN WINAPI DllMain(
IN HINSTANCE /*hDllHandle*/,
IN DWORD nReason,
IN LPVOID /*Reserved*/)
{
@benpturner
benpturner / Program.cs
Last active November 29, 2023 10:58
Simple C# Service
using System.ServiceProcess;
using System.Diagnostics;
public class MyService : ServiceBase
{
public MyService()
{
ServiceName = "runner";
}
@benpturner
benpturner / SystemService.cs
Created June 14, 2017 09:15
Simple C# Service
using System;
using System.Diagnostics;
using System.ServiceProcess;
namespace RedTeamingService
{
public partial class SystemService : ServiceBase
{
public static int pid = 0;