<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Matasano Chargen - Latest Comments in Hand-Detouring Windows Function Calls With HT</title><link>http://matasanochargen.disqus.com/</link><description></description><language>en</language><lastBuildDate>Fri, 10 Jul 2009 13:27:32 -0000</lastBuildDate><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-12460220</link><description>Pretty informative post i like your explanation very much with diagram.&lt;br&gt;&lt;br&gt;Thanks for the good post.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mikebason</dc:creator><pubDate>Fri, 10 Jul 2009 13:27:32 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-12321417</link><description>Thanks for this post, it was really helpful</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mp3danyul</dc:creator><pubDate>Wed, 08 Jul 2009 14:00:57 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-12244835</link><description>Great post, really help me alot. Thanks.&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;&lt;a href="http://sain-web.com" rel="nofollow"&gt;Buat Duit Dengan Blog&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Traveller_Adventure</dc:creator><pubDate>Tue, 07 Jul 2009 05:11:14 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321138</link><description>ht is pretty nice &lt;br&gt;but since you say you like ollydbg you can do all you enumerated from ollydbg itself no need for hte :)&lt;br&gt;&lt;br&gt;click in dump and hit ctrl+g and go to .rdata section&lt;br&gt;find the place of debug output as you mention hit : (colon) and label it egg&lt;br&gt;&lt;br&gt;020D28E0       00                                               .&lt;br&gt;&lt;br&gt;select disassembler window &lt;br&gt;and start typing jmp egg (assembler starts on typing or press spacebar to bring it up) &lt;br&gt;&lt;br&gt;if it is trashing some opcodes in excess of your required 5 bytes ollydbg will automatically fill with nops till the next valid sequnce of opcodes&lt;br&gt;&lt;br&gt;original&lt;br&gt;020C1028  |.  FF1485 41A10C02        CALL    NEAR DWORD PTR DS:[EAX*4+20CA141&amp;gt;&lt;br&gt;&lt;br&gt;modified&lt;br&gt;020C1028                    - E9 B3180100            JMP     &lt;br&gt;020C102D                      90                     NOP&lt;br&gt;020C102E                      90                     NOP&lt;br&gt;020C102F  |.  833D 51A10C02 01       CMP     DWORD PTR DS:[20CA151], 1&lt;br&gt;&lt;br&gt;&lt;br&gt;after this do ctrl+g in disassembler window&lt;br&gt;and type egg&lt;br&gt;&lt;br&gt;020D28E0       0000                     ADD     BYTE PTR DS:[EAX], AL&lt;br&gt;020D28E2                    0000                     ADD     BYTE PTR DS:[EAX], AL&lt;br&gt;&lt;br&gt;start adding the detour including the trashed instruction copy to executable (selection in rdata section as well as all modifications in code section)&lt;br&gt;&lt;br&gt;and there you go all set &lt;br&gt;&lt;br&gt;btw doesnt rdata section needs to be set exec charecteristics ? if you are executing code ?&lt;br&gt;&lt;br&gt;nice plugin there this uhooker should be interesting to try and play with it thanks ivan for posting a link to it</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymouse</dc:creator><pubDate>Sat, 02 Dec 2006 11:29:31 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321137</link><description>This is cool stuff, Ivan.&lt;br&gt;&lt;br&gt;I'm going to note what all the cool kids already know: it is impossible to do any kind of reversing/modifying work without realizing how easy binary third-party patching has become. The project I was writing about here was hairy: inter-module, inter-thread, through virtual functions; if I was just trying to block a pathological input to stop an attack, there'd be 20 more tricks we could pull out of our bag to do that.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Tue, 28 Nov 2006 23:42:39 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321136</link><description>That was then..the current version of Uhooker can hook on any address besides function calls&lt;br&gt;&lt;br&gt;There are 3 different types of hooks:&lt;br&gt;1. Hook Before Entering the function (type 'B')&lt;br&gt;2. Hook After the function returns (type 'A')&lt;br&gt;3. Hook when executing reaches this address (type '*')&lt;br&gt;&lt;br&gt;&lt;a href="http://oss.coresecurity.com/uhooker/doc/index.html" rel="nofollow"&gt;http://oss.coresecurity.com/uhooker/doc/index.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;Speaking about detours coolness... check out the third-party patch for MS06-057 from Determina&lt;br&gt;&lt;a href="http://www.determina.com/security.research/patches/webview-setslice/DETCVE-2006-3730.zip" rel="nofollow"&gt;http://www.determina.com/security.research/patc...&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ivan</dc:creator><pubDate>Tue, 28 Nov 2006 15:19:11 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321135</link><description>Back when I was trying to solve my binary netcat problem, Ivan and Hernan shot me a copy of this so I could pick data up directly from sockets. I like it!&lt;br&gt;&lt;br&gt;Unfortunately for me, in this case my problem is that I have a tangled mess of virtual function calls, so I don't have a specific target function to hook.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Tue, 28 Nov 2006 10:48:33 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321134</link><description>If you are already trapping to ollydbg (sounds like you are) you might find Hernan's uhooker useful to hook the function you want via python. It is an ollydbg plugin&lt;br&gt;&lt;br&gt;&lt;a href="http://oss.coresecurity.com/projects/uhooker.htm" rel="nofollow"&gt;http://oss.coresecurity.com/projects/uhooker.htm&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Max</dc:creator><pubDate>Tue, 28 Nov 2006 10:07:22 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321133</link><description>I know I'm overstating HT's features, but I think you might be understating them. By "80% of IDA", I mean "cross-referenced PE disassembly with symbols", which objdump can't do.&lt;br&gt;&lt;br&gt;Although I also think objdump is highly underrated. =)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Tue, 28 Nov 2006 08:25:15 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321132</link><description>HT is very nice, but it's not 80% of IDA Pro - it doesn't even support FLIRT, flow charts, et al -- let alone all the great plug-ins.  I'd like to see you put a Unix preprocessor into HT as easily.  Not to mention: PaiMei (including IDAPython and pGRAPH), Nintendo DS loader module (I just bought a DS Lite for Final Fantasy III and have a DS-Xtreme on the way), Determina PDB (and the general ease of downloading MS symbol tables and importing them), IDASync, IDACompare, idastruct, IDA RPC Enumerator, BinNavi, BinDiff, BinAudit, and HBGary Inspector.&lt;br&gt;&lt;br&gt;i know you are overstating HT's value, as it barely has any features over objdump.  it's nice to compare results between the 4 major toolsets (IDA Pro, OllyDbg, HT and gdb/binutils) just to make sure you are on the right track or miss something.  I tend to jump from one to the other especially when I'm confused which is probably a lot more often than you are.&lt;br&gt;&lt;br&gt;Btw - thanks for speaking about Detours.  I was just playing around with binary patching as talked about at &lt;a href="http://www.codebreakers-journal.com/index.php/CodeBreakersJournal/issue/current" rel="nofollow"&gt;Recon 2006&lt;/a&gt; in Luis Miras' talk on &lt;i&gt;Fixing Bugs in Binaries&lt;/i&gt;.  I downloaded &lt;a href="http://www.ntcore.com/exsuite.php" rel="nofollow"&gt;CFF Explorer V&lt;/a&gt;.  I normally roll VS2k5 to play with my wm5 device anyways, so a MS compiler is usually around.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dre</dc:creator><pubDate>Tue, 28 Nov 2006 00:57:54 -0000</pubDate></item><item><title>Re: Hand-Detouring Windows Function Calls With HT</title><link>http://www.matasano.com/log/620/hand-detouring-windows-function-calls-with-ht/#comment-2321131</link><description>A pretty easy way to handle this is to add a value named "Debugger" to key&lt;br&gt;&lt;br&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\NameOfService.exe&lt;br&gt;&lt;br&gt;And point it to an exe of your choice (potentially a debugger). CreateProcess() will then execute whatever you have in 'Debugger' when the SCM tries to start the service. It's a useful trick for mucking with service startup.&lt;br&gt;&lt;br&gt;cheers</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gustavo Duarte</dc:creator><pubDate>Tue, 28 Nov 2006 00:33:08 -0000</pubDate></item></channel></rss>