- 博客(38)
- 资源 (2)
- 收藏
- 关注
翻译 CRect
构造函数CRect( ) ; CRect( int l, int t, int r, int b ) ; CRect( const RECT& srcRect ) ; CRect( LPCRECT lpSrcRect ); CRect( POINT point, SIZE size ); CRect( POINT topLeft, POINT bottomRight
2016-07-13 13:55:29
809
原创 TCP
server服务器端初始化socket创建一个SOCKET类型的变量,它规定了该套接字是UDP或TCP或其他类型bind 给刚刚创建的socket赋值 (具体这个端口)listen(socket,5);一般这样写就可以了accept();收发数据;const short SEVEREPORT = 51000;int main(){ WSADATA wsData; W
2016-07-05 19:14:15
192
原创 静态成员变量和静态成员函数
静态成员变量在公司里的C++程序设计禁止使用全局变量和全局函数,而改用(静态)类成员变量 a)普通的成员变量,每定义一个类对象该成员变量都跟对象一起申请新的空间。 b)即在内存中只有一份空间,静态数据成员的生存期为整个程序运行期。 c)静态成员变量在类内只是一个声明(无空间),静态成员变量必须在类体外进行定义和初始化。 如:int Cxxxx:nStatic=0;//静态成员变量的初始化;
2016-06-16 21:12:11
313
原创 文件操作函数(C)
fopen_s//打开一个文件errno_t fopen_s( FILE** pFile, const char *filename, const char *mode );//成功返回0,失败返回错误代码 访问类型 fcloseint fclose( FILE *stream ); //关闭打开的文件流freadsize_t fread(
2016-06-13 13:11:25
263
原创 字符/字符串操作函数(C)
isdigitTests whether an element in a locale is a numeric character. 检查指定元素是否是数字 原型: template bool isdigit( CharType _Ch, const locale& _Loc //国家–语种 )示例:include include us
2016-06-12 13:20:41
326
原创 汇编指令:CLD STD MOVS LODS STOS
CLD与STDcld:清除CF位 std:设置CF位MOVSB、MOVSW、MOVSD把esi寻址的内存地址处的数据复制到edi寻址的内存地址处; b–byte/w–word/d–dword 代表了每次移动多少个字节 用法: cld ;清除CF .ESI的值+=size mov esi, 内存地址1 ;(也就是存放字符串的内存地址) mo
2016-06-10 12:41:23
1466
翻译 Window Functions--窗口函数
GetDesktopWindowThe GetDesktopWindow function returns a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which all icons and other win
2016-06-03 11:10:13
549
翻译 Handle and Object Functions--句柄和对象函数
CloseHandleThe CloseHandle function closes an open object handle.原型: BOOL CloseHandle( HANDLE hObject // handle to object to close );返回值 If the function succeeds, the return value is nonzero.成功
2016-06-01 11:25:06
301
转载 汇编指令
数据传输它们在存贮器和寄存器、寄存器和输入输出端口之间传送数据。1. 通用数据传送指令MOV 传送字或字节.MOVSX 先符号扩展,再传送.MOVZX 先零扩展,再传送.PUSH 把字压入堆栈.POP 把字弹出堆栈.PUSHA 把AX,CX,DX,BX,SP,BP,SI,DI依次压入堆栈.POPA 把DI,SI,BP,SP,BX,DX,CX,AX依次弹出堆栈.PUSHAD 把EAX,ECX,EDX,
2016-06-01 11:09:24
217
翻译 File Functions--文件函数
CreateFileThe CreateFile function creates or opens the following objects and returns a handle that can be used to access the object(并返回可以访问的句柄): files 文件pipes 管道mailslots 邮槽communications resour
2016-06-01 10:36:22
367
原创 不生成导入表调用API函数
DWORD myGetApiAddr(HMODULE hModuleBaseAddr, PSTR lpApi){ PIMAGE_DOS_HEADER pDosHeader = NULL; PIMAGE_NT_HEADERS pNtHeader = NULL; PIMAGE_EXPORT_DIRECTORY pExportDir = NULL; DWORD ret = 0
2016-05-31 10:53:15
383
原创 获得KERNEL32.DLL模块地址以及函数的地址
一、通过PEB获得DWORD getKernel32BaseAddrByPEB(){ PVOID pPeb = NULL; PVOID pLdr = NULL; PVOID pFlink = NULL; PVOID ptemp = NULL; PVOID BaseAddr = NULL; PVOID pFullName = NULL; __a
2016-05-29 23:33:55
2925
转载 通过PEB获取模块基址
PEB结构typedef struct _PEB { // Size: 0x1D8/*000*/ UCHAR InheritedAddressSpace;/*001*/ UCHAR ReadImageFileExecOptions;/*002*/ UCHAR BeingDebugged;/*003*/ UCHAR SpareBool; // Allocation size/*004*/ H
2016-05-29 16:28:06
4203
翻译 Dynamic-Link Library Functions--动态链接库函数
GetModuleHandleThe GetModuleHandle function returns a module handle for the specified module if the file has been mapped into the address space of the calling process. (如果文件被映射到进程中) 原型: HMODULE GetMo
2016-05-28 12:22:54
446
翻译 Memory Management Functions--内存管理函数
IsBadReadPtrThe IsBadReadPtr function verifies(证实) that the calling process has read access to the specified range of memory.( 调用程序访问的是指定范围的内存):也就是说检查该指针是否有访问权限 原型: BOOL IsBadReadPtr( CONST VOID *
2016-05-28 12:10:53
344
翻译 Process and Thread Functions--进程线程函数
TlsAllocThe TlsAlloc function allocates(分配) a thread local storage (TLS) index. 原型: DWORD TlsAlloc(VOID); DWORD index=TlsAlloc(VOID);TlsSetValueThe TlsSetValue function stores a value in the calling
2016-05-26 22:33:02
415
原创 PE--资源表
本来该用递归来写的,奈何总是写不出来,所以写了一个遍历3层结构的程序。以后来写递归的 VOID _GetResourceInfo1(PVOID pFileBuffer){ PIMAGE_DOS_HEADER pDosHeader = NULL; PIMAGE_NT_HEADERS pNtHeaders = NULL; PIMAGE_RESOURCE_DIRECTORY_
2016-05-24 01:01:35
526
原创 PE--重定位表
遍历重定位表////////////////重定位表/////////////////////////////////VOID _GetRelocInfo(PVOID pFileBuffer){ PIMAGE_DOS_HEADER pDosHeader = NULL; PIMAGE_NT_HEADERS pNtHeaders = NULL; PIMAGE_BASE_RELO
2016-05-22 14:45:18
428
原创 静态链接库和动态链接库编写
一 、静态链接库1.创建lib.cpp和lib.h文件和普通的控制台的程序一样的写法即可2.静态库的调用 a、把生成的.lib .h文件复制到调用文件中 b、包含这两个文件 #include”x.h” #pragma comment(lib,”xx.lib”) 之后就可以使用了lib.hint add(int x,int y);lib.cpp#include "lib.h"#inc
2016-05-20 12:41:03
271
原创 PE--导入表
遍历导入表信息/////////////////读取导入表信息///////////////////////VOID _GetImportInfo(PVOID pFileBuffer){ PIMAGE_DOS_HEADER pDosHeader = NULL; PIMAGE_NT_HEADERS pNtHeaders = NULL; PIMAGE_IMPORT_DESCR
2016-05-18 11:49:00
417
1
原创 PE解析一
读取文件到内存LPVOID EXEToFileBuffer(LPCWSTR pFileName){ HANDLE hd = NULL; HANDLE hFileMapping = NULL; DWORD dwSize = 0; LPVOID lpMemory = NULL; //打开文件 hd = CreateFile(pFileName, GEN
2016-05-17 20:34:45
276
原创 1-3章笔记
CPoint CString CTime CRect 类 CTime time; time=CTime::GetCurrentTime();MFC框架组成 1、必须含有一个CWinApp的派生类 2、必须在全局定义一个派生类的对象 3、CWinApp派生类内要有InitInstance函数重写消息映射机制 1、使用类向导建立一个窗口类的派生类 2、必须使用派生类来创建
2016-03-21 16:56:42
226
原创 switch 逆向分析
当switch的分支不多于3个的时候,和if ..else.类似00401038 mov eax,dword ptr [ebp+8]0040103B mov dword ptr [ebp-4],eax0040103E cmp dword ptr [ebp-4],000401042 je function+32h
2016-03-21 00:04:26
566
原创 列表控件相关函数
获取列表类CListCtrl pList=(CListCtrl )GetDlgItem(IDC_LIST);获取列表子列dwCount=pList->GetItemCount();插入列表子项pList->InsertItem(dwCount,cStr);为子项添加内容pList->SetItemText(dwCount,2,cStr);
2016-03-20 10:03:40
325
原创 虚函数与虚函数表
当类中有虚函数时,类的大小会多4个字节多出的这4个字节是一个地址,指向一张表,里面存储了所有虚函数的地址(虚函数表);class Base{public: virtual void Function_1() { printf("Base:Function_1...\n"); } virtual void Function_2() {
2016-03-18 00:07:01
223
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人