<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-14788166</id><updated>2008-07-02T23:42:22.760+02:00</updated><title type='text'>nzight</title><link rel='alternate' type='text/html' href='http://blog.dkbza.org/'/><link rel='next' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default?start-index=26&amp;max-results=25'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>104</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-14788166.post-8249239766746121069</id><published>2008-04-16T15:29:00.002+02:00</published><updated>2008-04-16T15:40:46.294+02:00</updated><title type='text'>Twitter in Dubai</title><content type='html'>This is how it looks...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/SAX_3ip-BmI/AAAAAAAAB2A/LbBY47JWjRA/s1600-h/twitter_dubai.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/SAX_3ip-BmI/AAAAAAAAB2A/LbBY47JWjRA/s400/twitter_dubai.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5189835475275089506" /&gt;&lt;/a&gt;&lt;br /&gt;Funnily enough, it seemed to be reachable through Dubai's airport wifi. Also the iPhone's Twinkle application can get to it, but I guess it's using some API and not accessing the main site.&lt;br /&gt;&lt;br /&gt;I think it's the first time I'm in a country blocking a site like Twitter... I'd have thought other sites such as Myspace would also be blocked but apparently aren't.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/04/twitter-in-dubai.html' title='Twitter in Dubai'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8249239766746121069' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8249239766746121069/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/8249239766746121069'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8249239766746121069'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5972187915732331201</id><published>2008-04-05T19:31:00.004+02:00</published><updated>2008-04-08T01:26:56.300+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Running around</title><content type='html'>It's been a few crazy weeks for me. A few weeks ago I finally moved back to the wonderful &lt;a href="http://en.wikipedia.org/wiki/Barcelona"&gt;Barcelona&lt;/a&gt; and trying to get settled in between trips to &lt;a href="http://www.sourceboston.com/"&gt;SOURCE Boston&lt;/a&gt;, &lt;a href="http://www.blackhat.com/html/bh-europe-08/train-bh-eu-08-index.html"&gt;BlackHat Amsterdam&lt;/a&gt; and now &lt;a href="http://www.rsaconference.com/2008/US/home.aspx"&gt;RSA in San Francisco&lt;/a&gt;... and next week is going to be &lt;a href="http://conference.hitb.org/hitbsecconf2008dubai/"&gt;HitB in Dubai&lt;/a&gt; where I'll be showing a new tool I've put together. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sourceboston.com/"&gt;SOURCE Boston&lt;/a&gt; was a really interesting event, impeccably organized and with really great speakers and atmosphere. The technical level of the talks I could see was great, but missed the first day of conference because of tight scheduling. The materials will be coming out &lt;a href="http://www.sourceboston.com/sessions/"&gt;here&lt;/a&gt;. It was the first installment and sure hope will be the first of many, as it was really fun and enjoyable.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://www.blackhat.com/html/bh-europe-08/train-bh-eu-08-index.html"&gt;BlackHat Amsterdam&lt;/a&gt; I was teaching the training with &lt;a href="http://pedram.openrce.org/blog/"&gt;Pedram Amini&lt;/a&gt;. We got some good feedback and the course should be seeing some good updates in &lt;a href="http://www.blackhat.com/html/bh-usa-08/train-bh-usa-08-index.html"&gt;Las Vegas&lt;/a&gt; later in the summer.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/04/running-around.html' title='Running around'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5972187915732331201' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5972187915732331201/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/5972187915732331201'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5972187915732331201'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6495079821893274399</id><published>2008-03-06T21:12:00.005+01:00</published><updated>2008-03-07T12:26:19.465+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='idapython'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Digging up system call ordinals</title><content type='html'>Today I was hacking a small tool and I needed a list of all the system call ordinals corresponding to the APIs exported by &lt;i&gt;NTDLL.DLL&lt;/i&gt;. A bit of googling didn't come up with anything too interesting so I wrote a small &lt;a href="http://code.google.com/p/idapython/"&gt;IDAPython&lt;/a&gt; script to harvest them out of a disassembly of &lt;i&gt;NTDLL.DLL&lt;/i&gt;.&lt;br /&gt;The script will simply iterate through every segment and every function and try to find the byte pattern corresponding to the prolog of API functions calling the stub doing the &lt;a href="http://www.nynaeve.net/?p=48"&gt;SYSENTER, SYSCALL or INT 2Eh&lt;/a&gt;.&lt;br /&gt;At least in Windows XP SP2 they will have the form: &lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td style="width: 30%;"&gt;MOV eax, XX&lt;/td&gt;&lt;td&gt;&lt;i&gt;where XX is the syscall ordinal&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MOV edx, 7FFE0300h&lt;/td&gt;&lt;td&gt;&lt;i&gt;the stub doing the transition to kernel mode, the actual code reached depends on the underlying processor&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CALL [edx]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;Those instructions correspond to the byte sequence 'B8 ? 00 00 00 BA 00 03 FE 7F'. I'll just tell &lt;a href="http://code.google.com/p/idapython/"&gt;IDAPython&lt;/a&gt; to look for it at the beginning of each function and, if found, I'll extract the value of the system call ordinal and the name of the function and print a list of them:      &lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;syscall_ordinal_code = 'b8 ? 00 00 00 ba 00 03 fe 7f'&lt;br /&gt;&lt;br /&gt;for seg in Segments():&lt;br /&gt;&amp;nbsp;&amp;nbsp;for func in Functions(seg, SegEnd(seg)):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;address = FindBinary(func, SEARCH_DOWN, syscall_ordinal_code)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if address == func:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print '%08x: Syscall ordinal %04x for %s (%s)' % (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func, Dword(func+1), Name(func), Comment(func))&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;And the outcome of running the script on &lt;a href="http://www.hex-rays.com/idapro/"&gt;IDA&lt;/a&gt; with &lt;i&gt;NTDLL.DLL&lt;/i&gt; looks like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid black;height:400px;overflow:auto;"&gt;7c90d379: Syscall ordinal 0000 for ZwAcceptConnectPort (NtAcceptConnectPort)&lt;br /&gt;7c90d38e: Syscall ordinal 0001 for ZwAccessCheck (NtAccessCheck)&lt;br /&gt;7c90d3a3: Syscall ordinal 0002 for ZwAccessCheckAndAuditAlarm (NtAccessCheckAndAuditAlarm)&lt;br /&gt;7c90d3b8: Syscall ordinal 0003 for ZwAccessCheckByType (NtAccessCheckByType)&lt;br /&gt;7c90d3cd: Syscall ordinal 0004 for ZwAccessCheckByTypeAndAuditAlarm (NtAccessCheckByTypeAndAuditAlarm)&lt;br /&gt;7c90d3e2: Syscall ordinal 0005 for ZwAccessCheckByTypeResultList (NtAccessCheckByTypeResultList)&lt;br /&gt;7c90d3f7: Syscall ordinal 0006 for ZwAccessCheckByTypeResultListAndAuditAlarm (NtAccessCheckByTypeResultListAndAuditAlarm)&lt;br /&gt;7c90d40c: Syscall ordinal 0007 for ZwAccessCheckByTypeResultListAndAuditAlarmByHandle (NtAccessCheckByTypeResultListAndAuditAlarmByHandle)&lt;br /&gt;7c90d421: Syscall ordinal 0008 for ZwAddAtom (NtAddAtom)&lt;br /&gt;7c90d436: Syscall ordinal 0009 for ZwAddBootEntry (NtAddBootEntry)&lt;br /&gt;7c90d44b: Syscall ordinal 000a for ZwAdjustGroupsToken (NtAdjustGroupsToken)&lt;br /&gt;7c90d460: Syscall ordinal 000b for ZwAdjustPrivilegesToken (NtAdjustPrivilegesToken)&lt;br /&gt;7c90d475: Syscall ordinal 000c for ZwAlertResumeThread (NtAlertResumeThread)&lt;br /&gt;7c90d48a: Syscall ordinal 000d for ZwAlertThread (NtAlertThread)&lt;br /&gt;7c90d49f: Syscall ordinal 000e for ZwAllocateLocallyUniqueId (NtAllocateLocallyUniqueId)&lt;br /&gt;7c90d4b4: Syscall ordinal 000f for ZwAllocateUserPhysicalPages (NtAllocateUserPhysicalPages)&lt;br /&gt;7c90d4c9: Syscall ordinal 0010 for ZwAllocateUuids (NtAllocateUuids)&lt;br /&gt;7c90d4de: Syscall ordinal 0011 for ZwAllocateVirtualMemory (NtAllocateVirtualMemory)&lt;br /&gt;7c90d4f3: Syscall ordinal 0012 for ZwAreMappedFilesTheSame (NtAreMappedFilesTheSame)&lt;br /&gt;7c90d508: Syscall ordinal 0013 for ZwAssignProcessToJobObject (NtAssignProcessToJobObject)&lt;br /&gt;7c90d51d: Syscall ordinal 0014 for ZwCallbackReturn (NtCallbackReturn)&lt;br /&gt;7c90d532: Syscall ordinal 0015 for ZwCancelDeviceWakeupRequest (NtCancelDeviceWakeupRequest)&lt;br /&gt;7c90d547: Syscall ordinal 0016 for ZwCancelIoFile (NtCancelIoFile)&lt;br /&gt;7c90d55c: Syscall ordinal 0017 for ZwCancelTimer (NtCancelTimer)&lt;br /&gt;7c90d571: Syscall ordinal 0018 for ZwClearEvent (NtClearEvent)&lt;br /&gt;7c90d586: Syscall ordinal 0019 for ZwClose (NtClose)&lt;br /&gt;7c90d59b: Syscall ordinal 001a for ZwCloseObjectAuditAlarm (NtCloseObjectAuditAlarm)&lt;br /&gt;7c90d5b0: Syscall ordinal 001b for ZwCompactKeys (NtCompactKeys)&lt;br /&gt;7c90d5c5: Syscall ordinal 001c for ZwCompareTokens (NtCompareTokens)&lt;br /&gt;7c90d5da: Syscall ordinal 001d for ZwCompleteConnectPort (NtCompleteConnectPort)&lt;br /&gt;7c90d5ef: Syscall ordinal 001e for ZwCompressKey (NtCompressKey)&lt;br /&gt;7c90d604: Syscall ordinal 001f for ZwConnectPort (NtConnectPort)&lt;br /&gt;7c90d619: Syscall ordinal 0020 for ZwContinue (NtContinue)&lt;br /&gt;7c90d62e: Syscall ordinal 0021 for ZwCreateDebugObject (NtCreateDebugObject)&lt;br /&gt;7c90d643: Syscall ordinal 0022 for ZwCreateDirectoryObject (NtCreateDirectoryObject)&lt;br /&gt;7c90d658: Syscall ordinal 0023 for ZwCreateEvent (NtCreateEvent)&lt;br /&gt;7c90d66d: Syscall ordinal 0024 for ZwCreateEventPair (NtCreateEventPair)&lt;br /&gt;7c90d682: Syscall ordinal 0025 for ZwCreateFile (NtCreateFile)&lt;br /&gt;7c90d697: Syscall ordinal 0026 for ZwCreateIoCompletion (NtCreateIoCompletion)&lt;br /&gt;7c90d6ac: Syscall ordinal 0027 for ZwCreateJobObject (NtCreateJobObject)&lt;br /&gt;7c90d6c1: Syscall ordinal 0028 for ZwCreateJobSet (NtCreateJobSet)&lt;br /&gt;7c90d6d6: Syscall ordinal 0029 for ZwCreateKey (NtCreateKey)&lt;br /&gt;7c90d6eb: Syscall ordinal 002a for ZwCreateMailslotFile (NtCreateMailslotFile)&lt;br /&gt;7c90d700: Syscall ordinal 002b for ZwCreateMutant (NtCreateMutant)&lt;br /&gt;7c90d715: Syscall ordinal 002c for ZwCreateNamedPipeFile (NtCreateNamedPipeFile)&lt;br /&gt;7c90d72a: Syscall ordinal 002d for ZwCreatePagingFile (NtCreatePagingFile)&lt;br /&gt;7c90d73f: Syscall ordinal 002e for ZwCreatePort (NtCreatePort)&lt;br /&gt;7c90d754: Syscall ordinal 002f for ZwCreateProcess (NtCreateProcess)&lt;br /&gt;7c90d769: Syscall ordinal 0030 for ZwCreateProcessEx (NtCreateProcessEx)&lt;br /&gt;7c90d77e: Syscall ordinal 0031 for ZwCreateProfile (NtCreateProfile)&lt;br /&gt;7c90d793: Syscall ordinal 0032 for ZwCreateSection (NtCreateSection)&lt;br /&gt;7c90d7a8: Syscall ordinal 0033 for ZwCreateSemaphore (NtCreateSemaphore)&lt;br /&gt;7c90d7bd: Syscall ordinal 0034 for ZwCreateSymbolicLinkObject (NtCreateSymbolicLinkObject)&lt;br /&gt;7c90d7d2: Syscall ordinal 0035 for ZwCreateThread (NtCreateThread)&lt;br /&gt;7c90d7e7: Syscall ordinal 0036 for ZwCreateTimer (NtCreateTimer)&lt;br /&gt;7c90d7fc: Syscall ordinal 0037 for ZwCreateToken (NtCreateToken)&lt;br /&gt;7c90d811: Syscall ordinal 0038 for ZwCreateWaitablePort (NtCreateWaitablePort)&lt;br /&gt;7c90d826: Syscall ordinal 0039 for ZwDebugActiveProcess (NtDebugActiveProcess)&lt;br /&gt;7c90d83b: Syscall ordinal 003a for ZwDebugContinue (NtDebugContinue)&lt;br /&gt;7c90d850: Syscall ordinal 003b for ZwDelayExecution (NtDelayExecution)&lt;br /&gt;7c90d865: Syscall ordinal 003c for ZwDeleteAtom (NtDeleteAtom)&lt;br /&gt;7c90d87a: Syscall ordinal 003d for ZwDeleteBootEntry (NtDeleteBootEntry)&lt;br /&gt;7c90d88f: Syscall ordinal 003e for ZwDeleteFile (NtDeleteFile)&lt;br /&gt;7c90d8a4: Syscall ordinal 003f for ZwDeleteKey (NtDeleteKey)&lt;br /&gt;7c90d8b9: Syscall ordinal 0040 for ZwDeleteObjectAuditAlarm (NtDeleteObjectAuditAlarm)&lt;br /&gt;7c90d8ce: Syscall ordinal 0041 for ZwDeleteValueKey (NtDeleteValueKey)&lt;br /&gt;7c90d8e3: Syscall ordinal 0042 for ZwDeviceIoControlFile (NtDeviceIoControlFile)&lt;br /&gt;7c90d8f8: Syscall ordinal 0043 for ZwDisplayString (NtDisplayString)&lt;br /&gt;7c90d90d: Syscall ordinal 0044 for ZwDuplicateObject (NtDuplicateObject)&lt;br /&gt;7c90d922: Syscall ordinal 0045 for ZwDuplicateToken (NtDuplicateToken)&lt;br /&gt;7c90d937: Syscall ordinal 0046 for ZwEnumerateBootEntries (NtEnumerateBootEntries)&lt;br /&gt;7c90d94c: Syscall ordinal 0047 for ZwEnumerateKey (NtEnumerateKey)&lt;br /&gt;7c90d961: Syscall ordinal 0048 for ZwEnumerateSystemEnvironmentValuesEx (NtEnumerateSystemEnvironmentValuesEx)&lt;br /&gt;7c90d976: Syscall ordinal 0049 for ZwEnumerateValueKey (NtEnumerateValueKey)&lt;br /&gt;7c90d98b: Syscall ordinal 004a for ZwExtendSection (NtExtendSection)&lt;br /&gt;7c90d9a0: Syscall ordinal 004b for ZwFilterToken (NtFilterToken)&lt;br /&gt;7c90d9b5: Syscall ordinal 004c for ZwFindAtom (NtFindAtom)&lt;br /&gt;7c90d9ca: Syscall ordinal 004d for ZwFlushBuffersFile (NtFlushBuffersFile)&lt;br /&gt;7c90d9df: Syscall ordinal 004e for ZwFlushInstructionCache (NtFlushInstructionCache)&lt;br /&gt;7c90d9f4: Syscall ordinal 004f for ZwFlushKey (NtFlushKey)&lt;br /&gt;7c90da09: Syscall ordinal 0050 for ZwFlushVirtualMemory (NtFlushVirtualMemory)&lt;br /&gt;7c90da1e: Syscall ordinal 0051 for ZwFlushWriteBuffer (NtFlushWriteBuffer)&lt;br /&gt;7c90da33: Syscall ordinal 0052 for ZwFreeUserPhysicalPages (NtFreeUserPhysicalPages)&lt;br /&gt;7c90da48: Syscall ordinal 0053 for ZwFreeVirtualMemory (NtFreeVirtualMemory)&lt;br /&gt;7c90da5d: Syscall ordinal 0054 for ZwFsControlFile (NtFsControlFile)&lt;br /&gt;7c90da72: Syscall ordinal 0055 for ZwGetContextThread (NtGetContextThread)&lt;br /&gt;7c90da87: Syscall ordinal 0056 for ZwGetDevicePowerState (NtGetDevicePowerState)&lt;br /&gt;7c90da9c: Syscall ordinal 0057 for ZwGetPlugPlayEvent (NtGetPlugPlayEvent)&lt;br /&gt;7c90dab1: Syscall ordinal 0058 for ZwGetWriteWatch (NtGetWriteWatch)&lt;br /&gt;7c90dac6: Syscall ordinal 0059 for ZwImpersonateAnonymousToken (NtImpersonateAnonymousToken)&lt;br /&gt;7c90dadb: Syscall ordinal 005a for ZwImpersonateClientOfPort (NtImpersonateClientOfPort)&lt;br /&gt;7c90daf0: Syscall ordinal 005b for ZwImpersonateThread (NtImpersonateThread)&lt;br /&gt;7c90db05: Syscall ordinal 005c for ZwInitializeRegistry (NtInitializeRegistry)&lt;br /&gt;7c90db1a: Syscall ordinal 005d for ZwInitiatePowerAction (NtInitiatePowerAction)&lt;br /&gt;7c90db2f: Syscall ordinal 005e for ZwIsProcessInJob (NtIsProcessInJob)&lt;br /&gt;7c90db44: Syscall ordinal 005f for ZwIsSystemResumeAutomatic (NtIsSystemResumeAutomatic)&lt;br /&gt;7c90db59: Syscall ordinal 0060 for ZwListenPort (NtListenPort)&lt;br /&gt;7c90db6e: Syscall ordinal 0061 for ZwLoadDriver (NtLoadDriver)&lt;br /&gt;7c90db83: Syscall ordinal 0062 for ZwLoadKey (NtLoadKey)&lt;br /&gt;7c90db98: Syscall ordinal 0063 for ZwLoadKey2 (NtLoadKey2)&lt;br /&gt;7c90dbad: Syscall ordinal 0064 for ZwLockFile (NtLockFile)&lt;br /&gt;7c90dbc2: Syscall ordinal 0065 for ZwLockProductActivationKeys (NtLockProductActivationKeys)&lt;br /&gt;7c90dbd7: Syscall ordinal 0066 for ZwLockRegistryKey (NtLockRegistryKey)&lt;br /&gt;7c90dbec: Syscall ordinal 0067 for ZwLockVirtualMemory (NtLockVirtualMemory)&lt;br /&gt;7c90dc01: Syscall ordinal 0068 for ZwMakePermanentObject (NtMakePermanentObject)&lt;br /&gt;7c90dc16: Syscall ordinal 0069 for ZwMakeTemporaryObject (NtMakeTemporaryObject)&lt;br /&gt;7c90dc2b: Syscall ordinal 006a for ZwMapUserPhysicalPages (NtMapUserPhysicalPages)&lt;br /&gt;7c90dc40: Syscall ordinal 006b for ZwMapUserPhysicalPagesScatter (NtMapUserPhysicalPagesScatter)&lt;br /&gt;7c90dc55: Syscall ordinal 006c for ZwMapViewOfSection (NtMapViewOfSection)&lt;br /&gt;7c90dc6a: Syscall ordinal 006d for ZwModifyBootEntry (NtModifyBootEntry)&lt;br /&gt;7c90dc7f: Syscall ordinal 006e for ZwNotifyChangeDirectoryFile (NtNotifyChangeDirectoryFile)&lt;br /&gt;7c90dc94: Syscall ordinal 006f for ZwNotifyChangeKey (NtNotifyChangeKey)&lt;br /&gt;7c90dca9: Syscall ordinal 0070 for ZwNotifyChangeMultipleKeys (NtNotifyChangeMultipleKeys)&lt;br /&gt;7c90dcbe: Syscall ordinal 0071 for ZwOpenDirectoryObject (NtOpenDirectoryObject)&lt;br /&gt;7c90dcd3: Syscall ordinal 0072 for ZwOpenEvent (NtOpenEvent)&lt;br /&gt;7c90dce8: Syscall ordinal 0073 for ZwOpenEventPair (NtOpenEventPair)&lt;br /&gt;7c90dcfd: Syscall ordinal 0074 for ZwOpenFile (NtOpenFile)&lt;br /&gt;7c90dd12: Syscall ordinal 0075 for ZwOpenIoCompletion (NtOpenIoCompletion)&lt;br /&gt;7c90dd27: Syscall ordinal 0076 for ZwOpenJobObject (NtOpenJobObject)&lt;br /&gt;7c90dd3c: Syscall ordinal 0077 for ZwOpenKey (NtOpenKey)&lt;br /&gt;7c90dd51: Syscall ordinal 0078 for ZwOpenMutant (NtOpenMutant)&lt;br /&gt;7c90dd66: Syscall ordinal 0079 for ZwOpenObjectAuditAlarm (NtOpenObjectAuditAlarm)&lt;br /&gt;7c90dd7b: Syscall ordinal 007a for ZwOpenProcess (NtOpenProcess)&lt;br /&gt;7c90dd90: Syscall ordinal 007b for ZwOpenProcessToken (NtOpenProcessToken)&lt;br /&gt;7c90dda5: Syscall ordinal 007c for ZwOpenProcessTokenEx (NtOpenProcessTokenEx)&lt;br /&gt;7c90ddba: Syscall ordinal 007d for ZwOpenSection (NtOpenSection)&lt;br /&gt;7c90ddcf: Syscall ordinal 007e for ZwOpenSemaphore (NtOpenSemaphore)&lt;br /&gt;7c90dde4: Syscall ordinal 007f for ZwOpenSymbolicLinkObject (NtOpenSymbolicLinkObject)&lt;br /&gt;7c90ddf9: Syscall ordinal 0080 for ZwOpenThread (NtOpenThread)&lt;br /&gt;7c90de0e: Syscall ordinal 0081 for ZwOpenThreadToken (NtOpenThreadToken)&lt;br /&gt;7c90de23: Syscall ordinal 0082 for ZwOpenThreadTokenEx (NtOpenThreadTokenEx)&lt;br /&gt;7c90de38: Syscall ordinal 0083 for ZwOpenTimer (NtOpenTimer)&lt;br /&gt;7c90de4d: Syscall ordinal 0084 for ZwPlugPlayControl (NtPlugPlayControl)&lt;br /&gt;7c90de62: Syscall ordinal 0085 for ZwPowerInformation (NtPowerInformation)&lt;br /&gt;7c90de77: Syscall ordinal 0086 for ZwPrivilegeCheck (NtPrivilegeCheck)&lt;br /&gt;7c90de8c: Syscall ordinal 0087 for ZwPrivilegeObjectAuditAlarm (NtPrivilegeObjectAuditAlarm)&lt;br /&gt;7c90dea1: Syscall ordinal 0088 for ZwPrivilegedServiceAuditAlarm (NtPrivilegedServiceAuditAlarm)&lt;br /&gt;7c90deb6: Syscall ordinal 0089 for ZwProtectVirtualMemory (NtProtectVirtualMemory)&lt;br /&gt;7c90decb: Syscall ordinal 008a for ZwPulseEvent (NtPulseEvent)&lt;br /&gt;7c90dee0: Syscall ordinal 008b for ZwQueryAttributesFile (NtQueryAttributesFile)&lt;br /&gt;7c90def5: Syscall ordinal 008c for ZwQueryBootEntryOrder (NtQueryBootEntryOrder)&lt;br /&gt;7c90df0a: Syscall ordinal 008d for ZwQueryBootOptions (NtQueryBootOptions)&lt;br /&gt;7c90df1f: Syscall ordinal 008e for ZwQueryDebugFilterState (NtQueryDebugFilterState)&lt;br /&gt;7c90df34: Syscall ordinal 008f for ZwQueryDefaultLocale (NtQueryDefaultLocale)&lt;br /&gt;7c90df49: Syscall ordinal 0090 for ZwQueryDefaultUILanguage (NtQueryDefaultUILanguage)&lt;br /&gt;7c90df5e: Syscall ordinal 0091 for ZwQueryDirectoryFile (NtQueryDirectoryFile)&lt;br /&gt;7c90df73: Syscall ordinal 0092 for ZwQueryDirectoryObject (NtQueryDirectoryObject)&lt;br /&gt;7c90df88: Syscall ordinal 0093 for ZwQueryEaFile (NtQueryEaFile)&lt;br /&gt;7c90df9d: Syscall ordinal 0094 for ZwQueryEvent (NtQueryEvent)&lt;br /&gt;7c90dfb2: Syscall ordinal 0095 for ZwQueryFullAttributesFile (NtQueryFullAttributesFile)&lt;br /&gt;7c90dfc7: Syscall ordinal 0096 for ZwQueryInformationAtom (NtQueryInformationAtom)&lt;br /&gt;7c90dfdc: Syscall ordinal 0097 for ZwQueryInformationFile (NtQueryInformationFile)&lt;br /&gt;7c90dff1: Syscall ordinal 0098 for ZwQueryInformationJobObject (NtQueryInformationJobObject)&lt;br /&gt;7c90e006: Syscall ordinal 0099 for ZwQueryInformationPort (NtQueryInformationPort)&lt;br /&gt;7c90e01b: Syscall ordinal 009a for ZwQueryInformationProcess (NtQueryInformationProcess)&lt;br /&gt;7c90e030: Syscall ordinal 009b for ZwQueryInformationThread (NtQueryInformationThread)&lt;br /&gt;7c90e045: Syscall ordinal 009c for ZwQueryInformationToken (NtQueryInformationToken)&lt;br /&gt;7c90e05a: Syscall ordinal 009d for ZwQueryInstallUILanguage (NtQueryInstallUILanguage)&lt;br /&gt;7c90e06f: Syscall ordinal 009e for ZwQueryIntervalProfile (NtQueryIntervalProfile)&lt;br /&gt;7c90e084: Syscall ordinal 009f for ZwQueryIoCompletion (NtQueryIoCompletion)&lt;br /&gt;7c90e099: Syscall ordinal 00a0 for ZwQueryKey (NtQueryKey)&lt;br /&gt;7c90e0ae: Syscall ordinal 00a1 for ZwQueryMultipleValueKey (NtQueryMultipleValueKey)&lt;br /&gt;7c90e0c3: Syscall ordinal 00a2 for ZwQueryMutant (NtQueryMutant)&lt;br /&gt;7c90e0d8: Syscall ordinal 00a3 for ZwQueryObject (NtQueryObject)&lt;br /&gt;7c90e0ed: Syscall ordinal 00a4 for ZwQueryOpenSubKeys (NtQueryOpenSubKeys)&lt;br /&gt;7c90e102: Syscall ordinal 00a5 for ZwQueryPerformanceCounter (NtQueryPerformanceCounter)&lt;br /&gt;7c90e117: Syscall ordinal 00a6 for ZwQueryQuotaInformationFile (NtQueryQuotaInformationFile)&lt;br /&gt;7c90e12c: Syscall ordinal 00a7 for ZwQuerySection (NtQuerySection)&lt;br /&gt;7c90e141: Syscall ordinal 00a8 for ZwQuerySecurityObject (NtQuerySecurityObject)&lt;br /&gt;7c90e156: Syscall ordinal 00a9 for ZwQuerySemaphore (NtQuerySemaphore)&lt;br /&gt;7c90e16b: Syscall ordinal 00aa for ZwQuerySymbolicLinkObject (NtQuerySymbolicLinkObject)&lt;br /&gt;7c90e180: Syscall ordinal 00ab for ZwQuerySystemEnvironmentValue (NtQuerySystemEnvironmentValue)&lt;br /&gt;7c90e195: Syscall ordinal 00ac for ZwQuerySystemEnvironmentValueEx (NtQuerySystemEnvironmentValueEx)&lt;br /&gt;7c90e1aa: Syscall ordinal 00ad for ZwQuerySystemInformation (NtQuerySystemInformation&lt;br /&gt;RtlGetNativeSystemInformation)&lt;br /&gt;7c90e1bf: Syscall ordinal 00ae for ZwQuerySystemTime (NtQuerySystemTime)&lt;br /&gt;7c90e1d4: Syscall ordinal 00af for ZwQueryTimer (NtQueryTimer)&lt;br /&gt;7c90e1e9: Syscall ordinal 00b0 for ZwQueryTimerResolution (NtQueryTimerResolution)&lt;br /&gt;7c90e1fe: Syscall ordinal 00b1 for ZwQueryValueKey (NtQueryValueKey)&lt;br /&gt;7c90e213: Syscall ordinal 00b2 for ZwQueryVirtualMemory (NtQueryVirtualMemory)&lt;br /&gt;7c90e228: Syscall ordinal 00b3 for ZwQueryVolumeInformationFile (NtQueryVolumeInformationFile)&lt;br /&gt;7c90e23d: Syscall ordinal 00b4 for ZwQueueApcThread (NtQueueApcThread)&lt;br /&gt;7c90e252: Syscall ordinal 00b5 for ZwRaiseException (NtRaiseException)&lt;br /&gt;7c90e267: Syscall ordinal 00b6 for ZwRaiseHardError (NtRaiseHardError)&lt;br /&gt;7c90e27c: Syscall ordinal 00b7 for ZwReadFile (NtReadFile)&lt;br /&gt;7c90e291: Syscall ordinal 00b8 for ZwReadFileScatter (NtReadFileScatter)&lt;br /&gt;7c90e2a6: Syscall ordinal 00b9 for ZwReadRequestData (NtReadRequestData)&lt;br /&gt;7c90e2bb: Syscall ordinal 00ba for ZwReadVirtualMemory (NtReadVirtualMemory)&lt;br /&gt;7c90e2d0: Syscall ordinal 00bb for ZwRegisterThreadTerminatePort (NtRegisterThreadTerminatePort)&lt;br /&gt;7c90e2e5: Syscall ordinal 00bc for ZwReleaseMutant (NtReleaseMutant)&lt;br /&gt;7c90e2fa: Syscall ordinal 00bd for ZwReleaseSemaphore (NtReleaseSemaphore)&lt;br /&gt;7c90e30f: Syscall ordinal 00be for ZwRemoveIoCompletion (NtRemoveIoCompletion)&lt;br /&gt;7c90e324: Syscall ordinal 00bf for ZwRemoveProcessDebug (NtRemoveProcessDebug)&lt;br /&gt;7c90e339: Syscall ordinal 00c0 for ZwRenameKey (NtRenameKey)&lt;br /&gt;7c90e34e: Syscall ordinal 00c1 for ZwReplaceKey (NtReplaceKey)&lt;br /&gt;7c90e363: Syscall ordinal 00c2 for ZwReplyPort (NtReplyPort)&lt;br /&gt;7c90e378: Syscall ordinal 00c3 for ZwReplyWaitReceivePort (NtReplyWaitReceivePort)&lt;br /&gt;7c90e38d: Syscall ordinal 00c4 for ZwReplyWaitReceivePortEx (NtReplyWaitReceivePortEx)&lt;br /&gt;7c90e3a2: Syscall ordinal 00c5 for ZwReplyWaitReplyPort (NtReplyWaitReplyPort)&lt;br /&gt;7c90e3b7: Syscall ordinal 00c6 for ZwRequestDeviceWakeup (NtRequestDeviceWakeup)&lt;br /&gt;7c90e3cc: Syscall ordinal 00c7 for ZwRequestPort (NtRequestPort)&lt;br /&gt;7c90e3e1: Syscall ordinal 00c8 for ZwRequestWaitReplyPort (NtRequestWaitReplyPort)&lt;br /&gt;7c90e3f6: Syscall ordinal 00c9 for ZwRequestWakeupLatency (NtRequestWakeupLatency)&lt;br /&gt;7c90e40b: Syscall ordinal 00ca for ZwResetEvent (NtResetEvent)&lt;br /&gt;7c90e420: Syscall ordinal 00cb for ZwResetWriteWatch (NtResetWriteWatch)&lt;br /&gt;7c90e435: Syscall ordinal 00cc for ZwRestoreKey (NtRestoreKey)&lt;br /&gt;7c90e44a: Syscall ordinal 00cd for ZwResumeProcess (NtResumeProcess)&lt;br /&gt;7c90e45f: Syscall ordinal 00ce for ZwResumeThread (NtResumeThread)&lt;br /&gt;7c90e474: Syscall ordinal 00cf for ZwSaveKey (NtSaveKey)&lt;br /&gt;7c90e489: Syscall ordinal 00d0 for ZwSaveKeyEx (NtSaveKeyEx)&lt;br /&gt;7c90e49e: Syscall ordinal 00d1 for ZwSaveMergedKeys (NtSaveMergedKeys)&lt;br /&gt;7c90e4b3: Syscall ordinal 00d2 for ZwSecureConnectPort (NtSecureConnectPort)&lt;br /&gt;7c90e4c8: Syscall ordinal 00d3 for ZwSetBootEntryOrder (NtSetBootEntryOrder)&lt;br /&gt;7c90e4dd: Syscall ordinal 00d4 for ZwSetBootOptions (NtSetBootOptions)&lt;br /&gt;7c90e4f2: Syscall ordinal 00d5 for ZwSetContextThread (NtSetContextThread)&lt;br /&gt;7c90e507: Syscall ordinal 00d6 for ZwSetDebugFilterState (NtSetDebugFilterState)&lt;br /&gt;7c90e51c: Syscall ordinal 00d7 for ZwSetDefaultHardErrorPort (NtSetDefaultHardErrorPort)&lt;br /&gt;7c90e531: Syscall ordinal 00d8 for ZwSetDefaultLocale (NtSetDefaultLocale)&lt;br /&gt;7c90e546: Syscall ordinal 00d9 for ZwSetDefaultUILanguage (NtSetDefaultUILanguage)&lt;br /&gt;7c90e55b: Syscall ordinal 00da for ZwSetEaFile (NtSetEaFile)&lt;br /&gt;7c90e570: Syscall ordinal 00db for ZwSetEvent (NtSetEvent)&lt;br /&gt;7c90e585: Syscall ordinal 00dc for ZwSetEventBoostPriority (NtSetEventBoostPriority)&lt;br /&gt;7c90e59a: Syscall ordinal 00dd for ZwSetHighEventPair (NtSetHighEventPair)&lt;br /&gt;7c90e5af: Syscall ordinal 00de for ZwSetHighWaitLowEventPair (NtSetHighWaitLowEventPair)&lt;br /&gt;7c90e5c4: Syscall ordinal 00df for ZwSetInformationDebugObject (NtSetInformationDebugObject)&lt;br /&gt;7c90e5d9: Syscall ordinal 00e0 for ZwSetInformationFile (NtSetInformationFile)&lt;br /&gt;7c90e5ee: Syscall ordinal 00e1 for ZwSetInformationJobObject (NtSetInformationJobObject)&lt;br /&gt;7c90e603: Syscall ordinal 00e2 for ZwSetInformationKey (NtSetInformationKey)&lt;br /&gt;7c90e618: Syscall ordinal 00e3 for ZwSetInformationObject (NtSetInformationObject)&lt;br /&gt;7c90e62d: Syscall ordinal 00e4 for ZwSetInformationProcess (NtSetInformationProcess)&lt;br /&gt;7c90e642: Syscall ordinal 00e5 for ZwSetInformationThread (NtSetInformationThread)&lt;br /&gt;7c90e657: Syscall ordinal 00e6 for ZwSetInformationToken (NtSetInformationToken)&lt;br /&gt;7c90e66c: Syscall ordinal 00e7 for ZwSetIntervalProfile (NtSetIntervalProfile)&lt;br /&gt;7c90e681: Syscall ordinal 00e8 for ZwSetIoCompletion (NtSetIoCompletion)&lt;br /&gt;7c90e696: Syscall ordinal 00e9 for ZwSetLdtEntries (NtSetLdtEntries)&lt;br /&gt;7c90e6ab: Syscall ordinal 00ea for ZwSetLowEventPair (NtSetLowEventPair)&lt;br /&gt;7c90e6c0: Syscall ordinal 00eb for ZwSetLowWaitHighEventPair (NtSetLowWaitHighEventPair)&lt;br /&gt;7c90e6d5: Syscall ordinal 00ec for ZwSetQuotaInformationFile (NtSetQuotaInformationFile)&lt;br /&gt;7c90e6ea: Syscall ordinal 00ed for ZwSetSecurityObject (NtSetSecurityObject)&lt;br /&gt;7c90e6ff: Syscall ordinal 00ee for ZwSetSystemEnvironmentValue (NtSetSystemEnvironmentValue)&lt;br /&gt;7c90e714: Syscall ordinal 00ef for ZwSetSystemEnvironmentValueEx (NtSetSystemEnvironmentValueEx)&lt;br /&gt;7c90e729: Syscall ordinal 00f0 for ZwSetSystemInformation (NtSetSystemInformation)&lt;br /&gt;7c90e73e: Syscall ordinal 00f1 for ZwSetSystemPowerState (NtSetSystemPowerState)&lt;br /&gt;7c90e753: Syscall ordinal 00f2 for ZwSetSystemTime (NtSetSystemTime)&lt;br /&gt;7c90e768: Syscall ordinal 00f3 for ZwSetThreadExecutionState (NtSetThreadExecutionState)&lt;br /&gt;7c90e77d: Syscall ordinal 00f4 for ZwSetTimer (NtSetTimer)&lt;br /&gt;7c90e792: Syscall ordinal 00f5 for ZwSetTimerResolution (NtSetTimerResolution)&lt;br /&gt;7c90e7a7: Syscall ordinal 00f6 for ZwSetUuidSeed (NtSetUuidSeed)&lt;br /&gt;7c90e7bc: Syscall ordinal 00f7 for ZwSetValueKey (NtSetValueKey)&lt;br /&gt;7c90e7d1: Syscall ordinal 00f8 for ZwSetVolumeInformationFile (NtSetVolumeInformationFile)&lt;br /&gt;7c90e7e6: Syscall ordinal 00f9 for ZwShutdownSystem (NtShutdownSystem)&lt;br /&gt;7c90e7fb: Syscall ordinal 00fa for ZwSignalAndWaitForSingleObject (NtSignalAndWaitForSingleObject)&lt;br /&gt;7c90e810: Syscall ordinal 00fb for ZwStartProfile (NtStartProfile)&lt;br /&gt;7c90e825: Syscall ordinal 00fc for ZwStopProfile (NtStopProfile)&lt;br /&gt;7c90e83a: Syscall ordinal 00fd for ZwSuspendProcess (NtSuspendProcess)&lt;br /&gt;7c90e84f: Syscall ordinal 00fe for ZwSuspendThread (NtSuspendThread)&lt;br /&gt;7c90e864: Syscall ordinal 00ff for ZwSystemDebugControl (NtSystemDebugControl)&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; As somebody pointed out in the comments, there's a &lt;a href="http://www.metasploit.com/users/opcode/syscalls.html"&gt;really good compilation of system call ordinals&lt;/a&gt; up at &lt;a href="http://www.metasploit.com/"&gt;Metasploit's site&lt;/a&gt;.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/03/digging-up-system-call-ordinals.html' title='Digging up system call ordinals'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6495079821893274399' title='4 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6495079821893274399/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/6495079821893274399'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6495079821893274399'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8185656039336979030</id><published>2008-03-04T03:37:00.004+01:00</published><updated>2008-03-04T06:41:22.920+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Recon 2008</title><content type='html'>So, it seems that after a year off &lt;a href="http://recon.cx/2008/index.html"&gt;Recon is coming back in 2008&lt;/a&gt;. I attended last time it was held and was one of the best conferences I've been to.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/03/recon-2008.html' title='Recon 2008'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8185656039336979030' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8185656039336979030/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/8185656039336979030'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8185656039336979030'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5481221518221944693</id><published>2008-03-02T22:03:00.003+01:00</published><updated>2008-03-02T22:14:30.830+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Old interviews with members of 29A</title><content type='html'>The guys at &lt;a href="http://www.hispasec.com/"&gt;Hispasec&lt;/a&gt; &lt;a href="http://blog.hispasec.com/laboratorio/273"&gt;managed to dig up some old interviews&lt;/a&gt; with members &lt;a href="http://blog.hispasec.com/laboratorio/images/noticias/griyo.pdf"&gt;GriYo&lt;/a&gt; and &lt;a href="http://blog.hispasec.com/laboratorio/images/noticias/mistersandman.pdf"&gt;MrSandman&lt;/a&gt; of the &lt;a href="http://www.29a.net/"&gt;legendary group 29A&lt;/a&gt; that recently announced was closing shop. Definitely worth a read if you can handle spanish.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/03/old-interviews-with-members-of-29a.html' title='Old interviews with members of 29A'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5481221518221944693' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5481221518221944693/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/5481221518221944693'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5481221518221944693'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2632248383162570762</id><published>2008-02-19T18:54:00.005+01:00</published><updated>2008-02-19T19:59:02.681+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>badass debugger + badass toy = geek pr0n</title><content type='html'>Today I finally got working a hacked-together minimal version of the iPhone debugger client for &lt;a href="http://www.zynamics.com/index.php?page=binnavi"&gt;BinNavi&lt;/a&gt;. It's heavily based on Patrick Walton's (with HD's updates) &lt;a href="http://blog.metasploit.com/2007/10/cracking-iphone-part-2.html"&gt;weasel debugger&lt;/a&gt;. Once tied to BinNavi debug client framework the whole client-server interaction is trivial.&lt;br /&gt;&lt;br /&gt;It feels just right, the best looking debugger together with the slickest device.. recipe for fun.. ;-)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/R7sbvUlJenI/AAAAAAAAB0E/_RjiluVY0M0/s1600-h/binnavi_does_iphone.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/R7sbvUlJenI/AAAAAAAAB0E/_RjiluVY0M0/s400/binnavi_does_iphone.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5168755497130097266" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Ppb6-5N0H80/R7sbwElJeoI/AAAAAAAAB0M/mlHvArrgbNY/s1600-h/iphone_binnavi.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_Ppb6-5N0H80/R7sbwElJeoI/AAAAAAAAB0M/mlHvArrgbNY/s400/iphone_binnavi.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5168755510014999170" /&gt;&lt;/a&gt;&lt;br /&gt;The test application is &lt;i&gt;telnet&lt;/i&gt; on the iPhone. On the iPhone's screen is the debug output from BinNavi's debug client. &lt;i&gt;telnet&lt;/i&gt; is launched from an ssh session in OSX, where &lt;a href="http://www.zynamics.com/index.php?page=binnavi"&gt;BinNavi&lt;/a&gt; is running.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/R7sbxUlJepI/AAAAAAAAB0U/tUPhqMPqTWQ/s1600-h/iphone_debug_client.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/R7sbxUlJepI/AAAAAAAAB0U/tUPhqMPqTWQ/s400/iphone_debug_client.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5168755531489835666" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For anybody trying to link Mach's debugging interface with a C++ iPhone application, remember the &lt;b&gt;extern "C"&lt;/b&gt; when defining &lt;b&gt;boolean_t exc_server(mach_msg_header_t *in, mach_msg_header_t *out);&lt;/b&gt; (which is not defined in the header files, as pointed in weasel's source code). Otherwise you'll get a nasty "Undefined symbols" message when linking.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;extern "C"&lt;/b&gt; is also needed for &lt;b&gt;catch_exception_raise(...)&lt;/b&gt; so &lt;b&gt;exc_server&lt;/b&gt; can call it to handle exceptions. Documented &lt;a href="http://cl-debian.alioth.debian.org/repository/pvaneynd/bzr-moved/sbcl/doc/internals-notes/mach-exception-handler-notes"&gt;here&lt;/a&gt;.&lt;br /&gt;(I've used the standard iPhone toolchain on Debian, this is running on the firmware 1.1.3)</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/02/badass-debugger-badass-toy-geek-pr0n.html' title='badass debugger + badass toy = geek pr0n'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2632248383162570762' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2632248383162570762/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/2632248383162570762'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2632248383162570762'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5691212332217023979</id><published>2008-02-14T23:53:00.002+01:00</published><updated>2008-02-15T00:01:34.348+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='pydot'/><title type='text'>pydot 1.0.2 ... that took long</title><content type='html'>Finally! it was long due. Here it is &lt;a href="http://code.google.com/p/pydot/"&gt;pydot 1.0.2&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Some weeks ago I started updating the code to support all the attributes and enhancements in GraphViz 2.16. In attempting to make it pass all the regression tests some severe shortcomings it had became apparent. &lt;br /&gt;pydot users had also provided with insight into how to improve performance by redesigning the way the data for the objects is stored internally. All in all, the limitations I was facing led me to rewrite the whole core of pydot, which took much longer than I wanted but I feel it was well worth it as it's orders of magnitude better than the last release 0.9. &lt;br /&gt;&lt;br /&gt;Performance-wise the new pydot stores graphs and their objects using a hierarchy of nested dictionaries and lists. Graph, Node, Edge objects are mere proxies to the data and are created on demand. So that now it's possible to have a graph with a 1 million edges and there will not be a single Edge instance (only if requested, then they will be created on demand, mapping the data and providing with all the methods to act on the data in the global dictionary). &lt;br /&gt;Storing a graph with 1 million edges in pydot 1.0 has approximately the same memory requirements (~813MiB) as dealing with one with only 40.000 edges in pydot 0.9 (~851MiB), the 40.000 edges graph needs ~35MiB in pydot 1.0 . Handling graphs should be much faster, as no linear searches are performed in &lt;a href="http://code.google.com/p/pydot/"&gt;pydot 1.0.2&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/02/pydot-102-that-took-long.html' title='pydot 1.0.2 ... that took long'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5691212332217023979' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5691212332217023979/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/5691212332217023979'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5691212332217023979'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5625894698439188386</id><published>2007-12-19T21:46:00.000+01:00</published><updated>2007-12-21T16:18:02.055+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>Exe_Dump_Utility, a web-enabled pefile</title><content type='html'>Gregory Piñero has put together &lt;a href="http://utilitymill.com/utility/Exe_Dump_Utility"&gt;Exe_Dump_Utility, a web-based version of pefile&lt;/a&gt;. Now it's possible to obtain the whole set of information processed by &lt;a href="http://code.google.com/p/pefile/"&gt;pefile&lt;/a&gt; online, without the need to install it. Neat!</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/12/exedumputility-web-enabled-pefile.html' title='Exe_Dump_Utility, a web-enabled pefile'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5625894698439188386' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5625894698439188386/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/5625894698439188386'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5625894698439188386'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5622375788078610635</id><published>2007-12-05T13:00:00.000+01:00</published><updated>2007-12-05T13:01:33.856+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='humor'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>xkcd: Python</title><content type='html'>&lt;a href="http://xkcd.com/353/"&gt;&lt;img style="display:block; width:400px; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://imgs.xkcd.com/comics/python.png" border="0" alt="Network" /&gt;&lt;/a&gt;&lt;br /&gt;So true</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/12/xkcd-python.html' title='xkcd: Python'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5622375788078610635' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5622375788078610635/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/5622375788078610635'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5622375788078610635'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8386413663603370162</id><published>2007-11-30T00:03:00.000+01:00</published><updated>2007-11-30T01:33:11.635+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Take Two: Packers, Time and Google Groups</title><content type='html'>I just &lt;b&gt;had&lt;/b&gt; to do it... This morning I read about &lt;a href="http://timepedia.org/chronoscope/"&gt;chronoscope&lt;/a&gt; in a &lt;a href="http://google-code-updates.blogspot.com/2007/11/chronoscope-2-2-5-with-gwt-and-android.html"&gt;post in the Google Code Blog&lt;/a&gt; and I could not help myself from wanting to tinker with it.&lt;br /&gt;&lt;br /&gt;I wrote a &lt;a href="http://www.wolfram.com/products/mathematica/index.html"&gt;Mathematica&lt;/a&gt; function to export a time-series of the format (timestamp, value) into the &lt;a href="http://timepedia.org/chronoscope/docs/gwt/intro/"&gt;dataset format&lt;/a&gt; used by &lt;a href="http://timepedia.org/chronoscope/"&gt;chronoscope&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;Epoch[date_] := &lt;br /&gt;&amp;nbsp;&amp;nbsp;ToString[AbsoluteTime[DateList[ToString[date]]] -&lt;br /&gt;&amp;nbsp;&amp;nbsp;AbsoluteTime[DateList["1970"]]];&lt;br /&gt;&lt;br /&gt;ChronoscopeJsExport = Function[ {datasetName, id, label, axis, data},&lt;br /&gt;&amp;nbsp;&amp;nbsp;jsData = datasetName &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;" = {\nId: \"" &lt;&gt; ToString[id] &lt;&gt; "\", \n" &lt;&gt; "domain: [" &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;StringJoin[ Riffle[ Map[ Epoch, data[[All, 1]] ], ", "] ] &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;"], \n" &lt;&gt; "range: [" &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;StringJoin[&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Riffle[ Map[ ToString, data[[All, 2]] ], ", "] ] &lt;&gt; "], \n" &lt;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;"label: \"" &lt;&gt; ToString[label] &lt;&gt; "\", \n" &lt;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;"axis: \"" &lt;&gt; ToString[axis] &lt;&gt; "\"\n};";&lt;br /&gt;&amp;nbsp;&amp;nbsp;jsData&lt;br /&gt;];&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And ran it through the &lt;a href="http://blog.dkbza.org/2007/11/packers-time-and-google-groups.html"&gt;packer time-series I harvested from Google Groups&lt;/a&gt;. Then I picked some widget demo code  and put it all together in a mash-up. The results of the quick hack are here... much nicer to visualize than in the previous post. (and it's interactive!)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Use the mouse-wheel to zoom&lt;/li&gt;&lt;li&gt;Drag the plot left/right to browse around different date ranges&lt;/li&gt;&lt;li&gt;You can pick any packer and the data will be plotted against the previously selected one&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;object type="text/html" width="475" height="700" data="http://dkbza.org/misc/chronoscope_packer_data.html"&gt;&lt;br /&gt;&lt;/object&gt;</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/take-two-packers-time-and-google-groups.html' title='Take Two: Packers, Time and Google Groups'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8386413663603370162' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8386413663603370162/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/8386413663603370162'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8386413663603370162'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4336215011112694114</id><published>2007-11-28T09:52:00.000+01:00</published><updated>2007-11-28T10:03:05.198+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='humor'/><title type='text'>xkcd: Network</title><content type='html'>&lt;a href="http://xkcd.com/350/"&gt;&lt;img style="display:block; width:400px; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://imgs.xkcd.com/comics/network.png" border="0" alt="Network" /&gt;&lt;/a&gt;&lt;br /&gt;Simply brilliant.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/xkcd-network.html' title='xkcd: Network'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4336215011112694114' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4336215011112694114/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/4336215011112694114'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4336215011112694114'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2188082067533501487</id><published>2007-11-25T23:56:00.000+01:00</published><updated>2007-11-26T13:07:35.043+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2.8</title><content type='html'>And yet another one. &lt;a href="http://code.google.com/p/pefile/"&gt;pefile 1.2.8&lt;/a&gt; comes with the usual few bugfixes and a slew of enhancements. Some of them are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;One can now "relocate" the image by invoking &lt;i&gt;relocate_image(ImageBase)&lt;/i&gt; with a new ImageBase the PE file's relocations will be applied to produce the relocated image.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Section entropy is computed faster (thanks to &lt;a href="http://d-dome.net/"&gt;Gergely&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MD5, SHA-1, SHA-256, SHA-512 hashes are calculated on a per-section basis (thanks Jim Clausing for the suggestion)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Improved (rather fixed) handling of Unicode strings when parsing the resources information&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For more details and downloads head to &lt;a href="http://code.google.com/p/pefile/"&gt;pefile's project page&lt;/a&gt;.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/pefile-128.html' title='pefile 1.2.8'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2188082067533501487' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2188082067533501487/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/2188082067533501487'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2188082067533501487'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1840008397153329270</id><published>2007-11-25T17:10:00.000+01:00</published><updated>2007-11-25T22:06:21.375+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><title type='text'>Right, Left, Right, Right, Left... and the Dancing Girl</title><content type='html'>Lately &lt;a href="http://www.news.com.au/perthnow/story/0,21598,22492511-5005375,00.html"&gt;a animation&lt;/a&gt; of a woman has been going around. The animation shows a rotating silhouette, the catch is that it can be perceived to be rotating clockwise or counter-clockwise. It tends to be a bit hard to change the perception of the direction of rotation once one particular direction has been recognized (at least in my personal case), I've read that for some people it switches direction more or less randomly, after looking at it for a while.&lt;br /&gt;I was curious as to why it works, whether I could reproduce the trick and if I could make myself see her rotating in one direction or the other at will.&lt;br /&gt;&lt;br /&gt;The why it works is relatively straightforward. Whether the rotation is clockwise or counter-clockwise is impossible to say if it happens in the same plane as where the viewer's viewpoint lays and there's no feeling of depth. The brain needs the perspective in order to tell the direction for sure, perspective will make the objects that are father look smaller and the ones closer bigger, that will help the brain discriminate one direction over the other. The dancing woman has been created in such way that it appears to have some perspective, yet it's still ambiguous (and you can see things jumping strangely at rotation as a result of this composition, just pay attention at the magical stretch of the arm closer to the body when it passes in front/behind)&lt;br /&gt;&lt;br /&gt;It's easy to reproduce, just look at this example I quickly put together. With perspective it can be easily said whether it rotates in one direction or the other. We can either display it by setting the viewpoint above or directly in front with with a large aperture angle that exaggerates the perspective.&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/wgW2Xnc7Uq4&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/wgW2Xnc7Uq4&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/uXDwCOsbSpA&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/uXDwCOsbSpA&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Then, if we now we set the viewpoint in front, yet so far that the projection lines become nearly parallel so that we lose the sense of perspective. It becomes much harder to tell the direction of motion and it's even possible to see it going both directions.&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/983tpOT10xY&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/983tpOT10xY&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Then regarding the choosing at will of one direction over the other... I figured out that given that the only thing preventing my brain from deciding is the ambiguity caused by lack of information that would bias some layer of my neural networks to decide clockwise/counter-clockwise... I went really high tech and starting moving my finger in front of the dancing woman in the direction I wanted to see her to rotate... that seems to solve the ambiguity and I can make her turn one way or another at will...&lt;br /&gt;&lt;br /&gt;I wonder if the trick works for other people too.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/right-left-right-right-left-and-dancing.html' title='Right, Left, Right, Right, Left... and the Dancing Girl'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1840008397153329270' title='6 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1840008397153329270/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/1840008397153329270'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1840008397153329270'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3471989003892184177</id><published>2007-11-21T22:44:00.000+01:00</published><updated>2007-11-22T12:32:17.687+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Packers, Time and Google Groups</title><content type='html'>The other day I was talking with a friend and the discussion went into when certain anti-disassembly, anti-debug, etc. techniques might have appeared. That's bound to be difficult because tricks are usually simultaneously discovered by different people.&lt;br /&gt;&lt;br /&gt;So I though, a trick will usually be regarded as "common" once it gets implemented in some packer, as those try to make analysis difficult and will attempt to embedded whichever tricks are good/popular within the underground at the time in order to make the reverse engineering process as cumbersome as possible. Therefore if I could somehow place packers in time I'd have a starting point...&lt;br /&gt;&lt;br /&gt;That led me to remember about Google Groups. It's possible to make queries restricted to date ranges and the archives go back to 1981. I quickly put together a script to scan with a one-month window through 1981 to 2007 for a set of popular packers.&lt;br /&gt;&lt;br /&gt;The most painful part of the whole process was to fool Google... they sure do not like robots... whenever they get a bunch of very simply automated queries they'll server back a "403 Forbidden" telling queries look like coming from a virus or spyware app...&lt;br /&gt;But my script is good, it's no evil spyware... so I got into the mood of working my way around the checks. I needed to do quite some queries (&gt; 10K) so I better make it believe I'm not a robot. Besides finding the right timing for the queries (too often will make Google sad) I had to distribute the search over a few hosts, randomize headers and User-Agents and the query itself (just throw in some randomized, "orthogonal" (nothing to do with your query) search terms). After that the script was good to go...&lt;br /&gt;&lt;br /&gt;So, after mining the news groups for popular packer names ( the search string was, most of the time, "&lt;packer name&gt; exe" plus the "randomized" terms ) I got a cute small data set to throw into Mathematica...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Ppb6-5N0H80/R0SqoAFLRdI/AAAAAAAABvQ/T-QIaa6Ar68/s1600-h/plot_1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_Ppb6-5N0H80/R0SqoAFLRdI/AAAAAAAABvQ/T-QIaa6Ar68/s400/plot_1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417079302407634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/R0SqogFLReI/AAAAAAAABvY/CMplWj0JS1o/s1600-h/plot_2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/R0SqogFLReI/AAAAAAAABvY/CMplWj0JS1o/s400/plot_2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417087892342242" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Ppb6-5N0H80/R0SqowFLRfI/AAAAAAAABvg/jhFp5kOEYIc/s1600-h/plot_3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_Ppb6-5N0H80/R0SqowFLRfI/AAAAAAAABvg/jhFp5kOEYIc/s400/plot_3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417092187309554" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Ppb6-5N0H80/R0SqpQFLRgI/AAAAAAAABvo/QfniIZ5fdYc/s1600-h/plot_4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_Ppb6-5N0H80/R0SqpQFLRgI/AAAAAAAABvo/QfniIZ5fdYc/s400/plot_4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417100777244162" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/R0SqpgFLRhI/AAAAAAAABvw/bSZ6pgczXaY/s1600-h/plot_5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/R0SqpgFLRhI/AAAAAAAABvw/bSZ6pgczXaY/s400/plot_5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417105072211474" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Ppb6-5N0H80/R0Sq5QFLRiI/AAAAAAAABv4/tB4dlcUMd4w/s1600-h/plot_6.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_Ppb6-5N0H80/R0Sq5QFLRiI/AAAAAAAABv4/tB4dlcUMd4w/s400/plot_6.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417375655151138" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/R0Sq5gFLRjI/AAAAAAAABwA/iyNv5U4VLsI/s1600-h/plot_7.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/R0Sq5gFLRjI/AAAAAAAABwA/iyNv5U4VLsI/s400/plot_7.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417379950118450" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Ppb6-5N0H80/R0Sq5wFLRkI/AAAAAAAABwI/STkfLYszBJA/s1600-h/plot_8.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_Ppb6-5N0H80/R0Sq5wFLRkI/AAAAAAAABwI/STkfLYszBJA/s400/plot_8.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417384245085762" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The results will have some inaccuracies, as it's possible some of the terms appeared in some news post not related to the packers. Yet I think they look plausible. When the volume of hits is high enough or constant over time it feels like it would indicate the approximate release date of the packer in question, or at least the first public discussion about it which, I would tend to think, will not necessarily be too far apart.&lt;br /&gt;If someone can either corroborate or refute the data I'll be glad to hear.&lt;br /&gt;&lt;br /&gt;I also did some test overlaying virus release times in order to try to spot correlations between big outbreaks and news-posts about packers, but I couldn't see anything particularly significant.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/packers-time-and-google-groups.html' title='Packers, Time and Google Groups'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3471989003892184177' title='6 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3471989003892184177/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/3471989003892184177'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3471989003892184177'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6152583006559881121</id><published>2007-10-12T13:47:00.000+02:00</published><updated>2007-10-12T13:47:38.871+02:00</updated><title type='text'>OpenRCE.org goodies</title><content type='html'>By popular demand I've added OpenRCE.org T-Shirts and other goodies to the &lt;a href="http://www.cafepress.com/dkbza"&gt;online store&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.cafepress.com/dkbza"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_Ppb6-5N0H80/Rw9eU67aR0I/AAAAAAAABIw/QnYRrnVLkt0/s400/cafepress.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5120415014852380482" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope you like them.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/10/openrceorg-goodies.html' title='OpenRCE.org goodies'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6152583006559881121' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6152583006559881121/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/6152583006559881121'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6152583006559881121'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-9118532346551516385</id><published>2007-10-12T10:21:00.000+02:00</published><updated>2007-10-12T10:40:42.108+02:00</updated><title type='text'>More iPhone hacking by HD Moore</title><content type='html'>He's &lt;a href="http://blog.metasploit.com/2007/10/cracking-iphone-part-1.html"&gt;wrote more on hacking&lt;/a&gt; the &lt;a href="http://www.apple.com/iphone/"&gt;iPhone&lt;/a&gt; on &lt;a href="http://blog.metasploit.com/"&gt;Metasplot's blog&lt;/a&gt;. Definitely worth a read. I'm dying to read part two.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/10/more-iphone-hacking-by-hd-moore.html' title='More iPhone hacking by HD Moore'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=9118532346551516385' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/9118532346551516385/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/9118532346551516385'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/9118532346551516385'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-9014034853036913573</id><published>2007-09-26T10:03:00.000+02:00</published><updated>2007-09-26T10:20:23.805+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Metasploit on the iPhone</title><content type='html'>A nice &lt;a href="http://blog.metasploit.com/2007/09/root-shell-in-my-pocket-and-maybe-yours.html"&gt;write-up on the iPhone&lt;/a&gt; has been posted in &lt;a href="http://blog.metasploit.com/"&gt;Metasploit&lt;/a&gt;'s blog.&lt;br /&gt;&lt;br /&gt;My favorite point...&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Every process runs as root. MobileSafari, MobileMail, even the Calculator, all run with full root privileges. Any security flaw in any iPhone application can lead to a complete system compromise. A rootkit takes on a whole new meaning when the attacker has access to the camera, microphone, contact list, and phone hardware. Couple this with "always-on" internet access over EDGE and you have a perfect spying device.&lt;/blockquote&gt;</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/metasploit-on-iphone.html' title='Metasploit on the iPhone'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=9014034853036913573' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/9014034853036913573/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/9014034853036913573'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/9014034853036913573'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3707515393038240137</id><published>2007-09-18T09:19:00.000+02:00</published><updated>2007-09-18T09:26:29.343+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Hex-Rays unleashed</title><content type='html'>&lt;a href="http://www.hex-rays.com/compare.shtml"&gt;Hex-Rays&lt;/a&gt;, &lt;a href="http://www.hexblog.com/"&gt;Ilfak Guilfanov&lt;/a&gt;'s decompiler, has been &lt;a href="http://www.prnewswire.com/cgi-bin/stories.pl?ACCT=104&amp;STORY=/www/story/09-17-2007/0004663594&amp;EDATE="&gt;unleashed&lt;/a&gt;. I have had the chance of playing a bit with the beta and it is really impressive, to say the least. This will save so many hours to reverse engineers...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Ppb6-5N0H80/Ru99Kvi09nI/AAAAAAAABIQ/60T-19WHeb4/s1600-h/ilfak_hex_rays.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ppb6-5N0H80/Ru99Kvi09nI/AAAAAAAABIQ/60T-19WHeb4/s400/ilfak_hex_rays.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5111441725603509874" /&gt;&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/hex-rays-unleashed.html' title='Hex-Rays unleashed'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3707515393038240137' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3707515393038240137/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/3707515393038240137'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3707515393038240137'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3569831047101234819</id><published>2007-09-17T12:58:00.000+02:00</published><updated>2007-09-17T13:12:36.831+02:00</updated><title type='text'>Un-bricking the Garmin GPSmap 60CS</title><content type='html'>A while ago I managed to brick my trustworthy &lt;a href="https://buy.garmin.com/shop/shop.do?pID=6447"&gt;GPSmap 60CS&lt;/a&gt; when I was trying to update its firmware (don't try doing it from within a virtual machine if you can avoid it, unless you have a feeling for adventure ;) ).&lt;br /&gt;It was bad enough that it would not even give any signs of life when trying to turn it on.&lt;br /&gt;&lt;br /&gt;So I called Garmin Europe to see how much would it cost to get it repaired... and it was steep enough that I &lt;i&gt;had&lt;/i&gt; to Google for a solution for a bit longer... and luckily enough I found a sneaky &lt;a href="http://www.malsingmaps.com/wiki/index.php/Garmin_GPSMAP_60CSx#2._60Cx_is_.22bricked.22._It_will_not_even_turn_on."&gt;way of reloading the firmware&lt;/a&gt; that actually worked!&lt;br /&gt;&lt;br /&gt;Now it's back alive!</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/un-bricking-garmin-60cs.html' title='Un-bricking the Garmin GPSmap 60CS'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3569831047101234819' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3569831047101234819/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/3569831047101234819'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3569831047101234819'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-225182886864546815</id><published>2007-09-09T23:40:00.000+02:00</published><updated>2007-09-11T14:03:31.632+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='code opimization'/><title type='text'>Reverse engineering a compiler-produced artifact</title><content type='html'>In our training, &lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram&lt;/a&gt; and I deal with some very simple compiler optimizations or artifacts. Although they represent the same semantics that the programmer defined in the original source code, those optimizations are sometimes cumbersome to convert back to a meaningful high-level representation.&lt;br /&gt;&lt;br /&gt;The other day I was just studying a piece of code and bumped into a relatively common pattern. The code I was looking at was supposed to represent a division of a function's argument by a constant. But in the disassembled code I was studying I could only see a multiplication. This can be slightly confusing unless one has seen a bit more assembly than what is healthy and remembers some of the compiler-produced fun that goes on...&lt;br /&gt;&lt;br /&gt;A couple of things to remember:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Compilers &lt;b&gt;love&lt;/b&gt; to work with multiples of 2. The processor can can just &lt;a href="http://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts"&gt;shift registers left and right&lt;/a&gt; (shifting is incredibly fast, that is moving the contents of a register left or right padding with o or 1 as appropriate). Shifting to the left for multiplication by 2 and towards the right for division by 2 (this is akin to having a number in base 10 and multiplying by 10 by adding zeros to the right and dividing by by removing the rightmost digit).&lt;/li&gt;&lt;li&gt;Compilers &lt;b&gt;hate&lt;/b&gt; to use the division instruction. The division takes a lot of steps, or cycles, for the CPU to complete. Hence they will avoid to use it at all cost.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The code looked like this:&lt;br /&gt;(&lt;i&gt;irrelevant interleaved code left out&lt;/i&gt;)&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="border: 2px outset gray; width: 100%; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;mov     ecx, [esp+4+arg_4]&lt;br /&gt;mov     eax, 66666667h&lt;br /&gt;imul    ecx&lt;br /&gt;sar     edx, 3&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In the snippet we can see function argument being multiplied by 0x66666667, and the result being stored as a 64 bit value in EDX:EAX (topmost 32 bits in EDX, the lower 32 in EAX)&lt;/li&gt;&lt;li&gt;Then the top 32 bits are shifted (&lt;a href="http://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift"&gt;"arithmetically"&lt;/a&gt;) to the right. That is, divided by 2 thrice, same as 2^3 = 8. Effectively dividing the value by 8.&lt;/li&gt;&lt;li&gt;But the division is applied only to the top 32 bits, ignoring the lower 32. That could be understood to also mean that, by taking the topmost 32 bits and ignoring the bottom ones, the result of the multiplication is implicitly being divided by 2^32. (That's only guessed by the subsequent usage of the value just obtained, there's never again a reference to the lower 32bits, so I assume that they are discarded)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;What do we have so far?&lt;br /&gt;&lt;br /&gt;[ (Value * 0x66666667) / 2^32 ] / 2^3 ]&lt;br /&gt;&lt;br /&gt;But, what's that 0x66666667? why to multiply by something so large and then divide?&lt;br /&gt;The reason is that such computation allows the processor to keep most of the precision of the division it is trying to perform, still obtaining an integer in the end but without having to resort to using floating point arithmetic (which is far slower)&lt;br /&gt;&lt;br /&gt;Let's do an example in base 10. Imagine that you only can multiply and divide by 10 (shifting numbers left and right) and we want to divide a number by 30. By shifting we can only divide by 10, 100, 1000, etc&lt;br /&gt;&lt;br /&gt;But we have that: Value/30 = value * 1/3 * 1/10&lt;br /&gt;&lt;br /&gt;Given that, represented as an integer, 1/3 would produce 0 we can "scale" it by multiplying by a large constant that later, once we are done, we divide by to get the value we're after. Given that the easiest for us is to multiply/divide by 10, we can "scale" 1/3 and make it 100000/3 which approximately equals 33333, which is a nice integer value. We would want to make this value as large as it fits in our registers in order to be as precise as possible. The bigger it is the more precision it will retain for subsequent operations.&lt;br /&gt;&lt;br /&gt;Value/30 = ( Value*33333 ) / 1000000&lt;br /&gt;&lt;br /&gt;Hence, we now have a clue now of where that 0x66666667 value might be coming from. Given that the processor works in base 2. We can assume that it's going to prefer multiples of 2. Also, given that it will try to obtain the largest value that fits in a 32bit register, that gives us an idea of the range of the power-of-two in use. We can get there with a bit of trial and error (We want to obtain an integer as a result of dividing a power of two by 0x66666667).&lt;br /&gt;&lt;br /&gt;2.0^33/0x66666667 = 4.9999999982537702 ~= 5&lt;br /&gt;&lt;br /&gt;Therefore:&lt;br /&gt;&lt;br /&gt;0x66666667 ~= 2^33/5&lt;br /&gt;&lt;br /&gt;So, in the end we get to&lt;br /&gt;&lt;br /&gt;( [ (Value * 2^33)/5] /2^32 ) / 2^3&lt;br /&gt;&lt;br /&gt;And with some algebra it simplifies to:&lt;br /&gt;&lt;br /&gt;Value / (5*2^2) =  Value/20&lt;br /&gt;&lt;br /&gt;Effectively dividing the value by 20, without actually using the division instruction. That's to the extent that compilers will go to avoid using the division instruction...&lt;br /&gt;&lt;br /&gt;Reverse engineering is fun isn't it?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; Given that this is a relatively old and well known optimization strategy it's only natural that it had been discussed before. It was just brought to my attention that Ilfak had &lt;a href="http://hexblog.com/2005/11/do_you_know_the_division_opera.html"&gt;blogged about a similar optimization&lt;/a&gt; and &lt;a href="http://www.hackersdelight.org/divcMore.pdf"&gt;this chapter (PDF)&lt;/a&gt; from &lt;a href="http://www.hackersdelight.org/"&gt;Hacker's Delight&lt;/a&gt; provides more details.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/reverse-engineering-compiler-produced.html' title='Reverse engineering a compiler-produced artifact'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=225182886864546815' title='5 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/225182886864546815/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/225182886864546815'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/225182886864546815'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2124705691794449654</id><published>2007-08-28T00:32:00.000+02:00</published><updated>2007-09-10T13:31:39.400+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Visualizations of the Portable Executable Format</title><content type='html'>I've always found that clear diagramming and laying out of complicated information makes it much more accessible and understandable.&lt;br /&gt;When I started looking into the Portable Executable format I found it really helpful to lay out all the headers and structures I was trying to understand, to visualize how they relate to each other and the information they contain.&lt;br /&gt;The resulting diagrams have been available under the &lt;a href="https://www.openrce.org/reference_library/papers/"&gt;corresponding section in OpenRCE&lt;/a&gt; for a some time already.&lt;br /&gt;&lt;br /&gt;Now, given the feedback I received about some of those, I decided to put them up in an &lt;a href="http://cafepress.com/dkbza/"&gt;online store&lt;/a&gt; so people can get the real posters, high-resolution, updated and redesigned versions of those diagrams.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.cafepress.com/dkbza.162471691"&gt;Portable Executable Format poster&lt;/a&gt; has been updated to display the modified structures of the PE32+ format, while the &lt;a href="http://www.cafepress.com/dkbza.164084665"&gt;Portable Executable Format. A File Walkthrough&lt;/a&gt; depicts the basic headers on top of a raw byte representation of an actual executable file.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Ppb6-5N0H80/RuUq-E85HDI/AAAAAAAABFA/QVewy0WVUTc/s1600-h/posters.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_Ppb6-5N0H80/RuUq-E85HDI/AAAAAAAABFA/QVewy0WVUTc/s400/posters.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5108536598291094578" /&gt;&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/visualizations-of-portable-executable.html' title='Visualizations of the Portable Executable Format'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2124705691794449654' title='7 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2124705691794449654/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/2124705691794449654'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2124705691794449654'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-733521791226131716</id><published>2007-08-23T18:30:00.000+02:00</published><updated>2007-08-23T18:34:15.454+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>PyDbg hacks</title><content type='html'>&lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram&lt;/a&gt; just posted on his &lt;a href="https://www.openrce.org/blog/browse/pedram"&gt;OpenRCE blog&lt;/a&gt; some awesome &lt;a href="https://www.openrce.org/blog/view/869/PyDbg_Hacks"&gt;PyDBG hacks&lt;/a&gt;.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/pydbg-hacks.html' title='PyDbg hacks'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=733521791226131716' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/733521791226131716/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/733521791226131716'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/733521791226131716'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-300070473255864683</id><published>2007-08-22T16:49:00.000+02:00</published><updated>2007-08-22T16:53:45.647+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='astrophysics'/><category scheme='http://www.blogger.com/atom/ns#' term='astronomy'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><title type='text'>Google Sky</title><content type='html'>Google has just &lt;a href="http://www.gearthblog.com/blog/archives/2007/08/google_earth_42_rele.html"&gt;released Google Earth 4.2&lt;/a&gt; and it comes with an extremely cool new feature, Google Sky.&lt;br /&gt;It provides layers for all kind of astronomical objects and astrophysical features like &lt;a href="http://en.wikipedia.org/wiki/Gravitational_lensing"&gt;gravitational lenses&lt;/a&gt;. It even has the &lt;a href="http://en.wikipedia.org/wiki/Hubble_Ultra_Deep_Field"&gt;Ultra Deep Field&lt;/a&gt; image sets from the Hubble. This is simply gorgeous, I could play with it for hours...</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/google-sky.html' title='Google Sky'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=300070473255864683' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/300070473255864683/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/300070473255864683'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/300070473255864683'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-47907989251790988</id><published>2007-08-22T01:25:00.000+02:00</published><updated>2007-08-23T18:33:54.573+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2.7</title><content type='html'>Just pushed out an &lt;a href="http://code.google.com/p/pefile/downloads/list"&gt;updated version&lt;/a&gt; of &lt;a href="http://code.google.com/p/pefile/"&gt;pefile&lt;/a&gt; with some minor enhancements and fixes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Added additional IMAGE_SUBSYSTEM_* flags&lt;/li&gt;&lt;li&gt;Added processing of the Optional Header's DllCharacteristics&lt;/li&gt;&lt;li&gt;Time/date fileds are now reported as UTC times&lt;/li&gt;&lt;li&gt;Added warning message for suspicious entry point addresses&lt;/li&gt;&lt;li&gt;Several minor parsing bugs fixed&lt;/li&gt;&lt;/ul&gt;</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/pefile-127.html' title='pefile 1.2.7'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=47907989251790988' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/47907989251790988/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/47907989251790988'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/47907989251790988'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-726876752688614611</id><published>2007-08-21T20:29:00.000+02:00</published><updated>2007-08-23T18:34:35.139+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Great Python overview</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Alex_Martelli"&gt;Alex Martelli&lt;/a&gt; gave a talk in the &lt;a href="http://www.baypiggies.net/"&gt;Baypiggies&lt;/a&gt; meeting providing a great overview of Python. Check out the &lt;a href="http://video.google.com/videoplay?docid=1135114630744003385"&gt;video&lt;/a&gt; and &lt;a href="http://www.aleax.it/goo_py4prog.pdf"&gt;slides&lt;/a&gt;.</content><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/great-python-overview.html' title='Great Python overview'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=726876752688614611' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/726876752688614611/comments/default' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default/726876752688614611'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/726876752688614611'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email></author></entry></feed>