avatar
Articles
286
Tags
104
Categories
25

Theqiqi_blog
Search

Theqiqi_blog

12.使用C语言将动态链接库通过远程线程加载到进程中
Created2024-08-06|c+windows+hacking|C•Windows•Hacking
[toc] c语言程序动态链接库的简单实例1. 新建一个动态库项目,在动态库入口点中弹出一个MessageBoxW在动态链接库项目中关闭预编译头文件 123456789101112131415161718192021222324// dllmain.c : Defines the entry point for the DLL application.#include <windows.h>BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ){ switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: MessageBoxW(NULL, L"how you doing", L"what' ...
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); ...
1…181920…29
avatar
Theqiqi
Articles
286
Tags
104
Categories
25
Follow Me
Announcement
This is my Blog
Recent Post
101.使用Grop网站提供的api2026-01-03
9.压测2025-03-27
8.Linux Socket并发模型http服务器2025-03-27
7.web服务器中收发REST接口2025-03-27
6使用c语言与linux系统写一个web服务器,解析并响应get与post请求2025-03-27
Categories
  • C with Socks16
  • C_Sound10
  • C_Windows_Graphi9
  • Cpp5
  • Cpp_Socket4
  • C语言在Windows中实现抓包4
  • C语言的万种用法9
  • Debian1
Tags
cmake Cmake ipv4 x86汇编程序 Hacking LinuxDriver Python C++ android c_windows_driver Drvier epoll Piano OpenGl Disk linux MySql web Ethernet WindowsDrive jsp gtest html poll LinSock first pragram AI UART javascript System C http opencv Sound system PVE Hook Graphi Qt5.8 c语言的万种用法
Archives
  • January 20261
  • March 202595
  • February 202523
  • September 20242
  • August 202471
  • June 20242
  • March 202443
  • February 20248
Info
Article :
286
UV :
PV :
Last Update :
©2020 - 2026 By Theqiqi
Framework Hexo|Theme Butterfly
Search
Loading the Database