static int r_debug_wind_attach (RDebug *dbg, int pid) { RIODesc *desc = dbg->iob.io->desc; if (!desc || !desc->plugin || !desc->plugin->name || !desc->data) return R_FALSE; if (strncmp (desc->plugin->name, "windbg", 6)) return R_FALSE; if (dbg->arch && strcmp (dbg->arch, "x86")) return R_FALSE; wctx = (WindCtx *)desc->data; if (!wctx) return R_FALSE; // Handshake if (!wind_sync(wctx)) { eprintf("Could not connect to windbg\n"); wind_ctx_free(wctx); return R_FALSE; } if (!wind_read_ver(wctx)) { wind_ctx_free(wctx); return R_FALSE; } // Make r_debug_is_dead happy dbg->pid = 0; return R_TRUE; }
static int __close(RIODesc *fd) { wind_ctx_free (fd->data); return R_TRUE; }