GithubHelp home page GithubHelp logo

cs_open problem about capstone HOT 7 OPEN

12UE avatar 12UE commented on June 15, 2024
cs_open problem

from capstone.

Comments (7)

12UE avatar 12UE commented on June 15, 2024

QQ截图20230924132241

from capstone.

Rot127 avatar Rot127 commented on June 15, 2024

Could you please provide a minimal example to run. With the output you expect and what the actual behavior is.

from capstone.

12UE avatar 12UE commented on June 15, 2024

error code 4,but i'm32gb dram .memory enough correct platform

from capstone.

12UE avatar 12UE commented on June 15, 2024
#include <stdio.h>
#include <inttypes.h>
#include<capstone.h>
#pragma comment(lib,"capstone.lib")

int main(int argc, char* argv[])
{
	auto buffer = "\x55\x8b\xec\x81\xec\x24\x03\x00\x00\x6a\x17\x90\x90\x90";

	csh handle;
	cs_insn* insn;
	size_t count;

	int size = 14;

	printf("By: LyShark \n\n");
	
	if (cs_open(CS_ARCH_X86, CS_MODE_32, &handle) != CS_ERR_OK)
	{
		return 0;
	}

	// https://www.cnblogs.com/lyshark
	count = cs_disasm(handle, (unsigned char*)buffer, size, 0x1000, 0, &insn);

	if (count > 0)
	{
		size_t index;
		for (index = 0; index < count; index++)
		{
			for (int x = 0; x < insn[index].size; x++)
			{
				printf("machine code: %d -> %02X \n", x, insn[index].bytes[x]);
			}

			printf("ADDR: 0x%llx| length: %d ASM: %s %s \n", insn[index].address, insn[index].size, insn[index].mnemonic, insn[index].op_str);
		}

		cs_free(insn, count);
	}
	else
	{
		printf("disasm failed! \n");
	}

	cs_close(&handle);

	getchar();
	return 0;
}

from capstone.

12UE avatar 12UE commented on June 15, 2024

图片

from capstone.

kabeor avatar kabeor commented on June 15, 2024

@12UE Works fine on g++. Can you try this in MSVC to see if it works?

from capstone.

12UE avatar 12UE commented on June 15, 2024

msvc not working

from capstone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.