1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
| __int64 __fastcall sub_6B80(__int64 a1, llvm::BasicBlock *BasicBlock) { llvm::Value *CalledFunction; void **v3; void **v4; llvm::ConstantInt *key_min2; __int64 ArgOp_min2; __int64 op_min; llvm::ConstantInt *key_min; _QWORD *reg_min; __int64 ArgOp_min; llvm::ConstantInt *key_add2; __int64 ArgOp_add2; __int64 op_add; llvm::ConstantInt *key_add; _QWORD *reg_add; __int64 ArgOp_add; __int64 op_load; llvm::ConstantInt *key_load; void *reg_load; __int64 ArgOp_load; __int64 op_store; llvm::ConstantInt *key_store; void *reg_store; __int64 ArgOp_store; __int64 op_push; llvm::ConstantInt *key_push; _QWORD *reg_push; __int64 ArgOp_push; __int64 op_pop; llvm::ConstantInt *key_pop; _QWORD *reg_pop; __int64 ArgOp_pop; char *name; llvm::CallBase *v35; llvm::Instruction *v36; _QWORD *Name; __int64 v38; __int64 v39[2];
v39[1] = __readfsqword(0x28u); v39[0] = llvm::BasicBlock::begin(BasicBlock); while ( 1 ) { v38 = llvm::BasicBlock::end(BasicBlock); if ( (llvm::operator!=(v39, &v38) & 1) == 0 ) break; v36 = (llvm::Instruction *)llvm::dyn_cast<llvm::Instruction,llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,false,false,void>,false,false>>(v39); if ( (unsigned int)llvm::Instruction::getOpcode(v36) == 55 ) { v35 = (llvm::CallBase *)llvm::dyn_cast<llvm::CallInst,llvm::Instruction>(v36); if ( v35 ) { name = (char *)malloc(0x20uLL); CalledFunction = (llvm::Value *)llvm::CallBase::getCalledFunction(v35); Name = (_QWORD *)llvm::Value::getName(CalledFunction); *(_QWORD *)name = *Name; *((_QWORD *)name + 1) = Name[1]; *((_QWORD *)name + 2) = Name[2]; *((_QWORD *)name + 3) = Name[3]; if ( !strcmp(name, "pop") ) { if ( (unsigned int)llvm::CallBase::getNumOperands(v35) == 2 ) { ArgOp_pop = llvm::CallBase::getArgOperand(v35, 0); reg_pop = 0LL; key_pop = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_pop); if ( key_pop ) { op_pop = llvm::ConstantInt::getZExtValue(key_pop); if ( op_pop == 1 ) reg_pop = register1; if ( op_pop == 2 ) reg_pop = register2; } if ( reg_pop ) { v3 = stack_s; *reg_pop = *(_QWORD *)*stack_s; *v3 = (char *)*v3 - 8; } } } else if ( !strcmp(name, "push") ) { if ( (unsigned int)llvm::CallBase::getNumOperands(v35) == 2 ) { ArgOp_push = llvm::CallBase::getArgOperand(v35, 0); reg_push = 0LL; key_push = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_push); if ( key_push ) { op_push = llvm::ConstantInt::getZExtValue(key_push); if ( op_push == 1 ) reg_push = register1; if ( op_push == 2 ) reg_push = register2; } if ( reg_push ) { v4 = stack_s; *stack_s = (char *)*stack_s + 8; *(_QWORD *)*v4 = *reg_push; } } } else if ( !strcmp(name, "store") ) { if ( (unsigned int)llvm::CallBase::getNumOperands(v35) == 2 ) { ArgOp_store = llvm::CallBase::getArgOperand(v35, 0); reg_store = 0LL; key_store = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_store); if ( key_store ) { op_store = llvm::ConstantInt::getZExtValue(key_store); if ( op_store == 1 ) reg_store = register1; if ( op_store == 2 ) reg_store = register2; } if ( reg_store == register1 ) { **(_QWORD **)register1 = *(_QWORD *)register2; } else if ( reg_store == register2 ) { **(_QWORD **)register2 = *(_QWORD *)register1; } } } else if ( !strcmp(name, "load") ) { if ( (unsigned int)llvm::CallBase::getNumOperands(v35) == 2 ) { ArgOp_load = llvm::CallBase::getArgOperand(v35, 0); reg_load = 0LL; key_load = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_load); if ( key_load ) { op_load = llvm::ConstantInt::getZExtValue(key_load); if ( op_load == 1 ) reg_load = register1; if ( op_load == 2 ) reg_load = register2; } if ( reg_load == register1 ) *(_QWORD *)register2 = **(_QWORD **)register1; if ( reg_load == register2 ) *(_QWORD *)register1 = **(_QWORD **)register2; } } else if ( !strcmp(name, "add") ) { if ( (unsigned int)llvm::CallBase::getNumOperands(v35) == 3 ) { ArgOp_add = llvm::CallBase::getArgOperand(v35, 0); reg_add = 0LL; key_add = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_add); if ( key_add ) { op_add = llvm::ConstantInt::getZExtValue(key_add); if ( op_add == 1 ) reg_add = register1; if ( op_add == 2 ) reg_add = register2; } if ( reg_add ) { ArgOp_add2 = llvm::CallBase::getArgOperand(v35, 1u); key_add2 = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_add2); if ( key_add2 ) *reg_add += llvm::ConstantInt::getZExtValue(key_add2); } } } else if ( !strcmp(name, "min") && (unsigned int)llvm::CallBase::getNumOperands(v35) == 3 ) { ArgOp_min = llvm::CallBase::getArgOperand(v35, 0); reg_min = 0LL; key_min = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_min); if ( key_min ) { op_min = llvm::ConstantInt::getZExtValue(key_min); if ( op_min == 1 ) reg_min = register1; if ( op_min == 2 ) reg_min = register2; } if ( reg_min ) { ArgOp_min2 = llvm::CallBase::getArgOperand(v35, 1u); key_min2 = (llvm::ConstantInt *)llvm::dyn_cast<llvm::ConstantInt,llvm::Value>(ArgOp_min2); if ( key_min2 ) *reg_min -= llvm::ConstantInt::getZExtValue(key_min2); } } free(name); } } llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,false,false,void>,false,false>::operator++( v39, 0LL); } return 1LL; }
|