I have an application that creates .textwin32 process segment dumps. Then it divides the code into base blocks. The main block is a set of instructions that are always executed one after another (jumps are always the last instructions of such basic blocks). Here is an example:
Basic block 1
mov ecx, dword ptr [ecx]
test ecx, ecx
je 00401013h
Basic block 2
mov eax, dword ptr [ecx]
call dword ptr [eax+08h]
Basic block 3
test eax, eax
je 0040100Ah
Basic block 4
mov edx, dword ptr [eax]
push 00000001h
mov ecx, eax
call dword ptr [edx]
Basic block 5
ret 000008h
Now I would like to group such base blocks into functions - say, which base blocks form a function. Which algorithm? I must remember that there can be many instructions within one function ret. How to detect features fast_call?
source
share