|
[讨论]来个简单题目,看哪位兄弟写的最好!
Try compile the following code under VS2005, with /W4 warning level,for x86 逆序输出16进制和10进制数,不能使用循环和If,无非是更麻烦一些而已: // reverse 0x89ABCDEF to 0xFEDCBA98 VOID SwapIt( LPBYTE b1, LPBYTE b2 ) { BYTE b = *b1; *b1 = (*b2)<<4 + (*b2)>>4; *b2 = b<<4 + b>>4; } HRESULT ReverseInt_Hex( LPDWORD pInt, LPDWORD pdwResult ) { DWORD i = 0; LPBYTE p = NULL; /* if( NULL == pInt ) well, since we CANNOT use if, assume the parameter is valid here return E_INVALIDARG; */ i = *pInt; p = (LPBYTE) &i; SwapIt( p[0], p[3] ); SwapIt( p[1], p[2] ); *pdwResult = i; return S_OK; } // since 0xFFFFffff = 4294967295, there are 10 digits at most for a decimal unsigned integer // e.g. reverse 12345678 to 87654321 HRESULT ReverseInt_Decimal( LPDWORD pInt, LPDWORD pdwResult ) { DWORD i = 0; DWORD j = 0; BYTE k[10] = {0}; // stores the digits, from left to right /* if( NULL == pInt ) again, we trust you, man :-) return E_INVALIDARG; */ i = *pInt; k[0] = i / 1000000000; j = i - k[0] * 1000000000; k[1] = j / 100000000; j-= k[1] * 100000000; k[2] = j / 10000000; j-= k[2] * 10000000; k[3] = j / 1000000; j-= k[3] * 1000000; k[4] = j / 100000; j-= k[4] * 100000; k[5] = j / 10000; j-= k[5] * 10000; k[6] = j / 1000; j-= k[6] * 1000; k[7] = j / 100; j-= k[7] * 100; k[8] = j / 10; j-= k[8] * 10; k[9] = j; *pdwResult = k[9] * 1000000000 + k[8] * 100000000 + k[7] * 10000000 + k[6] * 1000000 + k[5] * 100000 + k[4] * 10000 + k[3] * 1000 + k[2] * 100 + k[1] * 10 + k[0]; return S_OK; } |
|
如何在VISTA系统中编程取得管理员的权限
You will find tons of such examples on rootkit.com, many of them come with source code. Please search on google first. |
|
如何在VISTA系统中编程取得管理员的权限
No way. Have you tried hackerDefender's way? I mean write a small driver to promote your app's privilege. |
|
|
|
[求助]CRC32的逆向算法怎么用VB来实现呢?
几年前就作过,CRC16/32可逆的前提是你要知道它的种子值,一般是-1(16位-0xFFFF,32位-0xFFFFffff)或0,其实也可以是任何其他值,只不过很多人不知道而已。 CRC16的逆向需要改2字节,CRC32则要4字节。一般的习惯是正向计算到最后2或4字节的时候,再调用逆向算法把改动的值填入buffer,这样计算出来的CRC16/CRC32就可以是你期望的了。 伪造的2或4字节的位置其实是可以放在buffer内的任意位置的,当然算法要更复杂。 把下面的一些文章看懂,你就不会在乎是用VB还是别的什么语言来实现了,而且印象深刻。 A Painless Guide to CRC Error Detection Algorithms www.ross.net/crc/crcpaper.html www.microconsultants.com/tips/crc/crc.txt www.geocities.com/SiliconValley/Pines/8659/crc.htm Find code for CRC-16 CCITT here: http://home.t-online.de/home/uwe.mnich/Wissen/Delphi/Utilities/Utilities.html CRC and How to Reverse it www.yates2k.net/anarchriz_crc.htm www.woodmann.com/fravia/crctut1.htm http://www.efg2.com/Lab/Mathematics/CRC.htm |
|
[转帖]XP VS 2K System Services.
这个帖子应该是精华帖。 |
|
如何从进程句柄(HANDLE)获取主模块的HMODULE?
NTDLL!ZwQueryProcessInformation() |
|
Windows Operating System Internals Curriculum Resource Kit (CRK)
http://www.academicresourcecenter.net/curriculum/pfv.aspx?ID=6191 something's wrong with the web |
|
哪位大侠帮忙!DEBUG API应用想让被调试程序单步执行,可调试时怎么实现不了呢
under VS2005: #define ARRAY_SIZE(__x) ( sizeof(__x) / sizeof(__x[0]) ) int wmain( __in int argc, __in_ecount(argc) WCHAR* argv[] ) { ... WCHAR wszCommand[MAX_PATH] = {0}; // construct commandline parameters StringCchCopyW( wszCommand, ARRAY_SIZE(wszCommand), argv[1] ); for( int i = 2; i < argc; i++ ) // any optional parameters? { StringCchPrintfW( wszCommand, MAX_PATH, L" %s", argv[i] ); } BOOL bDebug = CreateProcess( argv[1], wszCommand, // it's the program you wanna debug, not your debugger. Pass it as argv[1] with more parameters, if it's necessary 0, 0, TRUE, DEBUG_PROCESS, 0, 0, &startinfo, &pi ); if( TRUE != bDebug ) { // your error handling code } for(;;) { WaitForDebugEvent(...); .... } |
|
[求助]操作系统习题――有关WIN2000
13.B 14.A 15.B 13就不多说了。 14。线程就是为了并行性,在单CPU上实际上是没法并行的,只是让人感觉像是几个软件同时在运行。只有在多核的计算机上才可能实现真正的并行,这当然也需要操作系统的支持。 线程对可靠性反而是个挑战,软件处理不当很容易崩溃。一直到.NET 2都有线程处理上的bug,平时编程时比较头痛的就包括对多thread程序的调试,不管是在windows还是在Linux上。 很多人一上来就写multi-thread的程序,不管是不是真的需要。至少在单核的Windows机器上,多线程的程序引起的系统开销是很大的。你每创建一个thread,系统就得调用该process里面所有DLL的DllMain()一遍。系统每一次thread切换,该休息的thread的数据(kernel object,stack --- user mode and kernel mode)都得保存,由此引起的内存page fault和相应的disk I/O是很惊人的。还不提你得花在线程同步上的功夫和效果。所以要慎用。 15。如果是考试题,这个老师该打屁股。先来先服务是早期操作系统调度进程的常用办法,比如Windows 3.1;从95开始就是round robin的法子了。 1) 每个thread的quantum大概是20ms 2) quantum的原理可参考: http://download.microsoft.com/download/5/b/3/5b38800c-ba6e-4023-9078-6e9ce2383e65/C06X1116607.pdf 3) sleep(10)可以让系统保证你的thread最少睡上10ms 4) 在task manager里右键选择一个process,“set Affinity”可以让系统把你的thread绑定到某个CPU上去运行,对应的API是SetThreadAffinityMask()。 5)2000/XP/2003:thread的优先级(priority)一般有32级(0到31),在task manager里你可以设定你的thread的优先级为real time(31),但系统内部从来就是不理睬,当成15(普通)来看待。 |
|
有时间多看看这几个网站
想知道代码插入(detours)的原理?这里才是原发明人的文章: http://research.microsoft.com/~galenh/Publications/HuntUsenixNt99.pdf 还有这个很有名: http://forums.accessroot.com/ 玩儿Windows就不能不去微软: http://forums.microsoft.com/msdn/default.aspx?siteid=1 http://blogs.msdn.com/login.aspx?ReturnUrl= 不要去搞windows 9x/Me/2000了,真的是过时了。 |
|
[调查]这里的delphi程序员多吗?
“不用Delphi,因为目前还不能用它做底层,不像C能用于所有架构和平台,而且RAD也有其局限性,漂亮的GUI还是得靠C” 如果你去看看有名的rootkit HackerDefender的源代码就会知道,原来Delphi也可以写驱动。 “不用.net,那是微软的私有的东西,不能用于其他系统,.net方便它自己支持多硬件平台,当然,如果你愿意给微软打工,你可以得到些便利,.net是失败的COM的继承者” 笑话,如果你我也是盖痔,当然希望Windows大兴于天下;IBM的大老板同样是巴不得你我的计算机上都是他的东西,扶植Linux只是和微软争地盘,夺回失去的市场。你以为Linux比Windows更安全、更省钱吗? “.net是失败的COM的继承者” 请和我一样,举出实际的例子证明这一点,它是如何的失败。反正我是没有看到。微软把COM包装的更好了,你没必要再call AddRef()和Release(),如果你用过COM的话。 “Java,.net,c,汇编都只是语法,只要有合适的编译器,ring-0都行” 再请教一次,你如何用Java和.NET的玩意儿写ring-0的东西?请给出哪怕是一个“Hello World”的例子都成。 “指针仅仅是地址,至于引用,要看你指什么,引用计数,还是地址引用” http://www.open-std.org/jtc1/sc22/wg21/ “所谓的非标准语法很多只是暂时的,只要合理,那么将成为新标准,而随着时间变化,原先的标准可能会被废弃” “bookworm的具有独特的概括理解能力(看不到事物本质), Ivanov思想比较成熟” 你觉得独特恐怕是因为你我都是半桶水,“看不到事物本质”,在这里白费口水。Ivanov思想比较成熟是因为他一旦搞不明白就念翻译错了的英文诗,搞得大家更晕。 |
|
another nice paper on C/C++ function pointers
Man, how can I easily attach the file with the post? It just DOESN'T work! |
|
.........关于绕行HOOK ,跳过API拦截的讨论..........
很巧妙! 同样的文件,第二次载入内存时,肯定是需要rebase的。如果你查一查,第二次载入的kernel32.dll的基地址应该可以在它的relocation table里找到。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值