|
[作品提交]台球
好像没有做反锯齿,缺憾~ |
|
[讨论]VC++ 6.0 编译.假死问题
装英文版的,然后打上sp6补丁~~~~ |
|
[求助] 对操作系统来说端口的真正意思什么?
可以把所有可读写的设备或者虚拟的东西,都看成文件.端口就是某个主机上的某个文件. |
|
[原创]Kmd(kernel mode Driver)简单入门之谈!!
搞个系统底层研究和设计算了,最近论坛搞内核的很多啊... |
|
|
|
[原创]分析一个好玩的c语言程序
有几个原因: 1:const的原因. 各个编译器对他的实现可能会不同.或许,更本就不会为他们在栈上分配空间.那么pf可能就指到只读区了.想在那里执行代码,肯定会有错误.即使能执行了,机器指令也不一定是 mov eax,0x00400000 ret 总之很随机. 2:如果把const去掉,各个编译器之间还是会存在一些差异.尽管会分配同样代销的空间,但是两个变量之间的顺序却不一定是一样的.也就是说pf执行的时候可能的代码是: ret mov eax, 0x00400000 或者是正确的预料中的: mov eax,0x00400000 ret 所以,楼主一开始就说了:编译环境限制于vc6.0. |
|
|
|
[求助]xp下DDK的配置
用这个工具就可以了. |
|
[推荐] 那位高手帮忙分析以下这段代码。。
是不是可以将一些pe直接变形一下,然后直接用echo直接重定向到新的一个文件里. |
|
[原创]一道极难的C++模板题目
不知道楼主到底想实现什么功能. 不过有几个明显的错误: PBYTE pnew = new BYTE[sizeof(*m_p) + 10]; 如果想编译过,改成: PBYTE pnew = new BYTE[sizeof(m_p) + 10]; 模板展开以及这个sizeof是在编译期间.而用指针解引用却肯定要在运行期.这里肯定编不过.因为编译器不知道sizeof中的类型是什么. ::new( (void*)p ) *T;//这里编译出错。如何调用Class的构造函数? 同样的道理,你试图用指针指向的类型去构造,这也是错误的.要么这里改成T要么你做一个Wrapper重新传一个参数进来. 另外感觉你好像在自己实现new.分配类的内存,调用构造函数... |
|
|
|
|
|
|
|
[原创]分享一个小程序
最新更新一些新的图片背景. |
|
[原创]分享一个小程序
代码和执行文件已经更新. 效率提升. ps一个简单的全屏: void ShowFullScr(HWND hwnd, BOOL bFullScreen) { LONG style = ::GetWindowLong(hwnd, GWL_STYLE); if(bFullScreen) { style &= ~(WS_DLGFRAME | WS_THICKFRAME | WS_CAPTION | WS_BORDER); style &= ~WS_MAXIMIZEBOX; SetWindowLong(hwnd, GWL_STYLE, style); ShowWindow(hwnd, SW_MAXIMIZE); } else { style |= WS_DLGFRAME | WS_THICKFRAME | WS_CAPTION | WS_BORDER; style |= WS_MAXIMIZEBOX; SetWindowLong(hwnd, GWL_STYLE, style); ShowWindow(hwnd, SW_NORMAL); } } |
|
[讨论]关于编程版块的现状与发展前景的讨论
如果把成功作为定位的话,我想是不太合适的.尤其是语言这种东西. 但是在做的过程中,能有一定的进步.能够在小范围内适当的发挥出产品的作用就可以了. ps:编程语言还是有很多不同的. |
|
[求助]控制台程序窗口如何取消?
不知道楼主到底是什么需求? 1: 输出重定向? 解决方法: 你可以用CreateProcess来创建.其中参数里的STARTUPINFO结构里有一个HANDLE hStdOutput,这就是一个重定向输出的句柄.他可以是一个socket句柄或者文件句柄、管道句柄.你可以通过wShowWindow设置为SW_HIDE 同时把dwFlags设置为STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES, 然后为这个程序的输出重定向创建一个匿名管道,接着可以用PeekNamedPipe()来捕获管道输出的信息,从而实时输出在你的GUI程序中. 2:或者把标注输出重定向侄某个文件中. 这是ring3下偶做的一个DbgPrint. // dgb_prt.h #include <windows.h> #define _DEBUG_INFO_FILE "gfx_dbg_info.txt" // 修改这里的输出文件 VOID _cdecl __DPrt(const WCHAR *fmt, ...); VOID _cdecl __RPrt(const WCHAR *fmt, ...); VOID _cdecl __ADPrt(BOOL, const WCHAR *fmt, ...); VOID _cdecl __ARPrt(BOOL, const WCHAR *fmt, ...); #ifndef NDEBUG # define _DbgPrt __DPrt #else # define _DbgPrt __RPrt #endif #ifndef NDEBUG # define _AstPrt __ADPrt #else # define _AstPrt __ARPrt #endif // dbg_prt.cpp // ------------------------------------------------------------------------- #define _STDOUT_FP (1) #define _DEBUG_INFO_FILE "dbg_info.txt" // ------------------------------------------------------------------------- typedef struct __DbgPrtPara { FILE *pfp; int pfd; unsigned long pret; } _DbgPrtPara, *_PDbgPrtPara; _PDbgPrtPara __stdcall __DPrtInit() { _PDbgPrtPara pDbgPara = (_PDbgPrtPara)malloc(sizeof(_DbgPrtPara)); pDbgPara->pfd = _dup(_STDOUT_FP); pDbgPara->pfp = freopen(_DEBUG_INFO_FILE, "a+", stdout); unsigned short buff[128] = {'\0'}; _wstrtime(buff); wprintf(L"%s: ", buff); return pDbgPara; } void __stdcall __DPrtClose(_PDbgPrtPara pDbgPara) { fflush(pDbgPara->pfp); fclose(pDbgPara->pfp); _dup2(pDbgPara->pfd, _STDOUT_FP); free(pDbgPara); pDbgPara = NULL; } // ------------------------------------------------------------------------- __declspec(naked) void __DPrt(const unsigned short *fmt, ...) { #ifdef _M_IX86 __asm{ call __DPrtInit pop ebx mov dword ptr [eax + 8], ebx mov ebx, eax call dword ptr [wprintf] push ebx mov eax, dword ptr [ebx + 8] mov ebx, eax call __DPrtClose push ebx ret } #endif } // ------------------------------------------------------------------------- void __RPrt(const unsigned short *fmt, ...) { } // ------------------------------------------------------------------------- __declspec(naked) void __ADPrt(unsigned long, const unsigned short *fmt, ...) { #ifdef _M_IX86 __asm{ mov eax, dword ptr [esp + 4] cmp eax, 0 je EXE_TRUE ret EXE_TRUE: call __DPrtInit pop ebx mov dword ptr [eax + 8], ebx mov ebx, eax pop eax call dword ptr [wprintf] push ebx mov eax, dword ptr [ebx + 8] mov ebx, eax call __DPrtClose sub esp, 4 push ebx ret } #endif } // ------------------------------------------------------------------------- void _cdecl __ARPrt(unsigned long, const unsigned short *fmt, ...) { } // ------------------------------------------------------------------------- |
|
[求助]关于过瑞星和咔吧的HOOK!
貌似这个应该可行. |
|
[求助]请教一个关于编码习惯的问题
只对传入参数的约束做个检查,比如GDI+中的那些错误状态可以学习下. 对于其他的参数的具体成员或者其他细节,可以用assert()来表明前置信任! 比如一个公共函数,需要对其参数做类型检查, 但是具体的实现的私有的实现方法时可以用assert就可以了. 另外,有的时候,你必须写好提供给用户的文档. 明确表示哪些能做,哪些不能做的情况. 有些情况则可定义为未定义的.(前提是你的实现也是严格按照这个文档来做的) 因为一些情况下,为了性能考虑,可以把选择权利交个用户.比如c运行库的一些字符函数.溢出是属于未定义行为.他不保证运行结果. |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值