MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / thumb_has_writeback

Function thumb_has_writeback

arch/armv7/thumb2_disasm/disassembler.cpp:178–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178bool thumb_has_writeback(struct decomp_result* result)
179{
180 /* for 16-bit LDM, {!} is removed if the base register is in the register list */
181 if(result->mnem == armv7::ARMV7_LDM && result->instrSize==16) {
182 int list = result->fields[FIELD_register_list];
183 int Rn = result->fields[FIELD_Rn];
184 //printf("Rn: 0x%x\n", Rn);
185 /* if the base register is in the register list, we discard the bang */
186 if(list & (1 << Rn))
187 return false;
188 else
189 return true;
190 }
191 else
192 /* for others, {!} field determined by "W" element */
193 if(IS_FIELD_PRESENT(result, FIELD_W)) {
194 if(result->fields[FIELD_W])
195 return true;
196 }
197 else {
198#ifdef DEBUG_DISASM
199 if(getenv("DEBUG_DISASM")) {
200 printf("ERROR: don't know how to deal with {!} field\n");
201 }
202#endif
203 return false;
204 }
205 return false;
206}
207
208/* inspect the decomposition result to return the operation name
209

Callers 2

HasWritebackFunction · 0.85
GetInstructionTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected