Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; int __thiscall CFG__CFG(CFG *this, area_t *a2)
- CFG__CFG proc near ; CODE XREF: LOCAL__GenerateCFG+83p
- ; CALLGRAPH__ConstructVertex+8Cp
- var_38__NumBlocks= dword ptr -38h
- var_34__ea1= Edge ptr -34h
- eavec= QVector ptr -2Ch
- BasicBlock= BasicBlock ptr -20h
- a2 = dword ptr 4
- 000 sub esp, 38h
- 038 push ebx
- 03C push ebp
- 040 push esi
- 044 xor ebx, ebx
- 044 push edi
- 048 mov edi, ecx
- 048 push 1 ; arg_0
- 04C lea ecx, [esp+4Ch+eavec] ; this
- 04C mov [edi+CFG.BasicBlockVector__Array], ebx
- 04C mov [edi+CFG.BasicBlockVector__N], ebx
- 04C mov [edi+CFG.BasicBlockVector__Alloc], ebx
- 04C mov [esp+4Ch+eavec.array], ebx
- 04C mov [esp+4Ch+eavec.n], ebx
- 04C mov [esp+4Ch+eavec.alloc], ebx
- 04C call QVECTOR__SIZE4__Reserve ; no need to decompile.
- 048 mov ebp, [esp+48h+eavec.n]
- 048 mov ecx, [esp+48h+eavec.array]
- 048 lea eax, [ecx+ebp*4]
- 048 cmp eax, ebx
- 048 jz short loc_10003071
- 048 mov edx, [esp+48h+a2]
- 048 mov edx, [edx+area_t.startEA]
- 048 mov [eax], edx
- loc_10003071: ; CODE XREF: CFG__CFG+37j
- 048 add ebp, 1
- 048 jz loc_10003225
- 048 lea ebx, [ebx+0]
- loop_top: ; CODE XREF: CFG__CFG+1EFj
- 048 mov esi, [ecx]
- 048 lea eax, [ebp*4+0]
- 048 sar eax, 2
- 048 sub eax, 1
- 048 jz short loc_100030A3
- 048 add eax, eax
- 048 add eax, eax
- 048 push eax
- 04C lea edx, [ecx+4]
- 04C push edx
- 050 push ecx
- 054 call memmove ; Microsoft VisualC 2-8/net runtime
- 054 add esp, 0Ch
- loc_100030A3: ; CODE XREF: CFG__CFG+5Fj
- 048 sub ebp, 1
- 048 push esi ; address
- 04C mov ecx, edi ; this
- 04C mov [esp+4Ch+eavec.n], ebp
- 04C call CFG__Split ; decompiled.
- 048 test al, al
- 048 jnz loc_10003219
- 048 mov [esp+48h+BasicBlock.Edges.array], ebx
- 048 mov [esp+48h+BasicBlock.Edges.n], ebx
- 048 mov [esp+48h+BasicBlock.Edges.alloc], ebx
- 048 mov [esp+48h+BasicBlock.Eapairs.array], ebx
- 048 mov [esp+48h+BasicBlock.Eapairs.n], ebx
- 048 mov [esp+48h+BasicBlock.Eapairs.alloc], ebx
- 048 mov [esp+48h+BasicBlock.Boundaries.ea1], esi
- 048 mov [esp+48h+BasicBlock.Boundaries.ea2], esi
- 048 mov bl, 1
- 048 lea esp, [esp+0]
- inner_loop_top: ; CODE XREF: CFG__CFG+10Aj
- 048 push 0
- 04C push esi
- 050 call get_flags_ex
- 048 mov ecx, eax
- 048 shr ecx, 10h
- 048 test cl, 1
- 048 jnz short loc_100030F8
- 048 cmp esi, [esp+48h+BasicBlock.Boundaries.ea1]
- 048 jnz short loc_10003171
- loc_100030F8: ; CODE XREF: CFG__CFG+C0j
- 048 and eax, 600h
- 048 cmp eax, 600h
- 048 jnz short loc_10003171
- 048 push esi ; address
- 04C mov ecx, edi ; this
- 04C call CFG__Split ; decompiled.
- 048 test al, al
- 048 jnz short another_break
- 048 mov ecx, [esp+48h+a2]
- 048 lea edx, [esp+48h+BasicBlock]
- 048 push edx ; block
- 04C lea eax, [esp+4Ch+eavec]
- 04C push eax ; eavec
- 050 push ecx ; address
- 054 mov ecx, edi
- 054 call CFG__Member3 ; this is in fact a member function of the class,
- ; HOWEVER it does not use its this pointer at all.
- ; decompiled.
- 048 test al, al
- 048 jz short loc_1000312C
- 048 xor bl, bl
- loc_1000312C: ; CODE XREF: CFG__CFG+F8j
- 048 push esi
- 04C call get_item_end
- 048 test bl, bl
- 048 mov esi, eax
- 048 mov [esp+48h+BasicBlock.Boundaries.ea2], esi
- 048 jnz short inner_loop_top
- 048 jmp short loc_10003171
- ; ---------------------------------------------------------------------------
- another_break: ; CODE XREF: CFG__CFG+DEj
- 048 mov edx, [esp+48h+BasicBlock.Edges.n]
- 048 add edx, 1
- 048 push edx
- 04C lea ecx, [esp+4Ch+BasicBlock.Edges]
- 04C mov ebp, 3
- 04C call QVECTOR__SIZE8__Reserve ; no need to decompile.
- 048 mov eax, [esp+48h+BasicBlock.Edges.n]
- 048 mov ecx, [esp+48h+BasicBlock.Edges.array]
- 048 lea eax, [ecx+eax*8]
- 048 test eax, eax
- 048 jz short loc_10003168
- 048 mov [eax+Edge.ea], esi
- 048 mov [eax+Edge.type], ebp
- loc_10003168: ; CODE XREF: CFG__CFG+131j
- 048 add [esp+48h+BasicBlock.Edges.n], 1
- 048 mov esi, [esp+48h+BasicBlock.Boundaries.ea2]
- loc_10003171: ; CODE XREF: CFG__CFG+C6j
- ; CFG__CFG+D2j ...
- 048 mov eax, [edi+CFG.BasicBlockVector__N]
- 048 mov ecx, [edi+CFG.BasicBlockVector__Alloc]
- 048 add eax, 1
- ; reserve()
- loc_100031AF: ; CODE XREF: CFG__CFG+14Cj
- 048 mov ebp, [edi+CFG.BasicBlockVector__N]
- 048 shl ebp, 5
- 048 add ebp, [edi+CFG.BasicBlockVector__Array]
- 048 jz short loc_100031F1
- 048 mov eax, [esp+48h+BasicBlock.Boundaries.ea1]
- 048 mov [ebp+BasicBlock.Boundaries.ea2], esi
- 048 lea ecx, [ebp+BasicBlock.Edges.array]
- 048 mov [ebp+BasicBlock.Boundaries.ea1], eax
- 048 xor esi, esi
- 048 lea edx, [esp+48h+BasicBlock.Edges]
- 048 push edx
- 04C mov [ecx+QVector.array], esi
- 04C mov [ecx+QVector.n], esi
- 04C mov [ecx+QVector.alloc], esi
- 04C call QVECTOR__SIZE8__Assign ; no need to decompile.
- 048 lea ecx, [ebp+BasicBlock.Eapairs.array]
- 048 lea eax, [esp+48h+BasicBlock.Eapairs]
- 048 push eax
- 04C mov [ecx+QVector.array], esi
- 04C mov [ecx+QVector.n], esi
- 04C mov [ecx+QVector.alloc], esi
- 04C call QVECTOR__SIZE8__Assign ; no need to decompile.
- 048 jmp short loc_100031F3
- ; ---------------------------------------------------------------------------
- loc_100031F1: ; CODE XREF: CFG__CFG+187j
- 048 xor esi, esi
- loc_100031F3: ; CODE XREF: CFG__CFG+1BFj
- 048 mov eax, [esp+48h+BasicBlock.Eapairs.array]
- 048 add [edi+CFG.BasicBlockVector__N], 1
- 048 cmp eax, esi
- 048 jz short loc_10003205
- 048 push eax
- 04C call qfree
- loc_10003205: ; CODE XREF: CFG__CFG+1CDj
- 048 mov eax, [esp+48h+BasicBlock.Edges.array]
- 048 cmp eax, esi
- 048 jz short loc_10003213
- 048 push eax
- 04C call qfree
- loc_10003213: ; CODE XREF: CFG__CFG+1DBj
- 048 mov ebp, [esp+48h+eavec.n]
- 048 xor ebx, ebx
- loc_10003219: ; CODE XREF: CFG__CFG+84j
- 048 cmp ebp, ebx
- 048 mov ecx, [esp+48h+eavec.array]
- 048 jnz loop_top
- loc_10003225: ; CODE XREF: CFG__CFG+44j
- 048 mov eax, [edi+CFG.BasicBlockVector__N]
- 048 cmp eax, ebx
- 048 mov [edi+CFG.NumBlocks], eax
- 048 mov [esp+48h+var_38__NumBlocks], ebx
- 048 jle loc_1000331D
- second_loop_top: ; CODE XREF: CFG__CFG+2E5j
- 048 mov edx, [edi+CFG.BasicBlockVector__Array]
- 048 xor ebp, ebp
- 048 cmp [ebx+edx+BasicBlock.Edges.n], ebp
- 048 mov [esp+48h+a2], ebp
- 048 jle loc_10003304
- 048 lea esp, [esp+0]
- second_inner_loop_top: ; CODE XREF: CFG__CFG+2CAj
- 048 mov eax, [edi+CFG.BasicBlockVector__Array]
- 048 mov ecx, [ebx+eax+BasicBlock.Boundaries.ea1]
- 048 mov edx, [ebx+eax+BasicBlock.Edges.array]
- 048 mov [esp+48h+var_34__ea1.ea], ecx
- 048 mov ecx, [edx+ebp*8+Edge.type]
- 048 lea edx, [edx+ebp*8]
- 048 mov [esp+48h+var_34__ea1.type], ecx
- 048 xor ecx, ecx
- 048 cmp [edi+CFG.NumBlocks], ecx
- 048 jle short third_inner_loop_follow
- 048 mov edx, [edx+Edge.ea]
- 048 mov esi, eax
- second_inner_inner_loop_top: ; CODE XREF: CFG__CFG+250j
- 048 cmp [esi+BasicBlock.Boundaries.ea1], edx
- 048 jz short loc_10003285
- 048 add ecx, 1
- 048 add esi, size BasicBlock
- 048 cmp ecx, [edi+CFG.NumBlocks]
- 048 jl short second_inner_inner_loop_top
- third_inner_loop_follow: ; CODE XREF: CFG__CFG+23Dj
- 048 or ecx, 0FFFFFFFFh
- loc_10003285: ; CODE XREF: CFG__CFG+245j
- 048 shl ecx, 5
- 048 lea esi, [ecx+eax+BasicBlock.Eapairs]
- 048 mov eax, [esi+QVector.n]
- 048 mov ecx, [esi+QVector.alloc]
- 048 add eax, 1
- ; reserve()
- loc_100032D0: ; CODE XREF: CFG__CFG+267j
- 048 mov eax, [esi+QVector.n]
- 048 mov ecx, [esi+QVector.array]
- 048 lea eax, [ecx+eax*8]
- 048 test eax, eax
- 048 jz short loc_100032E9
- 048 mov edx, [esp+48h+var_34__ea1.ea]
- 048 mov ecx, [esp+48h+var_34__ea1.type]
- 048 mov [eax], edx
- 048 mov [eax+4], ecx
- loc_100032E9: ; CODE XREF: CFG__CFG+2AAj
- 048 add [esi+QVector.n], 1
- 048 mov edx, [edi+CFG.BasicBlockVector__Array]
- 048 add ebp, 1
- 048 cmp ebp, [ebx+edx+BasicBlock.Edges.n]
- 048 mov [esp+48h+a2], ebp
- 048 jl second_inner_loop_top
- 048 mov ecx, [esp+48h+eavec.array]
- loc_10003304: ; CODE XREF: CFG__CFG+213j
- 048 mov eax, [esp+48h+var_38__NumBlocks]
- 048 add eax, 1
- 048 add ebx, 20h
- 048 cmp eax, [edi+CFG.NumBlocks]
- 048 mov [esp+48h+var_38__NumBlocks], eax
- 048 jl second_loop_top
- 048 xor ebx, ebx
- loc_1000331D: ; CODE XREF: CFG__CFG+201j
- 048 cmp ecx, ebx
- 048 jz short loc_10003327
- 048 push ecx
- 04C call qfree
- loc_10003327: ; CODE XREF: CFG__CFG+2EFj
- 048 mov eax, edi
- 048 pop edi
- 044 pop esi
- 040 pop ebp
- 03C pop ebx
- 038 add esp, 38h
- 000 retn 4
- CFG__CFG endp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement