@loc1: cmp eax, val2 jbe @loc3 @loc4:
@loc2: cmp eax, val3 jbe @loc5 @loc6:
// The first range returned is that for which the jump is taken; // the second is for non-jump-taking values partition(ea, low, high, compared) { if(comparison at ea is ">") return [compared+1, high], [low, compared] if(comparison at ea is ">=") return [compared, high], [low, compared+1] if(comparison at ea is "<") return [low, compared-1], [compared, high] if(comparison at ea is "<=") return [low, compared], [compared+1, high] if(comparison at ea is "==") return [compared, compared], [low, high] if(comparison at ea is "!=") return [low, high], [compared, compared] }
analyze_bswitch(ea_t ea, int low, int high, int compared) { if(ea is "cmp reg, constant") compared = instruction's immediate value ea = address of next instruction if(ea is a conditional jump) [low1,high2], [low2,high2] = partition(ea, low, high, compared) analyze_bswitch(jump taken ea, low1, high1, compared) analyze_bswitch(jump not taken ea, low2, high2, compared) // Instruction is a leaf in the binary tree else associate(ea, low, high) }
AUTO:0046348E jbe loc_463D16 ; case 0A0h AUTO:00463494 cmp eax, 0A2h AUTO:00463499 jb loc_462FA0 ; case 0837F81BAh, 0837F81D8h, 0A1h, 091h AUTO:0046349F ja loc_463D21 ; case 0837F90BAh, 0A3h AUTO:004634A5 loc_4634A5: ; CODE XREF: sub_462120:loc_462EDAj AUTO:004634A5 ; sub_462120+DDDj ... AUTO:004634A5 push ebx ; case 0837F8106h, 0837F8124h, 0A2h, 031h AUTO:004634A6 call sub_45C630 AUTO:004634AB jmp loc_462217
There are 31,322 total registered users.
[+] expand