随笔分类 -  Windows编程

摘要:Go在windows上调用本地进程传参时的一个天坑 #Golang go在windows上exec.Command调用本地进程在传参的时候有一个天坑,举个栗子来说正常来说一般代码会这么写 ```go cmdLine := "notepad.exe " + `"D:\Program Files\Not 阅读全文
posted @ 2023-05-30 17:10 DirWangK 阅读(629) 评论(0) 推荐(0)
摘要:get kernel32 addr and get func #include <winternl.h> typedef struct _MY_PEB_LDR_DATA { ULONG Length; BOOL Initialized; PVOID SsHandle; LIST_ENTRY InLo 阅读全文
posted @ 2021-09-20 19:01 DirWangK 阅读(93) 评论(0) 推荐(0)
摘要:Thread Local Storage 关联问题:Debug下tls回调正常,release下却没有执行、Thread Local Storage Exception Handler error 链接:c++ - Exception Handler error code in Thread Loc 阅读全文
posted @ 2021-09-10 15:02 DirWangK 阅读(267) 评论(0) 推荐(0)
摘要:LNK2026 SAFESEH 映像是不安全的 - DirWangK - 博客园 (cnblogs.com) Error LNK2026 module unsafe for SAFESEH image. Error LNK1281 Unable to generate SAFESEH image. 阅读全文
posted @ 2021-09-03 13:50 DirWangK 阅读(369) 评论(0) 推荐(0)
摘要:修改注册表 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup 重启安装程序,安装位置已修改 阅读全文
posted @ 2021-07-26 09:02 DirWangK 阅读(2962) 评论(0) 推荐(0)
摘要:typedef struct _IMAGE_DATA_DIRECTORY { DWORD VirtualAddress; DWORD Size; } IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; IMAGE_DIRECTORY_ENTRY_SECURIT 阅读全文
posted @ 2021-07-15 15:38 DirWangK 阅读(567) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-07-01 17:54 DirWangK 阅读(70) 评论(0) 推荐(0)
摘要:openssl: http://slproweb.com/products/Win32OpenSSL.html 旧版代码 HMAC_CTX hctx; HMAC_CTX_init(&hctx); HMAC_Init_ex(&hctx, mac_key, sizeof(mac_key), EVP_sh 阅读全文
posted @ 2021-06-30 17:04 DirWangK 阅读(984) 评论(0) 推荐(0)
摘要:WAY 1: 1、右键 .asm 文件,点击“属性”。 2、在项类型里选择“自定义生成工具”。 3、点击应用,然后点击左边“自定义生成工具”里的“常规”。 4、在“命令行”里输入 ml64 /Fo $(IntDir)%(fileName).obj /c %(fileName).asm 在“输出”里输 阅读全文
posted @ 2021-04-30 14:16 DirWangK 阅读(3518) 评论(0) 推荐(2)
摘要:https://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows It's fairly easy using the New-SelfSig 阅读全文
posted @ 2021-01-27 17:46 DirWangK 阅读(364) 评论(0) 推荐(0)
摘要:linux通常使用GNU C提供的函数getopt、getopt_long、getopt_long_only函数来解析命令行参数。 移植到Windows下 getopt.h #ifndef _GETOPT_H #define _GETOPT_H #ifdef __cplusplus extern " 阅读全文
posted @ 2020-10-04 15:09 DirWangK 阅读(572) 评论(0) 推荐(0)
摘要:pe中TLS(thread local storage)中函数的执行时机早于入口函数(entry point), 相关结构: // // Thread Local Storage // typedef VOID (NTAPI *PIMAGE_TLS_CALLBACK) ( PVOID DllHand 阅读全文
posted @ 2020-08-14 20:42 DirWangK 阅读(631) 评论(0) 推荐(0)
摘要:编写dll处理hook逻辑,注入到目标进程,实现api hook。 Windows10 notepad,通过hook kernel32.dll.WriteFile,实现小写字母转大写保存到文件。 hook前kernel32.dll.WriteFile入口: kernel32.dll.WriteFil 阅读全文
posted @ 2020-08-13 18:45 DirWangK 阅读(574) 评论(0) 推荐(0)
摘要:hook逻辑写入dll中,注入dll。 #include "pch.h" #include <tchar.h> #include "windows.h" //WINBASEAPI //BOOL //WINAPI //WriteFile( // _In_ HANDLE hFile, // _In_re 阅读全文
posted @ 2020-08-12 21:20 DirWangK 阅读(388) 评论(0) 推荐(0)
摘要:1、附加目标进程, 2、CREATE_PROCESS_DEBUG_EVENT附加事件中将目标api处设置为0xcc(INT 3断点) 3、EXCEPTION_DEBUG_EVENT异常事件中,首先判断是否为EXCEPTION_BREAKPOINT 断点异常,然后GetThreadContext、Se 阅读全文
posted @ 2020-08-11 22:26 DirWangK 阅读(356) 评论(0) 推荐(0)
摘要:利用CreateRemoteThread 进程注入流程: OpenProcess This function returns a handle to an existing process object. HANDLE OpenProcess( DWORD fdwAccess, BOOL fInhe 阅读全文
posted @ 2020-08-11 17:10 DirWangK 阅读(618) 评论(0) 推荐(0)
摘要:利用CreateRemoteThread #include <iostream> #include <tchar.h> #include <Windows.h> #include <tlhelp32.h> BOOL SetPrivilege(LPCTSTR lpszPrivilege, BOOL b 阅读全文
posted @ 2020-08-10 21:28 DirWangK 阅读(383) 评论(0) 推荐(0)
摘要:DLL注入——使用SetWindowsHookEx函数实现消息钩取 MSDN: SetWindowsHookEx Function The SetWindowsHookEx function installs an application-defined hook procedure into a 阅读全文
posted @ 2020-08-09 20:49 DirWangK 阅读(397) 评论(0) 推荐(0)
摘要:CreateProcess(TEXT("C:\\Program Files(x86)\\Internet Explorer\\iexplore.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &proinfo); 得到一个无效的p 阅读全文
posted @ 2020-03-01 17:24 DirWangK 阅读(90) 评论(0) 推荐(0)
摘要:vs2017下自动创建的窗口程序 // win_test.cpp : 定义应用程序的入口点。 // #include "framework.h" #include "win_test.h" #define MAX_LOADSTRING 100 // 全局变量: HINSTANCE hInst; // 阅读全文
posted @ 2020-02-08 19:19 DirWangK 阅读(285) 评论(0) 推荐(0)