avatar
Articles
415
Tags
259
Categories
26

Theqiqi_blog
Search

Theqiqi_blog

11.使用C语言在windows中动态调用动态链接库
Created2024-08-05|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言在windows中动态调用自己写的动态链接库1.使用C语言在VistualStudio2022中创建动态链接库项目 新建项目->windows桌面->动态链接库(DLL)->项目名称dll1 属性->c/c++->代码生成->运行库设置为多线程调试DLL(/MTd) 选择Solution Explorer->Property->c/c++->Procompiled Headers->选择Not Using Precompiled Headers 新建文件myfunc.h,与myfunc.c myfunc.h 1234//myfunc.h#pragma once__declspec(dllexport) int add(int numberA, int numberB); myfunc.c 12345678//myfunc.c#include "pch.h"#include "myfunc.h"int add(int nu ...
10.使用C语言在windows中获得句柄
Created2024-08-05|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言在windows中获得进程句柄C语言在windows中获得自己的进程句柄使用GetCurrentProcess()或者-1可以得到自身进程的句柄 1234567891011121314#include <windows.h>#include <stdio.h>int main(int argc, char* argv[]){ DWORD dwProcessId = 116348; HANDLE hProcess1 = GetCurrentProcess(); printf("hProcess is %p\n", hProcess1); CloseHandle(hProcess1); printf("hProcess is %p\n", -1); return 0;} C语言在windows中获得其他进程的句柄使用OpenProcess函数 123456789101112131415161718#include <windows.h>#include <s ...
9.C语言注入带参数的函数
Created2024-08-05|c+windows+hacking|C•Windows•Hacking
[toc] C语言调用带参函数的例子1.C语言传递参数的例子12345678910111213#include <windows.h>void Message(int a){ MessageBoxA(NULL, "HellWorld", "Text", a);}int main(int argc, char** argv){ int a = 1; Message(a); return 0;} 2. 通过指针传递变量的值1234567891011121314#include <windows.h>void Message(int a){ MessageBoxA(NULL, "HellWorld", "Text", a);}int main(int argc, char** argv){ int a = 1; int* p = &a; Message(* ...
8.使用C语言编写代码将函数注入到32位程序中
Created2024-08-05|c+windows+hacking|C•Windows•Hacking
[toc] 使用c语言将C语言函数注入到x86程序中1.用c语言写一个弹出消息框MessageBoxA的程序 在项目中属性->高级->随机基地址中选择关闭 代码如下 123456789//message.c#include <windows.h>#include <stdio.h>int main(int argc,char**argv){ MessageBoxA(NULL,"HellWorld","Text",MB_OK); getchar(); return 0;} 3.编译后运行查看结果 2. 用c语言写一个注入内联x86汇编指令的程序1.完善Hello,World程序,打印出函数地址与进程pid12345678910111213141516171819202122232425262728//message.c#include <windows.h>#include <stdio.h>void Message(){ M ...
7.c语言编写x86汇编代码转为机器码注入到32位程序中
Created2024-08-05|c+windows+hacking|C•Windows•Hacking
[toc] 使用c语言将x86汇编代码注入到32位程序中1.用c语言写一个弹出消息框MessageBoxA的程序 在项目中属性->高级->随机基地址中选择关闭 代码如下 12345678#include <windows.h>#include <stdio.h>int main(int argc,char**argv){ MessageBoxA(NULL,"HellWorld","Text",MB_OK); getchar(); return 0;} 3.编译后运行查看结果 2. 用c语言写一个注入x86汇编指令的程序1.完善Hello,World程序,打印出函数地址与进程pid1234567891011121314151617181920212223242526#include <windows.h>#include <stdio.h>void Message(){ MessageBoxA(NULL, "Hel ...
6.使用C语言在windows中创建线程与进程并且创建具有system权限进程
Created2024-08-05|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言在windows中执行远程线程1. C语言中的多线程简单使用thrd_create注意:使用多线程标准库需要C语言C11以上的版本,编译程序时候需选择MTD/MT。 1234567891011121314151617181920212223242526272829303132333435363738#include <stdio.h>#include <stdlib.h>#include <threads.h>#include <windows.h>// 新线程要执行的代码int ThreadFunction(void* arg) { int thread_id = *((int*)arg); for (int i = 0; i < 10; i++) { Sleep(1000); printf("线程 %d 打印次数 %d...\n", thread_id,i+1); } printf(& ...
5.使用C语言在windows中修改内存权限
Created2024-08-04|c+windows+hacking|C•Windows•Hacking
[toc] C语言修改x86内存权限使程序可以读写全局常量的值1.在C语言中全局变量的可读不可写 读取全局常量的值,成功执行 1234567891011121314#include <stdio.h>int c_Var = 0x400000;int main(int argc, char* argv[]){ printf("%d\n", c_Var); __asm { mov dword ptr[c_Var], 634 } printf("%d\n", c_Var); return 0;} 写入全局只读变量的值,程序崩溃。 12345678910111213141516#include <windows.h>#include <stdio.h>const int c_Var = 0x400000;int main(int argc, char* argv[]){ printf("%d\n", c_Var); __asm & ...
4.使用C语言在windows分配其他程序的内存空间
Created2024-08-04|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言在windows分配其他程序的内存空间1. C语言程序中使用malloc分配内存空间123456789#include <windows.h>#include <stdio.h>int main(int argc, char* argv[]){ DWORD* lpBaseAddr = malloc(sizeof(DWORD)); return 0;} 2.Windows使用VirtualAllocEx给其他进程分配空间123456789101112131415#include <windows.h>#include <stdio.h>int main(int argc, char* argv[]){ DWORD dwProcessId = 85064; DWORD size=0xFFF; HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId); LPVOID lpAddress = Vi ...
3.使用c语言在windows中写入数据到程序中
Created2024-08-04|c+windows+hacking|C•Windows•Hacking
[toc] 使用c语言在windows中写入数据到程序中1. C语言中写数据使用赋值符号=代码演示: 12345678910111213141516171819//Messageb.c#include <stdio.h>#include <windows.h>int main(int argc, char** argv){ int i = 666; label: printf("var i vulue is %d\n", i); printf("var i address is 0x%p\n", &i); int* p = &i; printf("var i vulue is %d\n", *p); printf("var i address is 0x%p\n", p); printf("point p address is 0x%p\n", &p); ...
2.使用c语言在windows中读取程序的数据
Created2024-08-03|c+windows+hacking|C•Windows•Hacking
[toc] 使用c语言在windows中读取程序的数据1. C语言通过指针来获取地址的数据 完整代码: 123456789101112131415//Message.c#include <stdio.h>int main(int argc, char** argv){ int i = 666; printf("var i vulue is %d\n", i); printf("var i address is 0x%p\n", &i); int *p = &i; printf("var i vulue is %d\n", *p); printf("var i address is 0x%p\n", p); printf("point p address is 0x%p\n", &p); getchar(); return 0;} 为了方便测试,在 ...
1…313233…42
avatar
Theqiqi
Articles
415
Tags
259
Categories
26
Follow Me
Announcement
This is my Blog
Recent Post
03-反馈流2026-08-21
02-错误流2026-08-21
01-控制流2026-08-20
05-多系统协作的十条流2026-08-19
04-多层系统的十条流2026-08-18
Categories
  • C with Socks16
  • C_Sound10
  • C_Windows_Graphi9
  • Cpp5
  • Cpp_Socket4
  • C语言在Windows中实现抓包4
  • C语言的万种用法9
  • Debian1
Tags
十阶段 接口先行 Qt主题架构 WindowsDriver python 从输入到交互 select LinuxDriver 入口系统 UDP服务器与可靠性 微服务与组装边界 DLL javascript 多系统组成的网络通信软件 Piano 拆解资源 游戏类型演化 Kali 建模与逆向 BSD Sockets x86汇编程序 IPV4 Drvier 认知能力分解 技术流 qemu Ninja 业务流程到功能点 用头文件验证依赖 引擎组装 Sound 从状态到系统 epoll QEMU 依赖接口 shell 依赖关系 Graphi 拆解美术 只有组件的子系统如何被加载
Archives
  • August 2026128
  • January 20261
  • April 20251
  • March 202595
  • February 202523
  • September 20242
  • August 202471
  • June 20242
Info
Article :
415
UV :
PV :
Last Update :
©2020 - 2026 By Theqiqi
Framework Hexo|Theme Butterfly
Search
Loading the Database