31
31
#else
32
32
#define BO o
33
33
#endif
34
+ #if R2_VERSION_NUMBER >= 50909
35
+ #define ADDRESS_OF (x ) (x)->addr
36
+ #else
37
+ #define ADDRESS_OF (x ) (x)->offset
38
+ #endif
34
39
35
40
Q_GLOBAL_STATIC (IaitoCore, uniqueInstance)
36
41
@@ -409,13 +414,13 @@ QString IaitoCore::cmdHtml(const char *str)
409
414
{
410
415
CORE_LOCK ();
411
416
412
- RVA offset = core-> offset ;
417
+ RVA offset = ADDRESS_OF ( core) ;
413
418
r_core_cmd0 (core, " e scr.html=true;e scr.color=2" );
414
419
char *res = r_core_cmd_str (core, str);
415
420
r_core_cmd0 (core, " e scr.html=false;e scr.color=0" );
416
421
QString o = fromOwnedCharPtr (res);
417
422
418
- if (offset != core-> offset ) {
423
+ if (offset != ADDRESS_OF ( core) ) {
419
424
updateSeek ();
420
425
}
421
426
return o;
@@ -425,11 +430,11 @@ QString IaitoCore::cmd(const char *str)
425
430
{
426
431
CORE_LOCK ();
427
432
428
- RVA offset = core-> offset ;
433
+ RVA offset = ADDRESS_OF ( core) ;
429
434
char *res = r_core_cmd_str (core, str);
430
435
QString o = fromOwnedCharPtr (res);
431
436
432
- if (offset != core-> offset ) {
437
+ if (offset != ADDRESS_OF ( core) ) {
433
438
updateSeek ();
434
439
}
435
440
return o;
@@ -490,13 +495,13 @@ bool IaitoCore::asyncCmd(const char *str, QSharedPointer<R2Task> &task)
490
495
491
496
CORE_LOCK ();
492
497
493
- RVA offset = core-> offset ;
498
+ RVA offset = ADDRESS_OF ( core) ;
494
499
495
500
task = QSharedPointer<R2Task>(new R2Task (str, true ));
496
501
connect (task.data (), &R2Task::finished, task.data (), [this , offset, task]() {
497
502
CORE_LOCK ();
498
503
499
- if (offset != core-> offset ) {
504
+ if (offset != ADDRESS_OF ( core) ) {
500
505
updateSeek ();
501
506
}
502
507
});
@@ -991,7 +996,7 @@ void IaitoCore::seek(ut64 offset)
991
996
992
997
// use cmd and not cmdRaw to make sure seekChanged is emitted
993
998
cmd (QStringLiteral (" s %1" ).arg (offset));
994
- // cmd already does emit seekChanged(core_->offset );
999
+ // cmd already does emit seekChanged(core_->addr );
995
1000
}
996
1001
997
1002
void IaitoCore::showMemoryWidget ()
@@ -1070,7 +1075,7 @@ RVA IaitoCore::nextOpAddr(RVA startAddr, int count)
1070
1075
1071
1076
RVA IaitoCore::getOffset ()
1072
1077
{
1073
- return core_-> offset ;
1078
+ return ADDRESS_OF ( core_) ;
1074
1079
}
1075
1080
1076
1081
ut64 IaitoCore::math (const QString &expr)
0 commit comments