working on it ...

Filters

Explore Public Snippets

Sort by

Found 1,610 snippets matching: blob

    public by HeathDernovich modified Jul 23, 2014  203915  0  4  0

    blobs in the IndexDB

    blobs in the IndexDB: blobStorage.js
    // make a blob
    var blob = new Blob(['blobyJo'], {
        type: 'text/plain'
    });
      
    try {
      var store = db.transaction(['buckets'], 'readwrite')
          .objectStore('buckets');
      
      var fngr = store.put(blob, 'blob');
      fngr.onerror = function(err) {
          console.log(err);
      };
        
      fngr.onsuccess = function(event) {
          console.log('blob as blob'); // NO base64 conversion needed!!!
      };
        
    }
    catch (err) {
      var rdr = new FileReader();
      rdr.onload = function(event) {
          
        var store = db.transaction(['buckets'], 'readwrite')
            .objectStore('buckets');
              
        var dta = event.target.result,
        fngr = store.put(dta, 'blob');
          
          
        fngr.onerror = function(err) {
          console.log(err);
        };
          
          
        fngr.onsuccess = function(event) {
          console.log('blob as b64');
        };
      };
    
      rdr.readAsDataURL(blob);
    }
      
      
    
    
    

    public by Geometry modified Jul 31, 2016  87770  2  4  0

    PubKeyToScript: For POS coins - used to format wallet address pubkey to use in generation transaction's output.

    For POS coins - used to format wallet address pubkey to use in generation transaction's output. nodejs: https://github.com/zone117x/node-stratum-pool/blob/3586ec0d7374b2acc5a72d5ef597da26f0e39d54/lib/util.js#L243 nodejs: http://runnable.com/me/VCFHE0RrZnwbsQ6y
    using System;
    using System.IO;
    using System.Linq;
    using CoiniumServ.Coin.Address;
    using CoiniumServ.Coin.Address.Exceptions;
    using CoiniumServ.Cryptology;
    using CoiniumServ.Utils.Extensions;
    using CoiniumServ.Utils.Numerics;
    using Gibbed.IO;
    using Serilog;
    
    /// <summary>
    /// For POS coins - used to format wallet address pubkey to use in generation transaction's output.
    /// </summary>
    /// <param name="key"></param>
    /// <example>
    /// nodejs: https://github.com/zone117x/node-stratum-pool/blob/3586ec0d7374b2acc5a72d5ef597da26f0e39d54/lib/util.js#L243
    /// nodejs: http://runnable.com/me/VCFHE0RrZnwbsQ6y
    /// </example>
    /// <returns></returns>
    public static byte[] PubKeyToScript(string key)
    {
        var pubKey = key.HexToByteArray();
    
        if (pubKey.Length != 33)
        {
            Log.Error("invalid pubkey length for {0:l}", key);
            return null;
        }
    
        byte[] result;
    
        using (var stream = new MemoryStream())
        {
            stream.WriteValueU8(0x21);
            stream.WriteBytes(pubKey);
            stream.WriteValueU8(0xac);
            result = stream.ToArray();
        }
    
        return result;
    }

    public by cghersi modified Jul 30, 2012  8873  31  7  0

    MySQL SELECT statement from blob to string

    SELECT statement to translate a blob field into a readable string
    CREATE TABLE tbl (myBlob longblob);
    
    INSERT INTO tbl VALUES (0x1234);
    
    SELECT 	HEX(myBlob) AS PrintableBlob
    FROM	tbl;

    public by Geometry modified Jul 31, 2016  78345  0  4  0

    SerializeHeader: Block headers are sent in a headers packet in response to a getheaders message.

    Block headers are sent in a headers packet in response to a getheaders message. https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers nodejs: https://github.com/zone117x/node-stratum-pool/blob/master/lib/blockTemplate.js#L85
    using System;
    using System.IO;
    using System.Text;
    using CoiniumServ.Jobs;
    using CoiniumServ.Utils.Extensions;
    using CoiniumServ.Utils.Helpers;
    using Gibbed.IO;
    
    /// <summary>
    /// Block headers are sent in a headers packet in response to a getheaders message.
    /// </summary>
    /// <remarks>
    /// https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers
    /// </remarks>
    /// <example>
    /// nodejs: https://github.com/zone117x/node-stratum-pool/blob/master/lib/blockTemplate.js#L85
    /// </example>
    /// <param name="job"></param>
    /// <param name="merkleRoot"></param>
    /// <param name="nTime"></param>
    /// <param name="nonce"></param>
    /// <returns></returns>
    public static byte[] SerializeHeader(IJob job, byte[] merkleRoot, UInt32 nTime, UInt32 nonce)
    {
        byte[] result;
    
        using (var stream = new MemoryStream())
        {
            stream.WriteValueU32(nonce.BigEndian());
            stream.WriteValueU32(Convert.ToUInt32(job.EncodedDifficulty, 16).BigEndian());
            stream.WriteValueU32(nTime.BigEndian());
            stream.WriteBytes(merkleRoot);
            stream.WriteBytes(job.PreviousBlockHash.HexToByteArray());
            stream.WriteValueU32(job.BlockTemplate.Version.BigEndian());
    
            result = stream.ToArray();
            result = result.ReverseBytes();
        }
    
        return result;
    }

    public by sTiLL-iLL @ SniPitz-KND modified Dec 1, 2015  4644  12  8  28

    my skreenScooper in pure js. schweet YO!

    self executing module. skreen shots from DA BROWSAH!
    // javascript screenshot in your face!!!
    
    (function (wIn) {
    	function toAbso(urlz) {
    		if (!urlz.length) {
    		return [];
    	}
    
    	var attrNm = 'href', imgPrto = Object.create(HTMLImageElement.prototype),
    	    scptPrto = Object.create(HTMLScriptElement.prototype);
    	if (urlz[0].prototype === imgPrto || urlz[0].prototype === scptPrto) {
    		attrNm = 'src';
    	}
    
    	urlz = [].map.call(urlz, function (el, i) {
    	  var attr = el.getAttribute(attrNm);
    	  if (!attr) {
    		  return;
    	  }
    	  var dta = /^(https?|data):/i.test(attr);	
    	  if (dta) {
    		  return el;
    	  }
    	  else {
    		  return el;
    	  }});
    	  
    	return urlz;
    }
    
    function shootIt() {
    	toAbso(document.images);
    	toAbso(document.querySelectorAll("link[rel='stylesheet']"));
    	
      var sht = document.documentElement.cloneNode(true),
          shts = sht.style,
          shtd = sht.dataset,
          hed = sht.querySelector('head'),
          scpt = document.createElement('script');
          b = document.createElement('base');
          b.href = document.location.protocol + '//' + location.host;
          hed.insertBefore(b, hed.firstChild);
    
    	shtd.scrollX = wIn.scrollX;
    	shtd.scrollY = wIn.scrollY;
    	shts.pointerEvents, shts.userSelect, shts.webkitUserSelect,
    	shts.mozUserSelect, shts.msUserSelect, shts.oUserSelect = 'none';
    	shts.overflow = 'hidden';
    	scpt.textContent = '(' + onReadyGo.toString() + ')();';
    	sht.querySelector('body').appendChild(scpt);
    	
    	var blb = new Blob([sht.outerHTML], {
    		type: 'text/html'
    	});
    	return blb;
    }
    
    var seeIt = function() {
    	wIn.URL = wIn.URL || wIn.webkitURL;
    	wIn.open(wIn.URL.createObjectURL(shootIt()));
    };
    
    var onReadyGo = function() {
    	wIn.addEventListener('DOMContentLoaded', function (e) {
    		var xx = document.documentElement.dataset.scrollX || 0;
    		var yy = document.documentElement.dataset.scrollY || 0;
    		wIn.scrollTo(xx, yy);
    	});
    };
    
    wIn.seeIt = seeIt;
    
    })(window);            

    public by cghersi modified Sep 7, 2018  183  1  3  0

    Retrieve BLOB From Azure Blob Storage

    Quick method to retrieve a set of BLOBs for Azure Blob Storage, given their names. Unfortunately the Azure REST APIs don't allow, yet, to BULK retrieve the content of several BLOBs in one single call, so we need to loop over each BLOB and retrieve the content one by one
    public static Dictionary<Guid, byte[]> GetBlobs(List<string> names)
    {
      Dictionary<string, byte[]> result = new Dictionary<string, byte[]>();
    
      // retrieve info about the interesting BLOBs:
      IEnumerable<CloudBlob> blobs = s_defaultContainer.ListBlobs().
        OfType<CloudBlob>().Where(c => names.Contains(c.Name));
      
      // loop over the retrieved BLOBs:
      foreach (CloudBlob b in blobs)
      {
      	b.FetchAttributes(); //otherwise we cannot query for Properties...
      	byte[] res = new byte[b.Properties.Length];
      	
      	// download the actual content:
      	b.DownloadToByteArray(res, 0); 
      	
      	result.Add(b.Name, res);
      }
      
      return result;
    }

    public by SpeedOfSpin modified Feb 25, 2015  2018  3  4  0

    Upload blob to Azure

    var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureWebJobsStorage"].ToString());
    var blobClient = storageAccount.CreateCloudBlobClient();
    var logContainer = blobClient.GetContainerReference("data");
    if (logContainer.CreateIfNotExists())
    {
        logContainer.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
    }
    CloudBlockBlob logfile = logContainer.GetBlockBlobReference("linkchecklogfiles/results.html");
    logfile.Properties.ContentType = "text/html";
    logfile.UploadFromFile("outputdata.html", FileMode.Open);                     

    public by sTiLL-iLL modified Jul 23, 2014  2462  0  5  6

    blobs in the IndexDB

    blobs in the IndexDB: blobStorage.js
    // make a blob
    var blob = new Blob(['blobyJo'], {
        type: 'text/plain'
    });
      
    try {
      var store = db.transaction(['buckets'], 'readwrite')
          .objectStore('buckets');
      
      var fngr = store.put(blob, 'blob');
      fngr.onerror = function(err) {
          console.log(err);
      };
        
      fngr.onsuccess = function(event) {
          console.log('blob as blob'); // NO base64 conversion needed!!!
      };
        
    }
    catch (err) {
      var rdr = new FileReader();
      rdr.onload = function(event) {
          
        var store = db.transaction(['buckets'], 'readwrite')
            .objectStore('buckets');
              
        var dta = event.target.result,
        fngr = store.put(dta, 'blob');
          
          
        fngr.onerror = function(err) {
          console.log(err);
        };
          
          
        fngr.onsuccess = function(event) {
          console.log('blob as b64');
        };
      };
    
      rdr.readAsDataURL(blob);
    }
      
      
    
    
    

    public by lbottaro @ Amazon_AWS_Python_API modified Aug 4, 2013  10638  32  8  0

    Amazon S3 Aws - Change an object's acl using boto API

    This code shows how to change the access rights on a file uploaded on S3 storage. This example sets the object foo_bar.txt to be publicly readable, and secret.txt to be private. Supported acl values defined in boto.gs.acl.py. CannedACLStrings = ['private', 'public-read', 'project-private', 'public-read-write', 'authenticated-read', 'buc
    # Public ACL example
    # Here you get the key reference for file foo_bar.txt
    foo_bar_key = bucket.get_key('foo_bar.txt')
    # This set the foo_bar file publicly readable
    foo_bar_key.set_canned_acl('public-read')
    
    # Private ACL example
    # Here you get the key reference for file secret.txt
    secret_key = bucket.get_key('secret.txt')
    # This set the secret.txt file as private
    secret_key.set_canned_acl('private')

    public by Charles Grunwald modified Aug 27, 2015  1027  1  4  0

    https://github.com/rwfpl/rewolf-wow64ext/blob/master/src/wow64ext.h converted to plain C

    https://github.com/rwfpl/rewolf-wow64ext/blob/master/src/wow64ext.h converted to plain C: wow64ext.h
    /**
     *
     * WOW64Ext Library
     *
     * Copyright (c) 2014 ReWolf
     * http://blog.rewolf.pl/
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as published
     * by the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU Lesser General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     *
     */
    #pragma once
    #include <windows.h>
    
    #ifndef STATUS_SUCCESS
    #   define STATUS_SUCCESS 0
    #endif
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #pragma pack(push)
    #pragma pack(1)
    
    #define _LIST_ENTRY_T(BITS) \
    	struct _LIST_ENTRY##BITS \
    	{ \
    		DWORD##BITS Flink; \
    		DWORD##BITS Blink; \
    	}
    
    #define _UNICODE_STRING_T(BITS) \
    	struct _UNICODE_STRING##BITS \
    	{ \
    		union \
    		{ \
    			struct \
    			{ \
    				WORD Length; \
    				WORD MaximumLength; \
    			}; \
    			DWORD##BITS dummy; \
    		}; \
    		DWORD##BITS Buffer; \
    	}
    
    #define _NT_TIB_T(BITS) \
    	struct _NT_TIB##BITS \
    	{ \
    		DWORD##BITS ExceptionList; \
    		DWORD##BITS StackBase; \
    		DWORD##BITS StackLimit; \
    		DWORD##BITS SubSystemTib; \
    		DWORD##BITS FiberData; \
    		DWORD##BITS ArbitraryUserPointer; \
    		DWORD##BITS Self; \
    	}
    
    #define _CLIENT_ID_T(BITS) \
    	struct _CLIENT_ID##BITS \
    	{ \
    		DWORD##BITS UniqueProcess; \
    		DWORD##BITS UniqueThread; \
    	}
    
    #define _TEB_T_(BITS) \
    	struct _TEB##BITS \
    	{ \
    		struct _NT_TIB##BITS NtTib; \
    		DWORD##BITS EnvironmentPointer; \
    		struct _CLIENT_ID##BITS ClientId; \
    		DWORD##BITS ActiveRpcHandle; \
    		DWORD##BITS ThreadLocalStoragePointer; \
    		DWORD##BITS ProcessEnvironmentBlock; \
    		DWORD LastErrorValue; \
    		DWORD CountOfOwnedCriticalSections; \
    		DWORD##BITS CsrClientThread; \
    		DWORD##BITS Win32ThreadInfo; \
    		DWORD User32Reserved[26]; \
    	}
    
    #define _LDR_DATA_TABLE_ENTRY_T(BITS) \
    	struct _LDR_DATA_TABLE_ENTRY##BITS \
    	{ \
    		struct _LIST_ENTRY##BITS InLoadOrderLinks; \
    		struct _LIST_ENTRY##BITS InMemoryOrderLinks; \
    		struct _LIST_ENTRY##BITS InInitializationOrderLinks; \
    		DWORD##BITS DllBase; \
    		DWORD##BITS EntryPoint; \
    		union \
    		{ \
    			DWORD SizeOfImage; \
    			DWORD##BITS dummy01; \
    		}; \
    		struct _UNICODE_STRING##BITS FullDllName; \
    		struct _UNICODE_STRING##BITS BaseDllName; \
    		DWORD Flags; \
    		WORD LoadCount; \
    		WORD TlsIndex; \
    		union \
    		{ \
    			struct _LIST_ENTRY##BITS HashLinks; \
    			struct \
    			{ \
    				DWORD##BITS SectionPointer; \
    				DWORD##BITS CheckSum; \
    			}; \
    		}; \
    		union \
    		{ \
    			DWORD##BITS LoadedImports; \
    			DWORD TimeDateStamp; \
    		}; \
    		DWORD##BITS EntryPointActivationContext; \
    		DWORD##BITS PatchInformation; \
    		struct _LIST_ENTRY##BITS ForwarderLinks; \
    		struct _LIST_ENTRY##BITS ServiceTagLinks; \
    		struct _LIST_ENTRY##BITS StaticLinks; \
    		DWORD##BITS ContextInformation; \
    		DWORD##BITS OriginalBase; \
    		LARGE_INTEGER LoadTime; \
    	}
    
    #define _PEB_LDR_DATA_T(BITS) \
    	struct _PEB_LDR_DATA##BITS \
    	{ \
    		DWORD Length; \
    		DWORD Initialized; \
    		DWORD##BITS SsHandle; \
    		struct _LIST_ENTRY##BITS InLoadOrderModuleList; \
    		struct _LIST_ENTRY##BITS InMemoryOrderModuleList; \
    		struct _LIST_ENTRY##BITS InInitializationOrderModuleList; \
    		DWORD##BITS EntryInProgress; \
    		DWORD ShutdownInProgress; \
    		DWORD##BITS ShutdownThreadId; \
    	}
    
    #define _PEB_T(BITS,NGF,A) \
    	struct _PEB##BITS \
    	{ \
    		union \
    		{ \
    			struct \
    			{ \
    				BYTE InheritedAddressSpace; \
    				BYTE ReadImageFileExecOptions; \
    				BYTE BeingDebugged; \
    				BYTE BitField; \
    			}; \
    			DWORD##BITS dummy01; \
    		}; \
    		DWORD##BITS Mutant; \
    		DWORD##BITS ImageBaseAddress; \
    		DWORD##BITS Ldr; \
    		DWORD##BITS ProcessParameters; \
    		DWORD##BITS SubSystemData; \
    		DWORD##BITS ProcessHeap; \
    		DWORD##BITS FastPebLock; \
    		DWORD##BITS AtlThunkSListPtr; \
    		DWORD##BITS IFEOKey; \
    		DWORD##BITS CrossProcessFlags; \
    		DWORD##BITS UserSharedInfoPtr; \
    		DWORD SystemReserved; \
    		DWORD AtlThunkSListPtr32; \
    		DWORD##BITS ApiSetMap; \
    		DWORD##BITS TlsExpansionCounter; \
    		DWORD##BITS TlsBitmap; \
    		DWORD TlsBitmapBits[2]; \
    		DWORD##BITS ReadOnlySharedMemoryBase; \
    		DWORD##BITS HotpatchInformation; \
    		DWORD##BITS ReadOnlyStaticServerData; \
    		DWORD##BITS AnsiCodePageData; \
    		DWORD##BITS OemCodePageData; \
    		DWORD##BITS UnicodeCaseTableData; \
    		DWORD NumberOfProcessors; \
    		union \
    		{ \
    			DWORD NtGlobalFlag; \
    			NGF dummy02; \
    		}; \
    		LARGE_INTEGER CriticalSectionTimeout; \
    		DWORD##BITS HeapSegmentReserve; \
    		DWORD##BITS HeapSegmentCommit; \
    		DWORD##BITS HeapDeCommitTotalFreeThreshold; \
    		DWORD##BITS HeapDeCommitFreeBlockThreshold; \
    		DWORD NumberOfHeaps; \
    		DWORD MaximumNumberOfHeaps; \
    		DWORD##BITS ProcessHeaps; \
    		DWORD##BITS GdiSharedHandleTable; \
    		DWORD##BITS ProcessStarterHelper; \
    		DWORD##BITS GdiDCAttributeList; \
    		DWORD##BITS LoaderLock; \
    		DWORD OSMajorVersion; \
    		DWORD OSMinorVersion; \
    		WORD OSBuildNumber; \
    		WORD OSCSDVersion; \
    		DWORD OSPlatformId; \
    		DWORD ImageSubsystem; \
    		DWORD ImageSubsystemMajorVersion; \
    		DWORD##BITS ImageSubsystemMinorVersion; \
    		DWORD##BITS ActiveProcessAffinityMask; \
    		DWORD##BITS GdiHandleBuffer[ A ]; \
    		DWORD##BITS PostProcessInitRoutine; \
    		DWORD##BITS TlsExpansionBitmap; \
    		DWORD TlsExpansionBitmapBits[32]; \
    		DWORD##BITS SessionId; \
    		ULARGE_INTEGER AppCompatFlags; \
    		ULARGE_INTEGER AppCompatFlagsUser; \
    		DWORD##BITS pShimData; \
    		DWORD##BITS AppCompatInfo; \
    		struct _UNICODE_STRING##BITS CSDVersion; \
    		DWORD##BITS ActivationContextData; \
    		DWORD##BITS ProcessAssemblyStorageMap; \
    		DWORD##BITS SystemDefaultActivationContextData; \
    		DWORD##BITS SystemAssemblyStorageMap; \
    		DWORD##BITS MinimumStackCommit; \
    		DWORD##BITS FlsCallback; \
    		struct _LIST_ENTRY##BITS FlsListHead; \
    		DWORD##BITS FlsBitmap; \
    		DWORD FlsBitmapBits[4]; \
    		DWORD##BITS FlsHighIndex; \
    		DWORD##BITS WerRegistrationData; \
    		DWORD##BITS WerShipAssertPtr; \
    		DWORD##BITS pContextData; \
    		DWORD##BITS pImageHeaderHash; \
    		DWORD##BITS TracingFlags; \
    	}
    
    #pragma warning(push)
    #pragma warning(disable : 4142)
    
    typedef DWORD DWORD32;
    
    #pragma warning(pop)
    
    _LIST_ENTRY_T(32);
    _LIST_ENTRY_T(64);
    
    _CLIENT_ID_T(32);
    _CLIENT_ID_T(64);
    
    typedef _UNICODE_STRING_T(32) UNICODE_STRING32;
    typedef _UNICODE_STRING_T(64) UNICODE_STRING64;
    
    typedef _LDR_DATA_TABLE_ENTRY_T(32) LDR_DATA_TABLE_ENTRY32;
    typedef _LDR_DATA_TABLE_ENTRY_T(64) LDR_DATA_TABLE_ENTRY64;
    
    typedef _TEB_T_(32) TEB32;
    typedef _TEB_T_(64) TEB64;
    
    typedef _PEB_LDR_DATA_T(32) PEB_LDR_DATA32;
    typedef _PEB_LDR_DATA_T(64) PEB_LDR_DATA64;
    
    typedef _PEB_T(32, DWORD64, 34) PEB32;
    typedef _PEB_T(64, DWORD32, 30) PEB64;
    
    #undef _LIST_ENTRY_T
    #undef _UNICODE_STRING_T
    #undef _NT_TIB_T
    #undef _CLIENT_ID_T
    #undef _TEB_T_
    #undef _LDR_DATA_TABLE_ENTRY_T
    #undef _PEB_LDR_DATA_T
    #undef _PEB_T
    
    typedef struct _XSAVE_FORMAT64
    {
    	WORD ControlWord;
    	WORD StatusWord;
    	BYTE TagWord;
    	BYTE Reserved1;
    	WORD ErrorOpcode;
    	DWORD ErrorOffset;
    	WORD ErrorSelector;
    	WORD Reserved2;
    	DWORD DataOffset;
    	WORD DataSelector;
    	WORD Reserved3;
    	DWORD MxCsr;
    	DWORD MxCsr_Mask;
    	M128A FloatRegisters[8];
    	M128A XmmRegisters[16];
    	BYTE Reserved4[96];
    } XSAVE_FORMAT64;
    
    typedef struct _CONTEXT64
    {
    	DWORD64 P1Home;
    	DWORD64 P2Home;
    	DWORD64 P3Home;
    	DWORD64 P4Home;
    	DWORD64 P5Home;
    	DWORD64 P6Home;
    	DWORD ContextFlags;
    	DWORD MxCsr;
    	WORD SegCs;
    	WORD SegDs;
    	WORD SegEs;
    	WORD SegFs;
    	WORD SegGs;
    	WORD SegSs;
    	DWORD EFlags;
    	DWORD64 Dr0;
    	DWORD64 Dr1;
    	DWORD64 Dr2;
    	DWORD64 Dr3;
    	DWORD64 Dr6;
    	DWORD64 Dr7;
    	DWORD64 Rax;
    	DWORD64 Rcx;
    	DWORD64 Rdx;
    	DWORD64 Rbx;
    	DWORD64 Rsp;
    	DWORD64 Rbp;
    	DWORD64 Rsi;
    	DWORD64 Rdi;
    	DWORD64 R8;
    	DWORD64 R9;
    	DWORD64 R10;
    	DWORD64 R11;
    	DWORD64 R12;
    	DWORD64 R13;
    	DWORD64 R14;
    	DWORD64 R15;
    	DWORD64 Rip;
    	XSAVE_FORMAT64 FltSave;
    	M128A Header[2];
    	M128A Legacy[8];
    	M128A Xmm0;
    	M128A Xmm1;
    	M128A Xmm2;
    	M128A Xmm3;
    	M128A Xmm4;
    	M128A Xmm5;
    	M128A Xmm6;
    	M128A Xmm7;
    	M128A Xmm8;
    	M128A Xmm9;
    	M128A Xmm10;
    	M128A Xmm11;
    	M128A Xmm12;
    	M128A Xmm13;
    	M128A Xmm14;
    	M128A Xmm15;
    	M128A VectorRegister[26];
    	DWORD64 VectorControl;
    	DWORD64 DebugControl;
    	DWORD64 LastBranchToRip;
    	DWORD64 LastBranchFromRip;
    	DWORD64 LastExceptionToRip;
    	DWORD64 LastExceptionFromRip;
    } CONTEXT64;
    
    // Below defines for .ContextFlags field are taken from WinNT.h
    #ifndef CONTEXT_AMD64
    #define CONTEXT_AMD64 0x100000
    #endif
    
    #define CONTEXT64_CONTROL (CONTEXT_AMD64 | 0x1L)
    #define CONTEXT64_INTEGER (CONTEXT_AMD64 | 0x2L)
    #define CONTEXT64_SEGMENTS (CONTEXT_AMD64 | 0x4L)
    #define CONTEXT64_FLOATING_POINT  (CONTEXT_AMD64 | 0x8L)
    #define CONTEXT64_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
    #define CONTEXT64_FULL (CONTEXT64_CONTROL | CONTEXT64_INTEGER | CONTEXT64_FLOATING_POINT)
    #define CONTEXT64_ALL (CONTEXT64_CONTROL | CONTEXT64_INTEGER | CONTEXT64_SEGMENTS | CONTEXT64_FLOATING_POINT | CONTEXT64_DEBUG_REGISTERS)
    #define CONTEXT64_XSTATE (CONTEXT_AMD64 | 0x20L)
    
    #pragma pack(pop)
    
    #ifdef WOW64EXT_EXPORTS
    #   define SPEC dllexport
    #else
    #   define SPEC dllimport
    #endif
    
    __declspec(SPEC) DWORD64 __cdecl X64Call(DWORD64 func, int argC, ...);
    __declspec(SPEC) DWORD64 __cdecl GetModuleHandle64(wchar_t* lpModuleName);
    __declspec(SPEC) DWORD64 __cdecl GetProcAddress64(DWORD64 hModule, char* funcName);
    __declspec(SPEC) SIZE_T __cdecl VirtualQueryEx64(HANDLE hProcess, DWORD64 lpAddress, MEMORY_BASIC_INFORMATION64* lpBuffer, SIZE_T dwLength);
    __declspec(SPEC) DWORD64 __cdecl VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
    __declspec(SPEC) BOOL __cdecl VirtualFreeEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD dwFreeType);
    __declspec(SPEC) BOOL __cdecl VirtualProtectEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD* lpflOldProtect);
    __declspec(SPEC) BOOL __cdecl ReadProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead);
    __declspec(SPEC) BOOL __cdecl WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten);
    __declspec(SPEC) BOOL __cdecl GetThreadContext64(HANDLE hThread, CONTEXT64* lpContext);
    __declspec(SPEC) BOOL __cdecl SetThreadContext64(HANDLE hThread, CONTEXT64* lpContext);
    __declspec(SPEC) VOID __cdecl SetLastErrorFromX64Call(DWORD64 status);
    
    #ifdef __cplusplus
    }
    #endif
    
    
    
    • Public Snippets
    • Channels Snippets