[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/fzxcp3/ShellcodeCompiler/master/ShellcodeCompiler/KeystoneLib.cpp [Back]  [Original]

#include "KeystoneLib.h"

// Function used to assemble code with keystone. Code taken from keystone sample and adapted

unsigned char* KeystoneLib::Assemble(size_t *p_pSize, string p_sASM)
{
	ks_engine *ks;
	ks_err err = KS_ERR_ARCH;
	size_t count;
	unsigned char *encode;
	size_t size;
	unsigned char *output = NULL;

	// Open keystone engine

	if(Platform::GetPlatform() == PLATFORM_TYPE_WINDOWS_X64 || Platform::GetPlatform() == PLATFORM_TYPE_LINUX_X64) err = ks_open(KS_ARCH_X86, KS_MODE_64, &ks);
	else err = ks_open(KS_ARCH_X86, KS_MODE_32, &ks);

	if (err != KS_ERR_OK) {
		cout 

Web Proxy Viewer  |  New URL  |  Original Page