<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" 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><atom:link href="https://matasanochargen.disqus.com/hand_detouring_windows_function_calls_with_ht/latest.rss" rel="self"></atom:link><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>&lt;p&gt;Pretty informative post i like your explanation very much with diagram.&lt;/p&gt;&lt;p&gt;Thanks for the good post.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">real estate mountain lake</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>&lt;p&gt;Thanks for this post, it was really helpful&lt;/p&gt;</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>&lt;p&gt;Great post, really help me alot. Thanks.&lt;/p&gt;&lt;p&gt;Cheers,&lt;br&gt;&lt;a href="http://sain-web.com" rel="nofollow noopener" target="_blank" title="http://sain-web.com"&gt;Buat Duit Dengan Blog&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Traveller</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>&lt;p&gt;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;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;020D28E0       00                                               .&lt;/p&gt;&lt;p&gt;select disassembler window &lt;br&gt;and start typing jmp egg (assembler starts on typing or press spacebar to bring it up)&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;original&lt;br&gt;020C1028  |.  FF1485 41A10C02        CALL    NEAR DWORD PTR DS:[EAX*4+20CA141&amp;gt;&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;after this do ctrl+g in disassembler window&lt;br&gt;and type egg&lt;/p&gt;&lt;p&gt;020D28E0       0000                     ADD     BYTE PTR DS:[EAX], AL&lt;br&gt;020D28E2                    0000                     ADD     BYTE PTR DS:[EAX], AL&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;and there you go all set&lt;/p&gt;&lt;p&gt;btw doesnt rdata section needs to be set exec charecteristics ? if you are executing code ?&lt;/p&gt;&lt;p&gt;nice plugin there this uhooker should be interesting to try and play with it thanks ivan for posting a link to it&lt;/p&gt;</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>&lt;p&gt;This is cool stuff, Ivan.&lt;/p&gt;&lt;p&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.&lt;/p&gt;</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>&lt;p&gt;That was then..the current version of Uhooker can hook on any address besides function calls&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;&lt;a href="http://oss.coresecurity.com/uhooker/doc/index.html" rel="nofollow noopener" target="_blank" title="http://oss.coresecurity.com/uhooker/doc/index.html"&gt;http://oss.coresecurity.com...&lt;/a&gt;&lt;/p&gt;&lt;p&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 noopener" target="_blank" title="http://www.determina.com/security.research/patches/webview-setslice/DETCVE-2006-3730.zip"&gt;http://www.determina.com/se...&lt;/a&gt;&lt;/p&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>&lt;p&gt;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;/p&gt;&lt;p&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.&lt;/p&gt;</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>&lt;p&gt;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;/p&gt;&lt;p&gt;&lt;a href="http://oss.coresecurity.com/projects/uhooker.htm" rel="nofollow noopener" target="_blank" title="http://oss.coresecurity.com/projects/uhooker.htm"&gt;http://oss.coresecurity.com...&lt;/a&gt;&lt;/p&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>&lt;p&gt;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;/p&gt;&lt;p&gt;Although I also think objdump is highly underrated. =)&lt;/p&gt;</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>&lt;p&gt;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;/p&gt;&lt;p&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;/p&gt;&lt;p&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 noopener" target="_blank" title="http://www.codebreakers-journal.com/index.php/CodeBreakersJournal/issue/current"&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 noopener" target="_blank" title="http://www.ntcore.com/exsuite.php"&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.&lt;/p&gt;</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>&lt;p&gt;A pretty easy way to handle this is to add a value named "Debugger" to key&lt;/p&gt;&lt;p&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\NameOfService.exe&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;cheers&lt;/p&gt;</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>