Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the windows build #140

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ci

env:
R2V: 5.9.0
R2V: 5.9.2

on:
push:
Expand Down
15 changes: 9 additions & 6 deletions configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# This script was automatically generated by ACR v2.1.2
# This script was automatically generated by ACR v2.1.4
# @author: pancake <nopcode.org>
# @url: http://www.nopcode.org
# @repo: git clone https://github.com/radare/acr
Expand Down Expand Up @@ -112,12 +112,12 @@ done
: ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s}
: ${INSTALL_MAN:=${INSTALL} -m 444}
: ${INSTALL_LIB:=${INSTALL} -m 755 -c}
PKGNAME='r2ghidra' ; VERSION='5.9.1' ; VERSION_MAJOR=5; VERSION_MINOR=9; VERSION_PATCH=1; VERSION_NUMBER=50901; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
PKGNAME='r2ghidra' ; VERSION='5.9.2' ; VERSION_MAJOR=5; VERSION_MINOR=9; VERSION_PATCH=2; VERSION_NUMBER=50902; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
}

show_usage() {
cat <<EOF2
'configure' configures r2ghidra-5.9.1 to adapt to many kinds of systems.
'configure' configures r2ghidra-5.9.2 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -189,10 +189,10 @@ ocho() {

show_version() {
if [ "$QUIET" = 1 ]; then
echo "5.9.1"
echo "5.9.2"
exit 0
fi
echo "r2ghidra-5.9.1 configuration script done with acr v2.1.2.
echo "r2ghidra-5.9.2 configuration script done with acr v2.1.4.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
Expand Down Expand Up @@ -221,7 +221,7 @@ case $flag in
show_version ; ;;
-r|--r|--report)
echo "PKGNAME: r2ghidra"
echo "VERSION: 5.9.1"
echo "VERSION: 5.9.2"
echo "AUTHOR: pancake"
echo "EMAIL: pancake@nopcode.org"
echo "LANGS: c++"
Expand Down Expand Up @@ -364,6 +364,7 @@ fi
echo "error: This program is required." >&2
exit 1 ; fi
ochof "checking for pkg-config... "
ENVWORDS="${ENVWORDS} HAVE_PKGCONFIG"
if [ -n "$PKGCONFIG" ]; then
if [ -x "$PKGCONFIG" ]; then
_HAVE_PKGCONFIG="${PKGCONFIG}"
Expand All @@ -387,7 +388,9 @@ else
fi
if [ -n "${PKGCONFIG}" ]; then
ocho ${PKGCONFIG}
HAVE_PKGCONFIG=1
else
HAVE_PKGCONFIG=0
echo "Cannot find pkg-config or pkgconf in PATH" >&2
exit 1
ocho no; fi
Expand Down
2 changes: 1 addition & 1 deletion configure.acr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKGNAME r2ghidra
VERSION 5.9.1
VERSION 5.9.2
CONTACT pancake ; pancake@nopcode.org

LANG_CXX!
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(
['c', 'cpp'],
license : 'LGPL3',
meson_version : '>=0.50.1',
version : '5.9.1',
version : '5.9.2',
default_options : ['c_std=c11', 'cpp_std=c++11']
)

Expand Down
8 changes: 6 additions & 2 deletions src/SleighAnalValue.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* r2ghidra - LGPL - Copyright 2020-2023 - FXTi, pancake */
/* r2ghidra - LGPL - Copyright 2020-2024 - FXTi, pancake */

#include "SleighAnalValue.h"

Expand Down Expand Up @@ -70,7 +70,11 @@ SleighAnalValue SleighAnalValue::resolve_arg(RAnal *anal, const PcodeOperand *ar
res.imm = (curr_op->type == CPUI_INT_ADD)? in0.imm + in1.imm : in0.imm - in1.imm;
} else {
res.base = in0.imm + in0.base;
res.base += (curr_op->type == CPUI_INT_ADD)? (in1.imm + in1.base) : -(in1.imm + in1.base);
if (curr_op->type == CPUI_INT_ADD) {
res.base += (in1.imm + in1.base);
} else {
res.base -= (in1.imm + in1.base);
}
}
res.mul = inner_max(in0.mul, in1.mul); // Only one of inputs should set mul
res.delta = inner_max(in0.delta, in1.delta);
Expand Down
6 changes: 2 additions & 4 deletions src/anal_ghidra_plugin.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* r2ghidra - LGPL - Copyright 2020-2023 - pancake */
/* r2ghidra - LGPL - Copyright 2020-2024 - pancake */

#include <r_lib.h>
#include <r_anal.h>
Expand All @@ -8,7 +8,6 @@
#define RAnalEsil REsil
#endif


#if R2_VERSION_NUMBER >= 50809
extern int archinfo(RArchSession *as, ut32 query);
extern bool sanal_init(RArchSession *as);
Expand All @@ -17,9 +16,8 @@ extern RList *r2ghidra_preludes(RArchSession *as);
extern int archinfo(RArchSession *as, ut32 query);
extern char *r2ghidra_regs(RArchSession *as);
extern bool r2ghidra_esilcb(RArchSession *as, RArchEsilAction action);
// extern bool sleigh_decode(RArchSession *as, RAnal *a, RAnalOp *anal_op, ut64 addr, const ut8 *data, int len, RAnalOpMask mask);
extern char *get_reg_profile(RAnal *anal);
static bool sleigh_decode(RArchSession *as, RAnalOp *op, RArchDecodeMask mask);
bool sleigh_decode(RArchSession *as, RAnalOp *op, RArchDecodeMask mask);

RArchPlugin r_arch_plugin_ghidra = {
.meta = {
Expand Down
1 change: 1 addition & 0 deletions src/r2ghidra.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef R2GHIDRA_H
#define R2GHIDRA_H

#undef R_LOG_ORIGIN
#define R_LOG_ORIGIN "r2ghidra"

#include <r_core.h>
Expand Down
Loading