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

Function powerpc_init

arch/powerpc/disassembler.cpp:165–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165extern "C" int
166powerpc_init(int cs_mode_arg)
167{
168 int rc = -1;
169
170 MYLOG("powerpc_init()\n");
171
172 if(handle_lil || handle_big) {
173 MYLOG("ERROR: already initialized!\n");
174 goto cleanup;
175 }
176
177 /* initialize capstone handle */
178 if(cs_open(CS_ARCH_PPC, (cs_mode)((int)CS_MODE_BIG_ENDIAN | cs_mode_arg), &handle_big) != CS_ERR_OK) {
179 MYLOG("ERROR: cs_open()\n");
180 goto cleanup;
181 }
182
183 if(cs_open(CS_ARCH_PPC, (cs_mode)((int)CS_MODE_LITTLE_ENDIAN | cs_mode_arg), &handle_lil) != CS_ERR_OK) {
184 MYLOG("ERROR: cs_open()\n");
185 goto cleanup;
186 }
187
188 cs_option(handle_big, CS_OPT_DETAIL, CS_OPT_ON);
189 cs_option(handle_lil, CS_OPT_DETAIL, CS_OPT_ON);
190
191 rc = 0;
192 cleanup:
193 if(rc) {
194 powerpc_release();
195 }
196
197 return rc;
198}
199
200extern "C" void
201powerpc_release(void)

Callers 3

powerpc_decomposeFunction · 0.85
powerpc_reg_to_strFunction · 0.85
mainFunction · 0.85

Calls 1

powerpc_releaseFunction · 0.85

Tested by 1

mainFunction · 0.68