avatar
Articles
286
Tags
104
Categories
25

Theqiqi_blog
Search

Theqiqi_blog

22.使用C语言获取系统架构
Created2024-08-11|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言获取系统架构1. 使用GetNativeSystemInfo获取系统架构1234567891011121314151617181920212223#include <windows.h>#include <stdio.h>BOOL Is64BitOS(){ SYSTEM_INFO stInfo = { 0 }; GetNativeSystemInfo(&stInfo); if (stInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64 || stInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { return TRUE; } return FALSE;}int main(){ if (Is64BitOS()) printf(&q ...
21.使用C语言与汇编语言调用syscall重写进程相关函数
Created2024-08-11|c+windows+hacking|C•Windows•Hacking
[toc] 调用win32相关函数读取进程内存数据与shellcode注入1. 用C语言写一个程序Message.exe12345678910111213141516171819202122//Message.c#include <stdio.h>#include <windows.h>void Message(){ MessageBoxA(0, 0, 0, 0);}int main(int argc, char** argv){ size_t var = 0x8070605040302010; printf("var vulue is 0x%llX\n", var); printf("var address is 0x%p\n", &var); size_t* p = &var; printf("var vulue is 0x%llX\n", *p); printf("var ...
20.将Dll文件转为二进制代码运行时解压出来
Created2024-08-10|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言读取与写入文件1. c语言读取文件 新建一个文本文件,命名为first.txt。 在first.txt中编辑文本。 编写C语言代码在程序中读取文本内容。 123456789101112131415161718#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>int main(){ FILE* fp = NULL; char buff[255]; fp = fopen("D:\\Users\\3\\Desktop\\first.txt", "r"); fgets(buff, 255, (FILE*)fp); printf("1: %s\n", buff); fgets(buff, 255, (FILE*)fp); printf("2: %s\n", buff); fgets(buff, 255, (FILE*)fp); printf("3: %s\n", buff); fclose(fp); ...
19.使用C语言获取进程模块句柄
Created2024-08-10|c+windows+hacking|C•Windows•Hacking
[toc] 遍历进程与模块1.设置Debug权限用来打开system进程句柄 设置Debug权限需要用管理员的什么打开 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include <stdio.h>#include <windows.h>BOOL SeDebug(BOOL bEnablePrivilege);int main(int argc, char** argv){ SeDebug(TRUE); DWORD dwPid=1180; HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPid); printf("hProcess:0x%llX\n", hProcess); CloseHandle(hProcess); getchar(); return 0;}BOOL SeDebug(BOOL bEnablePr ...
18.使用C语言在windows程序中遍历进程并打印
Created2024-08-10|c+windows+hacking|C•Windows•Hacking
[toc] C语言遍历1.使用while循环123456789101112#include <stdio.h>int main(int argv, char* argc[]){ int a = 10; while (a < 20) { printf("a 的值: %d\n", a); a++; } return 0;} 2.使用do{}while()循环do{}while()为先执行后判断 123456789101112#include <stdio.h>int main(int argv, char* argc[]){ int a = 10; do { printf("a 的值: %d\n", a); a++; } while (a < 20); return 0;} 3.使用while循环给数组赋值123 ...
17.C语言获得窗口句柄与进程句柄
Created2024-08-09|c+windows+hacking|C•Windows•Hacking
[toc] C语言获取窗口句柄1.C语言获取控制台程序的句柄 完整代码功能为获取控制台程序的窗口句柄并在窗口用TextOutW写句话 12345678910111213141516171819202122232425262728#include <windows.h>#include <conio.h>#include <tchar.h>int main(int argc, char** argv) { TCHAR title[256];//控制台程序标题 //获取控制台标题 GetConsoleTitleW(title, 256); HWND hwnd1 = FindWindowW(0, title); HWND hwnd2 = FindWindowW(L"ConsoleWindowClass", 0); HWND hwnd3 = GetConsoleWindow(); HWND hwnd4 = GetForegroundWindow(); HWND hwnd = ...
16.寻找植物大战丧尸call并使用C语言调用
Created2024-08-09|c+windows+hacking|C•Windows•Hacking
[toc] 使用CE寻找种植Call并编写自动汇编脚本1. 通过CE找到汇编Call(掠过)2. 编写自动汇编脚本1234567891011121314151617181920212223242526[ENABLE]//code from here to '[DISABLE]' will be used to enable the cheatalloc(newmem,1024)createthread(newmem)newmem://根据基地址和偏移量计算第一个参数的变量地址mov ebx,00729670mov ebx,[ebx]mov ebx,[ebx+868]//call functionpush FFFFFFFF //常量-1push 2 //种植ID 此刻为樱桃炸弹mov eax,4 //Y轴座标push 0 //x轴坐标push ebx//地址[PlantsVsZombies.exe+329670]+868call 0040FA10//函数地址ret[DISABLE]//co ...
15.寻找进程中的MessageBoxA函数Call并调用
Created2024-08-08|c+windows+hacking|C•Windows•Hacking
[toc] x86程序中的写法1. ce寻找MessageoxA函数地址并通过自动汇编调用MessageBoxA 打开CE,附加程序 搜索MessageBoxA的地址 编写自动汇编代码调用MessgeBoxA 写法1:使用push传递参数 123456789101112131415161718[ENABLE]Alloc(newaddr,100)createThreadAndWait(newaddr)newaddr:push 0push 0push 0push 0call 7714B730ret[DISABLE]dealloc(newaddr)//Auto Assembler Commands//https://wiki.cheatengine.org/index.php?title=Auto_Assembler:Commands 写法2:使用push传递参数并保存ebp 123456789101112131415161718192021[ENABLE]Alloc(newaddr,100)createThreadAndWait(newaddr)newaddr:push ...
14.使用C语言将动态链接库加载到进程后调用汇编Call
Created2024-08-07|c+windows+hacking|C•Windows•Hacking
[toc] 使用C语言将动态链接库加载到实验程序后调用汇编Call1.写一个C语言程序,在程序里通过内联汇编调用C语言函数1234567891011121314151617181920212223242526272829//Message.c#include <windows.h>#include <stdio.h> void Message(){ MessageBoxA(NULL, "HellWorld", "Text", MB_OK);}void AsmMessage(){ __asm { mov edx, 0x00411406 //0x00411406 is Message() address call edx }}int main(int argc, char** argv){ printf("MessageBoxA address is 0x%p\n", & ...
13.c语言使用vs2022分析c语言程序并手写x86与x86_64内联汇编程序
Created2024-08-06|c+windows+hacking|C•Windows•Hacking
[toc] 用C语言写一个x86内联汇编程序1. 用C语言写一个程序,内容为调用MessageBoxA函数完整代码: 123456789101112131415//Message.c#include <windows.h>#include <stdio.h> int main(int argc, char** argv){ printf("0x%p", &MessageBoxA); MessageBoxA(NULL, "HellWorld", "Text", MB_OK); MSG msg; while (GetMessageW(&msg, NULL, NULL, NULL)) { } return 0;} 结果如图所示: 2. 用C语言与x86内联汇编写一个程序,内容为调用MessageBoxA函数完整代码 1234567891011121314151617181920212223242526 ...
1…171819…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