Tags
Author: TMZ - Replies: 0 - Views: 1289
Dynamic API Calls in .NET
Here's a way to call APIs without DLLImport. I’ve first saw this years ago at OpenSC.ws as far as I remember and got into the idea. The code was lost since then but I found a copy.

It's a class which can dynamically call a Windows API function at runtime using Reflection.Emit.

Program.cs
[hide]
[code]
/*
* User: TMZ
* Date: April 15 2015
* Time: 12:48PM
*
* Released under GPLv2
*/

using System;
using System.Reflection;

namespace APICaller
{
class Program
{
Author: TMZ - Replies: 0 - Views: 1236
MBR Dump With .NET
Years ago I was messing around with Windows MBR (on VXHeaven) and got stuck while trying to write a modified copy back to the disk.

[hide]
[code]
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
using System.IO;

namespace MBR
{
class MainClass
{

[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern uint SetFilePointer(
[In] SafeFileHandle hFile,
[In] int lDistanceToMove,
[Out] out int lpDis
Author: TMZ - Replies: 0 - Views: 1578
A Steganographic .NET Executable
A while ago, alcopaul suggested on VXHeaven a .NET executable that could store a secret message inside. While I did not followed his strict theory, I did wrote a working proof of concept, very basic and dirty but, well, it’s only a POC.

[hide]
[code]
using System;
using Mono.Cecil;
using Mono.Cecil.Cil;
using System.Reflection;
using System.IO;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace StegaBuilder
{
class MainClass
{
public static void Ma