如何在ARM指令中调用类的方法时获取目标方法的地址

时间:2016-07-05 10:29:01

标签: android arm

众所周知,Android将应用程序编译成ARM指令,以使应用程序快速运行 当我在Android中分析APP的机器指令时,我发现一个类的方法的目标地址很难理解。

例如,方法调用for (i in 1:6) { ### pettern 1 / plot(pca); par(new=T); plot(~, new_lim()) s1= rnorm(50,mean = 12); s2= rnorm(50, mean = 17); s3= rnorm(50, mean = 20) pca=rda(cbind(s1,s2,s3)) pca.scoop=scores(pca, scaling = 2) myccaplot( ### (4) pca, xlab = "x1", ylab = "y1", type = c("p"),main= "main",scaling = 2,choices = c(1,2), xlim =c(min(pca.scoop$sites[,1]),max(pca.scoop$sites[,1])), ylim = c(min(pca.scoop$sites[,2]),max(pca.scoop$sites[,2])), bty = "o",pch=4, axes = F) ### (1) axis(1) ### (2) axis(2) ### (2) box() ### (2) par(new =TRUE) plot(x2, y2, xlim = new_lim(x2), ylim = new_lim(y2, 2), axes = F, ann = F) axis(3, col = "red", col.axis = "red") axis(4, col = "red", col.axis = "red") abline(v = 0, lty = 2) ### (3) abline(h = 0, lty = 2) ### (3) mtext("x2", side = 3, line = 2.5, col = "red") mtext("y2", side = 4, line = 2.5, col = "red") } ### (4) ## copy modified content of getAnywhere(plot.cca) here myccaplot <- function (x, choices = c(1, 2), display = c("sp", "wa", "cn"), scaling = "species", type, xlim, ylim, const, correlation = FALSE, hill = FALSE, ...) { TYPES <- c("text", "points", "none") g <- scores(x, choices, display, scaling, const, correlation = correlation, hill = hill) if (length(g) == 0 || all(is.na(g))) stop("nothing to plot: requested scores do not exist") if (!is.list(g)) g <- list(default = g) for (i in seq_along(g)) { if (length(dim(g[[i]])) > 1) rownames(g[[i]]) <- rownames(g[[i]], do.NULL = FALSE, prefix = substr(names(g)[i], 1, 3)) } if (!is.null(g$centroids)) { if (is.null(g$biplot)) g$biplot <- scores(x, choices, "bp", scaling) if (!is.na(g$centroids)[1]) { bipnam <- rownames(g$biplot) cntnam <- rownames(g$centroids) g$biplot <- g$biplot[!(bipnam %in% cntnam), , drop = FALSE] if (nrow(g$biplot) == 0) g$biplot <- NULL } } if (missing(type)) { nitlimit <- 80 nit <- max(nrow(g$spe), nrow(g$sit), nrow(g$con), nrow(g$def)) if (nit > nitlimit) type <- "points" else type <- "text" } else type <- match.arg(type, TYPES) if (length(choices) == 1) { if (length(g) == 1) pl <- linestack(g[[1]], ...) else { hasSpec <- names(g)[1] == "species" ylim <- range(c(g[[1]], g[[2]]), na.rm = TRUE) pl <- linestack(g[[1]], ylim = ylim, side = ifelse(hasSpec, "left", "right"), ...) linestack(g[[2]], ylim = ylim, side = ifelse(hasSpec, "right", "left"), add = TRUE, ...) } return(invisible(pl)) } if (missing(xlim)) { xlim <- range(g$species[, 1], g$sites[, 1], g$constraints[, 1], g$biplot[, 1], if (length(g$centroids) > 0 && is.na(g$centroids)) NA else g$centroids[, 1], g$default[, 1], na.rm = TRUE) } if (!any(is.finite(xlim))) stop("no finite scores to plot") if (missing(ylim)) { ylim <- range(g$species[, 2], g$sites[, 2], g$constraints[, 2], g$biplot[, 2], if (length(g$centroids) > 0 && is.na(g$centroids)) NA else g$centroids[, 2], g$default[, 2], na.rm = TRUE) } plot(g[[1]], xlim = xlim, ylim = ylim, type = "n", asp = 1, ...) # abline(h = 0, lty = 3) # removed # abline(v = 0, lty = 3) # removed if (!is.null(g$species)) { if (type == "text") text(g$species, rownames(g$species), col = "red", cex = 0.7) else if (type == "points") points(g$species, pch = "+", col = "red", cex = 0.7) } if (!is.null(g$sites)) { if (type == "text") text(g$sites, rownames(g$sites), cex = 0.7) else if (type == "points") points(g$sites, pch = 1, cex = 0.7) } if (!is.null(g$constraints)) { if (type == "text") text(g$constraints, rownames(g$constraints), cex = 0.7, col = "darkgreen") else if (type == "points") points(g$constraints, pch = 2, cex = 0.7, col = "darkgreen") } if (!is.null(g$biplot) && nrow(g$biplot) > 0 && type != "none") { if (length(display) > 1) { mul <- ordiArrowMul(g$biplot) } else mul <- 1 attr(g$biplot, "arrow.mul") <- mul arrows(0, 0, mul * g$biplot[, 1], mul * g$biplot[, 2], length = 0.05, col = "blue") biplabs <- ordiArrowTextXY(mul * g$biplot, rownames(g$biplot)) text(biplabs, rownames(g$biplot), col = "blue") axis(3, at = c(-mul, 0, mul), labels = rep("", 3), col = "blue") axis(4, at = c(-mul, 0, mul), labels = c(-1, 0, 1), col = "blue") } if (!is.null(g$centroids) && !is.na(g$centroids) && type != "none") { if (type == "text") text(g$centroids, rownames(g$centroids), col = "blue") else if (type == "points") points(g$centroids, pch = "x", col = "blue") } if (!is.null(g$default) && type != "none") { if (type == "text") text(g$default, rownames(g$default), cex = 0.7) else if (type == "points") points(g$default, pch = 1, cex = 0.7) } class(g) <- "ordiplot" invisible(g) } 的目标计算如下:

  1. [r1,#16] - &gt; r5
  2. r5-&gt; r1
  3. [r1,#0] - &gt; r0
  4. [r0,#572] - &gt; r0
  5. [r0,#40] - &gt; lr
  6. blx lr
  7. 您能否告诉我为什么这段代码可以获得目标地址,尤其是572和40的值是什么意思?

    我找到了一些关于手臂指令的解释。但是大多数只关注函数调用,而不是类的方法调用。你能告诉我一些关于这件事的博客或论文吗?

0 个答案:

没有答案