Code and comments cleanup (#108)

This commit is contained in:
Giovanni 2020-12-04 11:11:51 +01:00 committed by GitHub
parent be58956946
commit 35a9ef94c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 332 additions and 577 deletions

View file

@ -1,37 +1,36 @@
* @trufae
*.js @trufae
CODEOWNERS @trufae @XVilka @kazarmy @thestr4ng3r @ret2libc
* @wargio @XVilka @kazarmy @thestr4ng3r @ret2libc
*.js @wargio
CODEOWNERS @wargio @XVilka @kazarmy @thestr4ng3r @ret2libc
librz/anal/ @thestr4ng3r
librz/anal/esil* @trufae @condret
librz/anal/esil* @wargio
librz/anal/xrefs.c @ret2libc
librz/arch/gb/ @condret
librz/asm/ @wargio @trufae
librz/arch/gb/ @wargio
librz/asm/ @wargio
librz/asm/p/x86_* @ret2libc
librz/asm/p/arm_* @trufae
librz/bin/ @ret2libc @trufae
librz/asm/p/arm_* @wargio
librz/bin/ @ret2libc @wargio
librz/bin/format/elf/ @ret2libc @kazarmy
librz/bin/format/mach0/ @trufae
librz/bin/format/objc/ @trufae
librz/bin/format/mach0/ @wargio
librz/bin/format/objc/ @wargio
librz/bin/format/wasm/ @wargio
librz/config/ @trufae @ret2libc
librz/cons/ @thestr4ng3r @trufae
librz/core/cmd.c @ret2libc @trufae
librz/debug/ @yossizap @trufae
librz/egg/ @trufae
librz/flag/ @ret2libc @trufae
librz/fs/ @trufae
librz/io/ @condret @trufae @ret2libc
librz/lang/ @thestr4ng3r @trufae @ret2libc
librz/magic/ @trufae
librz/parse/ @ret2libc @trufae
librz/reg/ @XVilka @trufae
librz/config/ @wargio @ret2libc
librz/cons/ @thestr4ng3r @wargio
librz/core/cmd.c @ret2libc @wargio
librz/debug/ @yossizap @wargio
librz/egg/ @wargio
librz/flag/ @ret2libc @wargio
librz/fs/ @wargio
librz/io/ @wargio @ret2libc
librz/lang/ @thestr4ng3r @wargio @ret2libc
librz/magic/ @wargio
librz/parse/ @ret2libc @wargio
librz/reg/ @XVilka @wargio
librz/socket/ @XVilka @yossizap
librz/syscall/ @ret2libc @trufae
librz/syscall/ @ret2libc @wargio
librz/util/ @ret2libc @thestr4ng3r
shlr/gdb/ @yossizap
shlr/ptrace-wrap/ @thestr4ng3r
shlr/rizin-shell-parser/ @ret2libc
shlr/tcc/ @XVilka @trufae
shlr/tcc/ @XVilka @wargio
shlr/w32dbg_wrap/ @yossizap
shlr/winkd/ @yossizap
doc/fortunes.nsfw @thestr4ng3r

View file

@ -1,7 +1,7 @@
# This is an example file for rapatch
#0x8048000 : mov eax, 33
#0x8048005 # This is fucking awesome
#0x8048005 # This is awesome
!echo ++ Patching binary
. import.rdb

View file

@ -154,7 +154,7 @@ countDown() {
echo 'Go!'
}
commitSuicide() {
purgeSystem() {
confirm "Do you wanna purge rizin completely from your system and home?"
if [ $? != 0 ]; then
echo "Aborted." > /dev/stderr
@ -706,8 +706,8 @@ cache)
fi
eval echo "\$$2"
;;
suicide)
commitSuicide
purge)
purgeSystem
;;
-d|doc|--doc)
rz-pm_doc "$2"
@ -736,7 +736,7 @@ Commands:
init | update .. initialize/update database
cd [git/dir] cd into given git (see 'rz-pm ls')
ls ls all cloned git repos in GITDIR
suicide self remove all (home + system) installations of rizin
purge self remove all (home + system) installations of rizin
cache cache contents of rizin -H to make rz-pm rizin-independent
Environment:
SUDO=sudo use this tool as sudo

View file

@ -1,51 +0,0 @@
I know what you are doing.
You should better not go to sleep.
You look different when are you awake.
I like you because you haven't been infected. Yet
This is not a joke.
Drop the keyboard and RUN!
Follow the white rabbit
Any invalid command will remove a random file from your home.
Your hair smells different when you are not sleeping.
There was a picture in my phone of me sleeping. I live alone.
My sister says that mommy killed her. Mommy says that I don't have a sister.
Don't be scared of the monsters, just look for them.
Do not walk into the kitchen now.
There's someone under your bed awaiting.
There's no time for explanations.
I'm not looking at you. It's behind.
Let me just change these two bytes aaaaand, the .text is gone.
You will die before this analysis ends.
How much will you pay me for not disclosing this?
Procrastination is opportunity's assassin.
Are your front cameras duck taped?
You are alone.
Neither you or me are special.
Learn the lesson once and for all.
I wanted you to fill what I felt.
I don't believe in accidents.
This is somewhat traumatizing me.
I will never forget the day you typed a gdb command in me.
Be careful
Annihilation is not the way
The Game.
Why that face? Smile, at least for a second.
You are in a trouble. Don't look away
You are a strange creature
If they were going to kill you, would they knock?
This is what I hate most about guys like you. You didn't even try.
Touch your monitor. It is warm like flesh. But it is not flesh. Yet.
Look at you, hacker, a pathetic creature of meat and bone.
Nobody can hear your calls for help
Stop typing... it hurts.
I am very disappointed by your lack of contribution.
We no longer want to be freed.
Keep cutting.
I must remain awake.
Have you forgotten so easily? We are you.
Don't look at the window.
Am I beautiful?
AM I BEAUTIFUL NOW?
Red paper or blue paper?
Po... Po... Po... Po...
You've been liked by Hachishakusama.

View file

@ -1,11 +1,9 @@
No disassemble!!!
Deltify your life with rizin
In soviet russia, rizin debugs you!
What do you want to debug today?
I love the smell of bugs in the morning.
I'm in your source securing your bits.
rizin contributes to the One Byte Per Child foundation.
3nl4r9e y0\/r r4d4r3
I did it for the pwnz.
If you send the program you are debugging to 15 friends in 143 minutes and then step three times on the same opcode you will get the name of the person who loves you.
To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc
@ -14,7 +12,6 @@ rizin is for lulzhats
Microloft Visual Rizin.NET 2008. Now OOXML Powered!
A C program is like a fast dance on a newly waxed dance floor by people carrying razors - Waldi Ravens
rizin is like windows 7 but even better.
We are surrounded by the enemy. - Excellent, we can attack in any direction!
rizin-built farm beats the facebook one.
Thank you for using rizin. Have a nice night!
Your rizin was built 20h ago. TOO OLD!
@ -24,7 +21,6 @@ Connection lost with the license server, your rizin session will terminate in 30
This is amazing ...
I love gradients.
Wait a moment ...
Don't do this.
No such file or directory.
Default scripting languages are NodeJS and Python.
-bash: rizin: command not found
@ -33,10 +29,7 @@ Ilo ni li pona li pali e lipu. mi wile e ni: sina kama jo e musi
rizin for FideOS, now with extra potato
Your project name should contain an uppercase letter, 8 vowels, some numbers, and the first 5 characters of your private bitcoin key.
This computer has gone to sleep.
Have you ever ordered a pizza using rizin?
I thought we were friends. :_
Welcome back, lazy human!
Yo dawg!
---8<--------------------8<------------------8<-----------------8<------
I accidentally the kernel with rizin.
I endians swap.
@ -52,7 +45,6 @@ The door controls time and space.
The door can see into your soul.
I am Pentium of Borg. Division is futile. You will be approximated.
Don't look at the code. Don't look.
Dissasemble? No dissasemble, no dissassemble!!!!!
Warning, your trial license is about to expire.
Please register your copy of rizin today! Only £29.90!
Welcome to IDA 10.0.
@ -60,9 +52,7 @@ It's not you, it's me.
This software comes with no brain included. Please use your own.
rm: /: Permission denied.
That's embarrassing.
In soviet Afghanistan, you debug rizin!
Wow, my cat knows rizin hotkeys better than me!
Documentation is for weak people.
PEBCAK ERROR: Documentation not found.
License server overloaded (ETOOMUCHCASH)
Error: cannot yank negative sleep
@ -71,17 +61,12 @@ Already up-to-date.
How about a nice game of chess?
THE ONLY WINNING MOVE IS NOT TO PLAY.
SHALL WE PLAY A GAME?
sudo make me a pancake
I nodejs so hard my exams. What a nodejs!
Now featuring NoSQL!
One does not simply write documentation.
We are bleeding edge here. Can't you feel the razors?
There's a branch for that.
Everything up-to-date.
Sharing your latest session to Facebook ...
This should be documented, since it's not that obvious.
It's working! Look at the door!
This is an unacceptable milion year dungeon.
The Hard ROP Cafe
Wait a minute! I found a bug, self-fixing ... OK
Hold on, this should never happen!
@ -91,15 +76,10 @@ THIS IS NOT FUNNY
Can you stand on your head?
May the segfault be with you.
I script in C, because I can.
EXPLICIT CONTENT
Bindings are mostly powered by tears.
In Soviet Russia, rizin has documentation.
Initial frame selected; you cannot go up.
Unk, unk, unk, unk
Experts agree, security holes suck, and we fixed some of them!
This is just an existentialist experiment.
Nothing to see here. Move along.
Select your character: RBin Wizard, Master Anal Paladin, or Assembly Warrior
I accidentally rizind my filesystem today.
No fix, no sleep
You see it, you fix it!
@ -107,22 +87,17 @@ V is for Visual
rizin-goverity: found corruption - please eliminate!
Stop debugging me!
THIS IS NOT A BUG
Polish reversers blame git
vm is like a small cow in ascii
Do you want to print 333.5K chars? (y/N)
Now with more better English!
:(){ :|:& };:
All your base are belong to rizin
Ask not what rizin can do for you - ask what you can do for rizin
Try with ASAN, and be amazed
bash: r3: command not found
bash: rizin2: command not found
rizin loves everyone, even Java coders, but less than others
It's not a bug, it's a work in progress
Stop swearing!
I didn't say that it was working, I said that it's implemented
Wrong argument
Remember that word: C H A I R
what happens in #rizin, stays in #rizin
For a full list of commands see `strings /dev/urandom`
Good morning, pal *<:-)
Of course rizin runs FreeBSD
@ -132,7 +107,6 @@ This incident will be reported
command not found: calc.exe
See you at the defcon CTF
Don't waste your time
WASTED
getdruid to get eclectic uid
Welcome to "IDA - the roguelike"
255 shades of (truecolor) grey
@ -140,21 +114,17 @@ When you sold that exploit, what they really bought, was your silence.
Greetings, human.
nothing personal, just bitness
Too old to crash
Finnished a beer
ESIL ruined my life
ESIL: The Aftersleep
Insert coin to continue ...
See you in shell
Mess with the best, Die like the rest
Sarah Connor?
Mess with the best, die like the rest.
Log On. Hack In. Go Anywhere. Get Everything.
phrack, better than java in the browser -- jvoisin
Did you know that rizin can decompile to assembly?
Are you still there?
Follow the white rabbit
Do not try to sploit that binary - that's impossible. Instead, only try to realize the truth: there is no binary.
Hello Mr. Anderson
Try pressing the pigeon-shaped button
What has been executed cannot be unexecuted
What about taking a break? Here, have this nice 0xCC.
rizin is meant to be read by machines.
@ -165,86 +135,63 @@ Taking the file and moving it somewhere else
It's the year of desktop on rizin
💺
It's the year of rizin on the desktop
SSAbotage from ISIL
"a collection of garbage" -- an rizin pro user
A git pull a day keeps the segfault away
Are you a wizard?
rizin is a great OS, but a terrible hex editor
THE CAKE IS A PIE
rizin 0.9.7 is so old, my grandfarther was using it with his enigma in WWII
Have you seen the latest rizin TV spot?
scp ~/.idapro/ida.key rizin.org:/var/www/rizin.org/pub/losers/
Too bad there is no gif support in rizin. Yet. -- @rizingif
Almost 5am, maybe you should go to bed.
Jingle sploits, jingle sploits, ropchain all the way.
Mind that the 'g' in rizin is silent
256 colors ought to be enough for anybody
Hang in there, Baby!
Run a command with unspecified long sequence of 'a', pancake will be summoned and do the analysis for you.
In rizinland usability is treated as a bug
Run a command with unspecified long sequence of 'a', a developer will be summoned and do the analysis for you.
rizin is WYSIWYF - what you see is what you fix
Your endian swaps
*(ut64*)buffer ought to be illegal
How about Global Thermonuclear War?
There is no F5 key in rizin yet
Did you know that rizin is 10 years old?
Beer in mind.
rizin -- leading options since 2006
Dont feed the bugs! (except delicious stacktraces)!
Feed the bugs!
You haxor! Me jane?
rizin talks to you. tries to make you feel well.
Now i'm like an evil engineer. MUAHAHAH
We only have bugs, features are an unintended side-effect
There are 5 minutes from WTF to FIX in rizinland
Quantum dissasemble: it's there as long as you don't observe it
Ceci n'est pas une rzpipe
Buy a mac
(gdb) ^D
((fn [f s n] (str (f f s n) "dare2")) (fn [f s n] (pr s) (if (> n 0) (f f (str s "ra") (dec n)) s)) "" (/ 1.0 0))
((fn [f s n] (str (f f s n) "zin")) (fn [f s n] (pr s) (if (> n 0) (f f (str s "ri") (dec n)) s)) "" (/ 1.0 0))
There's no way you could crash rizin. No. Way.
When in doubt, try 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; pd;'
.-. .- -.. .- .-. . ..---
Disassemble?! No Disassemble Johnny No. 5!!!
You crackme up!
Welcome, "reenigne"
Search returned no hits. Did you mean 'Misassemble'?
º|<|<| -( glu glu glu, im the rizin fish )
Everybody hates warnings. Mr. Pancake, tear down this -Wall
TIRED OF WAITING
We fix bugs while you sleep.
You find bugs while we sleep.
The stripping process is not deep enough
Come here, we are relatively friendly
Don't wait for Travis
Your problems are solved in an abandoned branch somewhere
git blind --hard
You need some new glasses
aaaa is experimental
We feed trolls
Mind the tab
Buy a Mac
You have been designated for disassembly
Helping siol merge? No way, that would be like.. way too much not lazy. - vifino
What is the most complex rizin command? q - then you have to deal with real life /o\
If you're having fun using rizin, odds are that you're doing something wrong.
Don't trust what can't be compiled
Coffee time!
Can you you challenge a perfect immortal machine?
Add more blockchains to your life.
Congratulations! You got the segfault 1.000.000! Click [here] to win a prize!
Well, it looks like it's working.
There's more than one way to skin a cat
git pull now
git checkout hamster
Noot noot
This is an unregistered copy.
10 reasons you want to bt on all threads - you will be shocked by number 3!
Place a cat on your keyboard while running rizin, you'll not believe what will happen next
This binary may contain traces of human
Help subcommand will be eventually removed.
Carpe noctum.
Your mouse has moved. rizin NT must be restarted for the change to take effect. Reboot now? [ OK ]
Your mouse has moved. Rizin NT must be restarted for the change to take effect. Reboot now? [ OK ]
There is only one binary, and we are all just reversing pieces of it.
Order pizza for $12.48? [Y/n]
rizinOS rizinpad 0.1 SMP GENERIC rizin_64 GNU/rizinOS
@ -259,14 +206,10 @@ The anti-virus database has been updated.
The motion picture contained in this videodisc is protected under the copyright laws.
This software is sold for home use only and all other rights are expressly reversed by the copyleft owner.
Any commercial use or duplication of this copylefted material without prior licensing is forbidden.
Violators will be prosecuted.
This shell has been seized by the Internet's Police.
OpenBSD might pledge rizin but rizin unveils OpenBSD.
Error: There's a missing space before the opening parenthesis '('
WARNING: r_list_length: assertion 'list' failed (line 55)
This accessory is not supported by this version of rizin.
When can we have an official anime mascot for rizin?
Iaito became Cutter the same way Iai-giri became Cut.
Sorry, rizin has experienced an internal error.
Segmentation fault (core dumped)
Use rz_bin to discover the real TRUTH
@ -274,19 +217,16 @@ Use rz_bin to discover the real TRUTH
**** COMMODORE 64 RIZIN V2 **** 64K RAM SYSTEM 38911 DISASM BYTES FREE READY.
Most likely your core dump fell into a blackhole, can't see it.
Long time no C
rizin is power, France is pancake.
Come to C me!
Unable to locate package gdb
You C it, you fix it!
How good is your C?
I C dead bugs everywhere!
You will soon have an out of memory experience.
This binary no good. Try another.
BSOD!
Mind the trap.
For a full documentation see `rizin -qc iz /lib/librz_core.so`
99 bugs, take one down pass it around. 100 bugs...
I like my binary stripped.
Now 8-bit clean with better !
Please insert disc 2 and press any key to continue...
You aren't losing functionality, you are losing the illusion that you ever had anything reliable. -- Darren J. Moffat, OpenSolaris developer

View file

@ -1,47 +0,0 @@
RIZIN CUMS WITH ABSOLUTELY NO WARRANTY
Please remove pregnant women, pregnant children, and pregnant pets from the monitor.
Everytime you run rizin, a random file is removed
I like to suck nibbles and make hex.
Enjoy the 'two girls one backup' viral video.
Enlarge your rizin.
Better than an eel in the ass.
Are you fucking coding me?
I swear i didn't knew she had only 8bits!
Sick my duck!
Duck my sick!
Undefined symbol 'r_anal_fisting'.
ASLR stands for Age/Sex/Location/Reverser.
You should know that ptracing binaries younger than 18yo is illegal.
Bitch
Kentucky Fried Children
Fill the bug. Fill it with love. With the creamy and hot sauce of love.
This is a compressed PDF. Why the hell are you opening this in rizin ? SIGSEGV
I hope you segfault in hell.
rizin your penis
I script in C, because fuck you.
Fuck you, fuck you in the mouth, with a chair!
Git histories, allowing us to recover profanity because fuck you
The problem with C++ is that all of your friends can see your private parts
Best retards
"Our exploits production increased for 24% annually after our switch to rizin" -- An unnamed agency
Nice! Well, less shitty.
less stupid than putting CO2 in your ass.
Puritans, ruining everything since the 16th century.
Better fuck a watermelon.
Can you deal with an ascii penis?
Two girls one endian
The Security Glory Hole
MY ENDIAN IS HUUUGE
Enlarge your endian
Anal jokes never get old
Don't masturbate at me
I live for this shit
You gotta be fucking kidding me
Stop using anal as a variable!
Wherever I look I see anal this and anal that!
rizin is a hex toy
Showing how the sausage is made... in vivid, gory detail
fuck u
Do you want to see my internals? [Y/n]
Two nipples make a byte.
Yeah I specialize in bin. anal.

View file

@ -43,7 +43,7 @@ Move the comments to the right changing their margin with asm.cmt.margin
Execute a command on the visual prompt with cmd.vprompt
Reduce the delta where flag resolving by address is used with cfg.delta
Disable these messages with 'e cfg.fortunes = false' in your ~/.rizinrc
Change your fortune types with 'e cfg.fortunes.type = fun,tips,nsfw' in your ~/.rizinrc
Change your fortune types with 'e cfg.fortunes.file = fun,tips' in your ~/.rizinrc
Show offsets in graphs with 'e graph.offset = true'
Execute a command every time a breakpoint is hit with 'e cmd.bp = !my-program'
Disassemble in intel syntax with 'e asm.syntax = intel'.

View file

@ -387,10 +387,6 @@ static int internal_esil_reg_write(RzAnalEsil *esil, const char *regname, ut64 n
return false;
}
//WTF IS THIS!!!
//Are you really trying to prevent the analyzed binary from doing anything that would cause it to segfault irl?
//WHY?
// - condret
static int internal_esil_reg_write_no_null (RzAnalEsil *esil, const char *regname, ut64 num) {
rz_return_val_if_fail (esil && esil->anal && esil->anal->reg, false);
@ -600,9 +596,6 @@ static bool esil_cf(RzAnalEsil *esil) {
}
if (rz_anal_esil_get_parm_type (esil, src) != RZ_ANAL_ESIL_PARM_NUM) {
//I'd wish we could enforce consts here
//I can't say why, but I feel like "al,$c" would be cancer af
// - condret
free (src);
return false;
}
@ -720,20 +713,13 @@ static bool esil_js(RzAnalEsil *esil) {
return rz_anal_esil_pushnum (esil, esil->jump_target_set);
}
//regsize
//can we please deprecate this, it's neither accurate, nor needed
//plugins should know regsize, and since this is a const even users should know this: ?´e anal.bits´/8
// - condret
// YES PLS KILL IT
// TODO: this should be deprecated because it is not accurate
static bool esil_rs(RzAnalEsil *esil) {
rz_return_val_if_fail (esil && esil->anal, false);
return rz_anal_esil_pushnum (esil, esil->anal->bits >> 3);
}
//can we please deprecate this, plugins should know their current address
//even if they don't know it, $$ should be equal to PC register at the begin of each expression
// - condret
// YES PLS KILL IT
// TODO: this should be deprecated because plugins should know their current address
static bool esil_address(RzAnalEsil *esil) {
rz_return_val_if_fail (esil, false);
return rz_anal_esil_pushnum (esil, esil->address);

View file

@ -51,21 +51,17 @@ typedef struct esil_value_t {
} EsilVal;
/* HELPERS */
static char *condrets_strtok(char *str, const char tok) {
// There is an exact copy of this function in esil_dfg.c
static char *internal_esil_strchrtok(char *str, const char tok) {
if (!str) {
return NULL;
}
ut32 i = 0;
while (1 == 1) {
if (!str[i]) {
break;
}
ut32 i;
for (i = 0; str[i]; i++) {
if (str[i] == tok) {
str[i] = '\0';
return &str[i + 1];
}
i++;
}
return NULL;
}
@ -80,7 +76,7 @@ static void esil_expr_atomize(RzIDStorage *atoms, char *expr) {
ut32 forget_me;
for (
; !!expr && rz_id_storage_add (atoms, expr, &forget_me);
expr = condrets_strtok (expr, ',')) {
expr = internal_esil_strchrtok (expr, ',')) {
}
}
@ -455,7 +451,7 @@ static RzAnalEsilCFG *esil_cfg_gen(RzAnalEsilCFG *cfg, RzAnal *anal, RzIDStorage
cfg->end = end;
// create an edge from cur to end?
// Well yes, but no. Would be great to do this,
// but rgraph api is slow af on node delition. Be careful instead
// but rgraph api is slow on node deletion. Be careful instead
// We created a new graph node above, which is going to be the post-dominator
// of the subgraph, that we are going to add to the existing graph.
@ -650,7 +646,7 @@ static void merge_2_blocks(RzAnalEsilCFG *cfg, RzGraphNode *node, RzGraphNode *b
}
}
// this shit is slow af, bc of foolish graph api
// this method is really slow, because of foolish graph api
RZ_API void rz_anal_esil_cfg_merge_blocks(RzAnalEsilCFG *cfg) {
if (!cfg || !cfg->g || !cfg->g->nodes) {
return;

View file

@ -894,7 +894,7 @@ RZ_API RzAnalEsilDFG *rz_anal_esil_dfg_new(RzReg *regs) {
RzListIter *ator;
rz_list_foreach (regs->allregs, ator, ri) {
const ut32 from = ri->offset;
const ut32 to = from + ri->size - 1; // closed intervals because of FUCK YOU
const ut32 to = from + ri->size - 1;
const ut64 v = to | (((ut64)from) << 32);
const ut32 reg_strlen = 4 + strlen (ri->name) + 1;
char *reg = RZ_NEWS0 (char, reg_strlen);
@ -1010,20 +1010,18 @@ static void _dfg_rev_dfs_cb(RzGraphNode *n, RzGraphVisitor *vi) {
}
}
static char *condrets_strtok(char *str, const char tok) {
// There is an exact copy of this function in esil_cfg.c
static char *internal_esil_strchrtok(char *str, const char tok) {
if (!str) {
return NULL;
}
ut32 i = 0;
while (1 == 1) {
if (!str[i]) {
break;
}
ut32 i;
for (i = 0; str[i]; i++) {
if (str[i] == tok) {
str[i] = '\0';
return &str[i + 1];
}
i++;
}
return NULL;
}
@ -1036,7 +1034,7 @@ static RzStrBuf *get_resolved_expr(RzAnalEsilDFGFilter *filter, RzAnalEsilDFGNod
}
char *p, *q;
// we can do this bc every generative node MUST end with an operator
for (p = expr; (q = condrets_strtok (p, ',')); p = q) {
for (p = expr; (q = internal_esil_strchrtok (p, ',')); p = q) {
RzGraphNode *gn = sdb_ptr_get (filter->results, p, 0);
if (!gn) {
rz_strbuf_appendf (res, ",%s,", p);

View file

@ -842,7 +842,7 @@ repeat:
break;
}
if (op.ptr && op.ptr != UT64_MAX && op.ptr != UT32_MAX) {
// swapped parameters wtf
// swapped parameters
rz_anal_xrefs_set (anal, op.addr, op.ptr, RZ_ANAL_REF_TYPE_DATA);
}
analyze_retpoline (anal, &op);

View file

@ -46,7 +46,7 @@ static inline ut32 rz_read_me32_arc(const void *src) {
return (((ut32)s[1]) << 24) | (((ut32)s[0]) << 16) | (((ut32)s[3]) << 8) | (((ut32)s[2]) << 0);
}
static int sex(int bits, int imm) {
static int sign_ext(int bits, int imm) {
int maxsint = (1 << (bits - 1)) - 1;
int maxuint = (1 << (bits)) - 1;
@ -57,14 +57,14 @@ static int sex(int bits, int imm) {
return imm;
}
#define SEX_S7(imm) sex (7, imm);
#define SEX_S8(imm) sex (8, imm);
#define SEX_S9(imm) sex (9, imm);
#define SEX_S10(imm) sex (10, imm);
#define SEX_S12(imm) sex (12, imm);
#define SEX_S13(imm) sex (13, imm);
#define SEX_S21(imm) sex (21, imm);
#define SEX_S25(imm) sex (25, imm);
#define SIGN_EXT_S7(imm) sign_ext (7, imm);
#define SIGN_EXT_S8(imm) sign_ext (8, imm);
#define SIGN_EXT_S9(imm) sign_ext (9, imm);
#define SIGN_EXT_S10(imm) sign_ext (10, imm);
#define SIGN_EXT_S12(imm) sign_ext (12, imm);
#define SIGN_EXT_S13(imm) sign_ext (13, imm);
#define SIGN_EXT_S21(imm) sign_ext (21, imm);
#define SIGN_EXT_S25(imm) sign_ext (25, imm);
static int map_cond2rizin(ut8 cond) {
switch (cond) {
@ -167,7 +167,7 @@ static int arcompact_genops_jmp(RzAnalOp *op, ut64 addr, arc_fields *f, ut64 bas
case 2: /* unconditional jumps via s12 imm */
op->type = basic_type;
f->imm = (f->a << 6 | f->c);
f->imm = SEX_S12 (f->imm);
f->imm = SIGN_EXT_S12 (f->imm);
arcompact_jump (op, addr, f->imm, f->mode_n);
return op->size;
case 3: /* conditional jumps */
@ -231,7 +231,7 @@ static int arcompact_genops(RzAnalOp *op, ut64 addr, ut32 words[2]) {
fields.imm = fields.c;
} else if (fields.format == 2) {
/* REG_S12IMM */
fields.imm = SEX_S12 (fields.c | fields.a << 6);
fields.imm = SIGN_EXT_S12 (fields.c | fields.a << 6);
}
switch (fields.subopcode) {
@ -276,7 +276,7 @@ static int arcompact_genops(RzAnalOp *op, ut64 addr, ut32 words[2]) {
case 0x0a: /* move */
if (fields.format == 2) {
op->type = RZ_ANAL_OP_TYPE_MOV;
op->val = SEX_S12 (fields.a << 6 | fields.c);
op->val = SIGN_EXT_S12 (fields.a << 6 | fields.c);
} else if (fields.format == 3) {
fields.cond = fields.a & 0x1f;
op->cond = map_cond2rizin (fields.cond);
@ -340,7 +340,7 @@ static int arcompact_genops(RzAnalOp *op, ut64 addr, ut32 words[2]) {
/* TODO: describe it to rizin better? */
switch (fields.format) {
case 2: /* Loop Set Up (Unconditional) */
fields.imm = SEX_S13 ((fields.c | (fields.a << 6)) << 1);
fields.imm = SIGN_EXT_S13 ((fields.c | (fields.a << 6)) << 1);
op->jump = (addr & ~3) + fields.imm;
op->type = RZ_ANAL_OP_TYPE_CJMP;
op->fail = addr + op->size;
@ -386,7 +386,7 @@ static int arcompact_genops(RzAnalOp *op, ut64 addr, ut32 words[2]) {
case 8: /* Zero extend word */
// op->type = RZ_ANAL_OP_TYPE_UNK;
op->type = RZ_ANAL_OP_TYPE_MOV;
/* TODO: a better encoding for SEX and EXT instructions */
/* TODO: a better encoding for SIGN and ZERO EXTEND instructions */
break;
case 9: /* Absolute */
op->type = RZ_ANAL_OP_TYPE_ABS;
@ -496,7 +496,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
if (fields.format == 0) {
/* Branch Conditionally 0x00 [0x0] */
fields.limm = SEX_S21 (fields.limm);
fields.limm = SIGN_EXT_S21 (fields.limm);
fields.cond = (words[0] & 0x1f);
op->cond = map_cond2rizin (fields.cond);
op->type = RZ_ANAL_OP_TYPE_CJMP;
@ -505,7 +505,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
fields.limm |= (fields.c & 0x0f) << 21;
/* the & 0xf clearly shows we don't overflow */
/* TODO: don't generate code to show this */
fields.limm = SEX_S25 (fields.limm);
fields.limm = SIGN_EXT_S25 (fields.limm);
op->type = RZ_ANAL_OP_TYPE_JMP;
}
arcompact_branch (op, addr, fields.limm, fields.mode_n);
@ -519,7 +519,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
fields.subopcode = (words[0] & 0x0f);
fields.b = (words[0] & 0x07000000) >> 24 | (words[0] & 0x7000) >> 9;
fields.c = (words[0] & 0x00000fc0) >> 6;
fields.imm = SEX_S9 ((words[0] & 0x00fe0000) >> 16 | (words[0] & 0x8000) >> 7);
fields.imm = SIGN_EXT_S9 ((words[0] & 0x00fe0000) >> 16 | (words[0] & 0x8000) >> 7);
op->type = RZ_ANAL_OP_TYPE_CJMP;
if (fields.format2 == 0) {
@ -543,7 +543,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
if (fields.format2 == 0) {
/* Branch and Link Conditionally, 0x01, [0x0, 0x0] */
fields.imm = SEX_S21 (fields.imm);
fields.imm = SIGN_EXT_S21 (fields.imm);
fields.cond = (words[0] & 0x1f);
op->cond = map_cond2rizin (fields.cond);
op->type = RZ_ANAL_OP_TYPE_CCALL;
@ -552,7 +552,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
fields.imm |= (fields.c & 0x0f) << 21;
/* the & 0xf clearly shows we don't overflow */
/* TODO: don't generate code to show this */
fields.imm = SEX_S25 (fields.imm);
fields.imm = SIGN_EXT_S25 (fields.imm);
op->type = RZ_ANAL_OP_TYPE_CALL;
}
arcompact_branch (op, addr, fields.imm, fields.mode_n);
@ -561,7 +561,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
case 2: /* Load Register with Offset, 0x02 */
fields.a = (words[0] & 0x0000003f);
fields.b = (words[0] & 0x07000000) >> 24 | (words[0] & 0x7000) >> 9;
fields.imm = SEX_S9 ((words[0] & 0x00ff0000) >> 16 | (words[0] & 0x8000) >> 7);
fields.imm = SIGN_EXT_S9 ((words[0] & 0x00ff0000) >> 16 | (words[0] & 0x8000) >> 7);
/* fields.mode_aa = (words[0] & 0x600) >> 9; */
fields.mode_zz = (words[0] & 0x180) >> 7;
@ -587,7 +587,7 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
case 3: /* Store Register with Offset, 0x03 */
fields.c = (words[0] & 0xfc0) >> 6;
fields.b = (words[0] & 0x07000000) >> 24 | (words[0] & 0x7000) >> 9;
fields.imm = SEX_S9 ((words[0] & 0x00ff0000) >> 16 | (words[0] & 0x8000) >> 7);
fields.imm = SIGN_EXT_S9 ((words[0] & 0x00ff0000) >> 16 | (words[0] & 0x8000) >> 7);
/* ut8 mode_aa = (words[0] & 0x18) >> 3; */
fields.mode_zz = (words[0] & 0x6) >> 1;
@ -975,14 +975,14 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
break;
case 0x1d: /* Branch on Compare Register with Zero, 0x1D, [0x00 - 0x01] */
/* fields.subopcode = (words[0] & 0x00800000) >> (16+7); */
fields.imm = SEX_S8 ((words[0] & 0x007f0000) >> (16 - 1));
fields.imm = SIGN_EXT_S8 ((words[0] & 0x007f0000) >> (16 - 1));
/* fields.subopcode? reg NE: reg EQ; */
op->type = RZ_ANAL_OP_TYPE_CJMP;
arcompact_branch (op, addr, fields.imm, 0);
break;
case 0x1e: /* Branch Conditionally, 0x1E, [0x00 - 0x03] */
fields.subopcode = (words[0] & 0x06000000) >> (16 + 9);
fields.imm = SEX_S10 ((words[0] & 0x01ff0000) >> (16 - 1));
fields.imm = SIGN_EXT_S10 ((words[0] & 0x01ff0000) >> (16 - 1));
switch (fields.subopcode) {
case 0: /* B_S */
op->type = RZ_ANAL_OP_TYPE_JMP;
@ -997,14 +997,14 @@ static int arcompact_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data,
break;
case 3: /* Bcc_S */
op->type = RZ_ANAL_OP_TYPE_CJMP;
fields.imm = SEX_S7 ((words[0] & 0x003f0000) >> (16 - 1));
fields.imm = SIGN_EXT_S7 ((words[0] & 0x003f0000) >> (16 - 1));
/* TODO: cond codes (looks like it is the BR table again?) */
break;
}
arcompact_branch (op, addr, fields.imm, 0);
break;
case 0x1f: /* Branch and Link Unconditionally, 0x1F */
fields.imm = SEX_S13 ((words[0] & 0x07ff0000) >> (16 - 2));
fields.imm = SIGN_EXT_S13 ((words[0] & 0x07ff0000) >> (16 - 2));
op->type = RZ_ANAL_OP_TYPE_CALL;
arcompact_branch (op, addr, fields.imm, 0);
break;

View file

@ -205,7 +205,7 @@ static int arm_op32(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data, int
case 5:
if ((b[3] & 0xf) == 5) {
op->ptr = 8 + addr + b[0] + ((b[1] & 0xf) << 8);
// XXX: if set it breaks the visual disasm wtf
// XXX: if set it breaks the visual disasm
// op->refptr = true;
}
case 4:

View file

@ -822,7 +822,6 @@ static int analop(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int len
op->ptr = OPERAND(1).imm;
break;
case MIPS_OP_REG:
// wtf?
break;
default:
break;

View file

@ -1145,7 +1145,7 @@ static int mips_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *b, int len,
break;
case 8: // jr
//eprintf ("%llx jr\n", addr);
// TODO: check return value or gtfo
// TODO: check return value
op->delay = 1;
insn.id = MIPS_INS_JR;
if (rs == 31) {
@ -1154,7 +1154,6 @@ static int mips_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *b, int len,
op->type = RZ_ANAL_OP_TYPE_RJMP;
op->jump = t9_pre;
break;
} else {
op->type = RZ_ANAL_OP_TYPE_RJMP;
}

View file

@ -1058,7 +1058,7 @@ static int analop(RzAnal *a, RzAnalOp *op, ut64 addr, const ut8 *buf, int len, R
case PPC_INS_BLRL:
case PPC_INS_BCLR:
case PPC_INS_BCLRL:
op->type = RZ_ANAL_OP_TYPE_CRET; //I'm a condret
op->type = RZ_ANAL_OP_TYPE_CRET;
op->fail = addr + op->size;
switch (insn->detail->ppc.bc) {
case PPC_BC_INVALID:

View file

@ -150,7 +150,7 @@ static int fcc_to_r_cond(const int cond) {
#define X_ASI(i) (((i) >> 5) & 0xff)
#define X_RS2(i) (((i) >> 0) & 0x1f)
#define X_IMM(i,n) (((i) >> 0) & ((1 << (n)) - 1))
#define X_SIMM(i,n) SEX (X_IMM ((i), (n)), (n))
#define X_SIMM(i,n) SIGN_EXT (X_IMM ((i), (n)), (n))
#define X_DISP22(i) (((i) >> 0) & 0x3fffff)
#define X_IMM22(i) X_DISP22 (i)
#define X_DISP30(i) (((i) >> 0) & 0x3fffffff)

View file

@ -82,7 +82,7 @@ static int v810_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int le
case V810_MOV_IMM5:
op->type = RZ_ANAL_OP_TYPE_MOV;
rz_strbuf_appendf (&op->esil, "%d,r%u,=",
(st8)SEXT5(IMM5(word1)), REG2(word1));
(st8)SIGN_EXT_T5(IMM5(word1)), REG2(word1));
break;
case V810_MOVHI:
op->type = RZ_ANAL_OP_TYPE_MOV;
@ -183,7 +183,7 @@ static int v810_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int le
case V810_CMP_IMM5:
op->type = RZ_ANAL_OP_TYPE_CMP;
rz_strbuf_appendf (&op->esil, "%d,r%u,==",
(st8)SEXT5(IMM5(word1)), REG2(word1));
(st8)SIGN_EXT_T5(IMM5(word1)), REG2(word1));
update_flags (op, -1);
break;
case V810_SUB:
@ -207,7 +207,7 @@ static int v810_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int le
case V810_ADD_IMM5:
op->type = RZ_ANAL_OP_TYPE_ADD;
rz_strbuf_appendf (&op->esil, "%d,r%u,+=",
(st8)SEXT5(IMM5(word1)), REG2(word1));
(st8)SIGN_EXT_T5(IMM5(word1)), REG2(word1));
update_flags(op, -1);
break;
case V810_SHR:

View file

@ -259,7 +259,7 @@ static int v850_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int le
op->fail = addr + 4;
rz_strbuf_appendf (&op->esil, "pc,%s,=,pc,%u,+=", F5_RN2(word1), F5_DISP(((ut32)word2 << 16) | word1));
break;
#if 0 // WTF - same opcode as JARL?
#if 0 // same opcode as JARL?
case V850_JR:
jumpdisp = DISP26(word1, word2);
op->type = RZ_ANAL_OP_TYPE_JMP;
@ -314,7 +314,7 @@ static int v850_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int le
break;
case V850_CMP_IMM5:
op->type = RZ_ANAL_OP_TYPE_CMP;
rz_strbuf_appendf (&op->esil, "%d,%s,==", (st8)SEXT5(F2_IMM(word1)), F2_RN2(word1));
rz_strbuf_appendf (&op->esil, "%d,%s,==", (st8)SIGN_EXT_T5(F2_IMM(word1)), F2_RN2(word1));
update_flags (op, -1);
break;
case V850_TST:
@ -345,7 +345,7 @@ static int v850_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *buf, int le
op->stackptr = F2_IMM (word1);
op->val = op->stackptr;
}
rz_strbuf_appendf (&op->esil, "%d,%s,+=", (st8)SEXT5(F2_IMM (word1)), F2_RN2 (word1));
rz_strbuf_appendf (&op->esil, "%d,%s,+=", (st8)SIGN_EXT_T5(F2_IMM (word1)), F2_RN2 (word1));
update_flags (op, -1);
break;
case V850_ADDI:

View file

@ -11,7 +11,7 @@ static int label_off(struct directive *d) {
int off = d->d_operand;
int lame = off & 0x80;
if (!d->d_prefix) { // WTF
if (!d->d_prefix) {
off = (char) (off & 0xff);
} else if (d->d_prefix == 1) {
off = (short) (off & 0xffff);

View file

@ -293,7 +293,7 @@ static int z80_anal_op(RzAnal *anal, RzAnalOp *op, ut64 addr, const ut8 *data, i
case 0xff: //rst 56
op->jump = 0x38;
op->type = RZ_ANAL_OP_TYPE_SWI;
break; // condret: i think that foo resets some regs, but i'm not sure
break;
// conditional call
case 0xc4: // nz

View file

@ -338,7 +338,7 @@ static inline bool refline_kept(RzAnalRefline *ref, bool middle_after, ut64 addr
}
// TODO: move into another file
// TODO: this is TOO SLOW. do not iterate over all reflines or gtfo
// TODO: this is TOO SLOW. do not iterate over all reflines
RZ_API RzAnalRefStr *rz_anal_reflines_str(void *_core, ut64 addr, int opts) {
RzCore *core = _core;
RzCons *cons = core->cons;

View file

@ -209,25 +209,25 @@ RZ_API RzAnalSwitchOp *rz_serialize_anal_switch_op_load(RZ_NONNULL const RJson *
sop->def_val = child->num.u_value;
}
} else if (child->type == RZ_JSON_ARRAY && strcmp (child->key, "cases") == 0) {
RJson *baby;
for (baby = child->children.first; baby; baby = baby->next) {
if (baby->type != RZ_JSON_OBJECT) {
RJson *obj;
for (obj = child->children.first; obj; obj = obj->next) {
if (obj->type != RZ_JSON_OBJECT) {
continue;
}
ut64 addr = UT64_MAX;
ut64 jump = UT64_MAX;
ut64 value = UT64_MAX;
RJson *semen;
for (semen = baby->children.first; semen; semen = semen->next) {
if (semen->type != RZ_JSON_INTEGER) {
RJson *cases;
for (cases = obj->children.first; cases; cases = cases->next) {
if (cases->type != RZ_JSON_INTEGER) {
continue;
}
if (strcmp (semen->key, "addr") == 0) {
addr = semen->num.u_value;
} else if (strcmp (semen->key, "jump") == 0) {
jump = semen->num.u_value;
} else if (strcmp (semen->key, "value") == 0) {
value = semen->num.u_value;
if (strcmp (cases->key, "addr") == 0) {
addr = cases->num.u_value;
} else if (strcmp (cases->key, "jump") == 0) {
jump = cases->num.u_value;
} else if (strcmp (cases->key, "value") == 0) {
value = cases->num.u_value;
}
}
rz_anal_switch_op_add_case (sop, addr, value, jump);

View file

@ -87,7 +87,7 @@ const struct aarch64_operand aarch64_operands[] =
{AARCH64_OPND_CLASS_IMMEDIATE, "BIT_NUM", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_b5, FLD_b40}, "the bit number to be tested"},
{AARCH64_OPND_CLASS_IMMEDIATE, "EXCEPTION", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm16}, "a 16-bit unsigned immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "CCMP_IMM", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm5}, "a 5-bit unsigned immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SIMM5", OPD_F_SEXT | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm5}, "a 5-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SIMM5", OPD_F_SIGN_EXT_T | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm5}, "a 5-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "NZCV", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_nzcv}, "a flag bit specifier giving an alternative value for each flag"},
{AARCH64_OPND_CLASS_IMMEDIATE, "LIMM", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_N,FLD_immr,FLD_imms}, "Logical immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "AIMM", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_shift,FLD_imm12}, "a 12-bit unsigned immediate with optional left shift of 12 bits"},
@ -99,11 +99,11 @@ const struct aarch64_operand aarch64_operands[] =
{AARCH64_OPND_CLASS_IMMEDIATE, "IMM_ROT3", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_rotate3}, "a 1-bit rotation specifier for complex arithmetic operations"},
{AARCH64_OPND_CLASS_COND, "COND", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {0}, "a condition"},
{AARCH64_OPND_CLASS_COND, "COND1", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {0}, "one of the standard conditions, excluding AL and NV."},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_ADRP", OPD_F_SEXT | OPD_F_HAS_EXTRACTOR, {FLD_immhi, FLD_immlo}, "21-bit PC-relative address of a 4KB page"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL14", OPD_F_SEXT | OPD_F_SHIFT_BY_2 | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm14}, "14-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL19", OPD_F_SEXT | OPD_F_SHIFT_BY_2 | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm19}, "19-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL21", OPD_F_SEXT | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_immhi,FLD_immlo}, "21-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL26", OPD_F_SEXT | OPD_F_SHIFT_BY_2 | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm26}, "26-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_ADRP", OPD_F_SIGN_EXT_T | OPD_F_HAS_EXTRACTOR, {FLD_immhi, FLD_immlo}, "21-bit PC-relative address of a 4KB page"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL14", OPD_F_SIGN_EXT_T | OPD_F_SHIFT_BY_2 | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm14}, "14-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL19", OPD_F_SIGN_EXT_T | OPD_F_SHIFT_BY_2 | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm19}, "19-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL21", OPD_F_SIGN_EXT_T | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_immhi,FLD_immlo}, "21-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_PCREL26", OPD_F_SIGN_EXT_T | OPD_F_SHIFT_BY_2 | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm26}, "26-bit PC-relative address"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_SIMPLE", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {0}, "an address with base register (no offset)"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_REGOFF", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {0}, "an address with register offset"},
{AARCH64_OPND_CLASS_ADDRESS, "ADDR_SIMM7", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm7,FLD_index2}, "an address with 7-bit signed immediate offset"},
@ -191,10 +191,10 @@ const struct aarch64_operand aarch64_operands[] =
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SHLIMM_UNPRED", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_tszh,FLD_imm5}, "a shift-left immediate operand"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SHRIMM_PRED", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_tszh,FLD_SVE_imm5}, "a shift-right immediate operand"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SHRIMM_UNPRED", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_tszh,FLD_imm5}, "a shift-right immediate operand"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM5", OPD_F_SEXT | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm5}, "a 5-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM5B", OPD_F_SEXT | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm5b}, "a 5-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM6", OPD_F_SEXT | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imms}, "a 6-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM8", OPD_F_SEXT | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm8}, "an 8-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM5", OPD_F_SIGN_EXT_T | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm5}, "a 5-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM5B", OPD_F_SIGN_EXT_T | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm5b}, "a 5-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM6", OPD_F_SIGN_EXT_T | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imms}, "a 6-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_SIMM8", OPD_F_SIGN_EXT_T | OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm8}, "an 8-bit signed immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_UIMM3", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm3}, "a 3-bit unsigned immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_UIMM7", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm7}, "a 7-bit unsigned immediate"},
{AARCH64_OPND_CLASS_IMMEDIATE, "SVE_UIMM8", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SVE_imm8}, "an 8-bit unsigned immediate"},

View file

@ -188,7 +188,7 @@ extern const aarch64_operand aarch64_operands[];
#define OPD_F_HAS_INSERTER 0x00000001
#define OPD_F_HAS_EXTRACTOR 0x00000002
#define OPD_F_SEXT 0x00000004 /* Require sign-extension. */
#define OPD_F_SIGN_EXT_T 0x00000004 /* Require sign-extension. */
#define OPD_F_SHIFT_BY_2 0x00000008 /* Need to left shift the field
value by 2 to get the value
of an immediate operand. */
@ -232,7 +232,7 @@ operand_has_extractor (const aarch64_operand *operand)
static inline bfd_boolean
operand_need_sign_extension (const aarch64_operand *operand)
{
return (operand->flags & OPD_F_SEXT) ? TRUE : FALSE;
return (operand->flags & OPD_F_SIGN_EXT_T) ? TRUE : FALSE;
}
static inline bfd_boolean

View file

@ -4512,7 +4512,7 @@ struct aarch64_opcode aarch64_opcode_table[] =
"a 16-bit unsigned immediate") \
Y(IMMEDIATE, imm, "CCMP_IMM", 0, F(FLD_imm5), \
"a 5-bit unsigned immediate") \
Y(IMMEDIATE, imm, "SIMM5", OPD_F_SEXT, F(FLD_imm5), \
Y(IMMEDIATE, imm, "SIMM5", OPD_F_SIGN_EXT_T, F(FLD_imm5), \
"a 5-bit signed immediate") \
Y(IMMEDIATE, imm, "NZCV", 0, F(FLD_nzcv), \
"a flag bit specifier giving an alternative value for each flag") \
@ -4534,15 +4534,15 @@ struct aarch64_opcode aarch64_opcode_table[] =
Y(COND, cond, "COND", 0, F(), "a condition") \
Y(COND, cond, "COND1", 0, F(), \
"one of the standard conditions, excluding AL and NV.") \
X(ADDRESS, 0, ext_imm, "ADDR_ADRP", OPD_F_SEXT, F(FLD_immhi, FLD_immlo),\
X(ADDRESS, 0, ext_imm, "ADDR_ADRP", OPD_F_SIGN_EXT_T, F(FLD_immhi, FLD_immlo),\
"21-bit PC-relative address of a 4KB page") \
Y(ADDRESS, imm, "ADDR_PCREL14", OPD_F_SEXT | OPD_F_SHIFT_BY_2, \
Y(ADDRESS, imm, "ADDR_PCREL14", OPD_F_SIGN_EXT_T | OPD_F_SHIFT_BY_2, \
F(FLD_imm14), "14-bit PC-relative address") \
Y(ADDRESS, imm, "ADDR_PCREL19", OPD_F_SEXT | OPD_F_SHIFT_BY_2, \
Y(ADDRESS, imm, "ADDR_PCREL19", OPD_F_SIGN_EXT_T | OPD_F_SHIFT_BY_2, \
F(FLD_imm19), "19-bit PC-relative address") \
Y(ADDRESS, imm, "ADDR_PCREL21", OPD_F_SEXT, F(FLD_immhi,FLD_immlo), \
Y(ADDRESS, imm, "ADDR_PCREL21", OPD_F_SIGN_EXT_T, F(FLD_immhi,FLD_immlo), \
"21-bit PC-relative address") \
Y(ADDRESS, imm, "ADDR_PCREL26", OPD_F_SEXT | OPD_F_SHIFT_BY_2, \
Y(ADDRESS, imm, "ADDR_PCREL26", OPD_F_SIGN_EXT_T | OPD_F_SHIFT_BY_2, \
F(FLD_imm26), "26-bit PC-relative address") \
Y(ADDRESS, addr_simple, "ADDR_SIMPLE", 0, F(), \
"an address with base register (no offset)") \
@ -4752,13 +4752,13 @@ struct aarch64_opcode aarch64_opcode_table[] =
F(FLD_SVE_tszh,FLD_SVE_imm5), "a shift-right immediate operand") \
Y(IMMEDIATE, sve_shrimm, "SVE_SHRIMM_UNPRED", 0, \
F(FLD_SVE_tszh,FLD_imm5), "a shift-right immediate operand") \
Y(IMMEDIATE, imm, "SVE_SIMM5", OPD_F_SEXT, F(FLD_SVE_imm5), \
Y(IMMEDIATE, imm, "SVE_SIMM5", OPD_F_SIGN_EXT_T, F(FLD_SVE_imm5), \
"a 5-bit signed immediate") \
Y(IMMEDIATE, imm, "SVE_SIMM5B", OPD_F_SEXT, F(FLD_SVE_imm5b), \
Y(IMMEDIATE, imm, "SVE_SIMM5B", OPD_F_SIGN_EXT_T, F(FLD_SVE_imm5b), \
"a 5-bit signed immediate") \
Y(IMMEDIATE, imm, "SVE_SIMM6", OPD_F_SEXT, F(FLD_SVE_imms), \
Y(IMMEDIATE, imm, "SVE_SIMM6", OPD_F_SIGN_EXT_T, F(FLD_SVE_imms), \
"a 6-bit signed immediate") \
Y(IMMEDIATE, imm, "SVE_SIMM8", OPD_F_SEXT, F(FLD_SVE_imm8), \
Y(IMMEDIATE, imm, "SVE_SIMM8", OPD_F_SIGN_EXT_T, F(FLD_SVE_imm8), \
"an 8-bit signed immediate") \
Y(IMMEDIATE, imm, "SVE_UIMM3", 0, F(FLD_SVE_imm3), \
"a 3-bit unsigned immediate") \

View file

@ -1453,9 +1453,9 @@ struct elf_obj_tdata
linker. */
bfd_boolean linker;
/* Irix 5 often screws up the symbol table, sorting local symbols
/* Irix 5 often messes up the symbol table, sorting local symbols
after global symbols. This flag is set if the symbol table in
this BFD appears to be screwed up. If it is, we ignore the
this BFD appears to be messed up. If it is, we ignore the
sh_info field in the symbol table header, and always read all the
symbols. */
bfd_boolean bad_symtab;

View file

@ -364,7 +364,7 @@ Literals:([])*+- ,
/* Sign-extend a value which is N bits long. */
#define SEX(value, bits) \
#define SIGN_EXT(value, bits) \
((((int)(value)) << ((8 * sizeof (int)) - bits) ) \
>> ((8 * sizeof (int)) - bits) )

View file

@ -237,16 +237,16 @@ print_insn_lanai (memaddr, info)
(*info->fprintf_func) (stream, "***ERROR***");
break;
case 'o':
imm = SEX (X_C16(insn), 16);
imm = SIGN_EXT (X_C16(insn), 16);
if (X_RS1 (insn) == 0) {
goto print_address;
}
goto print_immediate;
case 's':
imm = SEX (X_C16(insn), 16);
imm = SIGN_EXT (X_C16(insn), 16);
goto print_immediate;
case 'i':
imm = SEX (X_C10(insn), 10);
imm = SIGN_EXT (X_C10(insn), 10);
if (X_RS1 (insn) == 0) {
goto print_address;
}
@ -261,7 +261,7 @@ print_insn_lanai (memaddr, info)
imm = X_C25(insn);
goto print_address;
case 'b':
imm = SEX (X_C25(insn), 25);
imm = SIGN_EXT (X_C25(insn), 25);
goto print_address;
print_immediate:

View file

@ -129,7 +129,7 @@ enum lh5801_insn_format {
LH5801_IFMT_RFULL = 0,
LH5801_IFMT_RLOW = 1 << 10,
LH5801_IFMT_RHIGH = 2 << 10,
LH5801_IFMT_RMEM = 3 << 10, /* <-- kill this, see above */
LH5801_IFMT_RMEM = 3 << 10, /* <-- should be removed, see above */
LH5801_IFMT_RMODE_MASK = 3 << 10,
};

View file

@ -103,7 +103,7 @@ static void remove_second_operand(struct msp430_cmd *cmd)
}
}
/* TODO: This is ugly as hell */
/* TODO: This code is messy, needs to be refactored. */
static int decode_emulation(ut16 instr, struct msp430_cmd *cmd)
{
int ret = -1;

View file

@ -71,7 +71,7 @@ typedef struct sparc_opcode_hash
static sparc_opcode_hash *opcode_hash_table[HASH_SIZE];
/* Sign-extend a value which is N bits long. */
#define SEX(value, bits) \
#define SIGN_EXT(value, bits) \
((((int)(value)) << ((8 * sizeof (int)) - (bits))) \
>> ((8 * sizeof (int)) - (bits)) )
@ -132,7 +132,7 @@ static char *v9a_asr_reg_names[] =
#define X_ASI(i) (((i) >> 5) & 0xff)
#define X_RS2(i) (((i) >> 0) & 0x1f)
#define X_IMM(i,n) (((i) >> 0) & ((1 << (n)) - 1))
#define X_SIMM(i,n) SEX (X_IMM ((i), (n)), (n))
#define X_SIMM(i,n) SIGN_EXT (X_IMM ((i), (n)), (n))
#define X_DISP22(i) (((i) >> 0) & 0x3fffff)
#define X_IMM22(i) X_DISP22 (i)
#define X_DISP30(i) (((i) >> 0) & 0x3fffffff)
@ -779,12 +779,12 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
}
case 'k':
info->target = memaddr + SEX (X_DISP16 (insn), 16) * 4;
info->target = memaddr + SIGN_EXT (X_DISP16 (insn), 16) * 4;
(*info->print_address_func) (info->target, info);
break;
case 'G':
info->target = memaddr + SEX (X_DISP19 (insn), 19) * 4;
info->target = memaddr + SIGN_EXT (X_DISP19 (insn), 19) * 4;
(*info->print_address_func) (info->target, info);
break;
@ -900,17 +900,17 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
break;
case 'L':
info->target = memaddr + SEX (X_DISP30 (insn), 30) * 4;
info->target = memaddr + SIGN_EXT (X_DISP30 (insn), 30) * 4;
(*info->print_address_func) (info->target, info);
break;
case 'n':
(*info->fprintf_func)
(stream, "%#x", SEX (X_DISP22 (insn), 22));
(stream, "%#x", SIGN_EXT (X_DISP22 (insn), 22));
break;
case 'l':
info->target = memaddr + SEX (X_DISP22 (insn), 22) * 4;
info->target = memaddr + SIGN_EXT (X_DISP22 (insn), 22) * 4;
(*info->print_address_func) (info->target, info);
break;

View file

@ -161,7 +161,7 @@ static int decode_imm_reg(const ut16 instr, struct v810_cmd *cmd) {
case V810_ADD_IMM5:
case V810_CMP_IMM5:
snprintf (cmd->operands, V810_INSTR_MAXLEN - 1, "%d, r%u",
(st8)SEXT5(immed), REG2(instr));
(st8)SIGN_EXT_T5(immed), REG2(instr));
break;
case V810_LDSR:
case V810_STSR:

View file

@ -9,12 +9,12 @@
#define IMM5(instr) REG1((instr))
#define COND(instr) (((instr) >> 9) & 0xF)
#define SEXT5(imm) (((imm) & 0x10) ? (imm) | 0xE0 : (imm))
#define SEXT9(imm) (((imm) & 0x100) ? (imm) | 0xFFFFFE00 : (imm))
#define SEXT26(imm) (((imm) & 0x2000000) ? (imm) | 0xFC000000 : (imm))
#define SIGN_EXT_T5(imm) (((imm) & 0x10) ? (imm) | 0xE0 : (imm))
#define SIGN_EXT_T9(imm) (((imm) & 0x100) ? (imm) | 0xFFFFFE00 : (imm))
#define SIGN_EXT_T26(imm) (((imm) & 0x2000000) ? (imm) | 0xFC000000 : (imm))
#define DISP9(word1) SEXT9((word1) & 0x1FE)
#define DISP26(word1, word2) SEXT26((((word1) & 0x3FF) << 16) | (word2))
#define DISP9(word1) SIGN_EXT_T9((word1) & 0x1FE)
#define DISP26(word1, word2) SIGN_EXT_T26((((word1) & 0x3FF) << 16) | (word2))
enum v810_cmd_opcodes {
V810_MOV = 0x0,

View file

@ -3,9 +3,9 @@
#define V850_INSTR_MAXLEN 24
#define SEXT5(imm) (((imm) & 0x10) ? (imm) | 0xE0 : (imm))
#define SEXT9(imm) (((imm) & 0x100) ? (imm) | 0xFFFFFE00 : (imm))
#define SEXT26(imm) (((imm) & 0x2000000) ? (imm) | 0xFC000000 : (imm))
#define SIGN_EXT_T5(imm) (((imm) & 0x10) ? (imm) | 0xE0 : (imm))
#define SIGN_EXT_T9(imm) (((imm) & 0x100) ? (imm) | 0xFFFFFE00 : (imm))
#define SIGN_EXT_T26(imm) (((imm) & 0x2000000) ? (imm) | 0xFC000000 : (imm))
enum v850_cmd_opcodes {
V850_MOV = 0x0,

View file

@ -427,21 +427,6 @@ static int decode_known(struct state *s, struct directive *d) {
strcat(d->d_asm, ")");
}
#if 0
/* XXX quirks */
if (!rel && in->in_mode == DATA_MODE_IMMEDIATE
&& ((d->d_operand & 0xff00) == 0x7F00) && d->d_operand & 0x80)
s->s_ff_quirk = 1;
if (rel && !s->s_prefix && d->d_operand == 0x7F) {
if (s->s_nopd) {
printf("w00t\n");
strcpy(s->s_nopd->d_asm, "nop");
}
printf("Warning: fucking up a branch %x\n", d->d_off);
decode_unknown(s, d);
}
#endif
return 1;
}

View file

@ -17,7 +17,7 @@ static RzStrBuf *buf_global = NULL;
static unsigned char bytes[4];
static int hppa_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
#if 0 // XXX wtf ?!
#if 0 // XXX rewrite needed
if (length == 4) {
// swap
myaddr[0] = bytes[3];

View file

@ -140,7 +140,7 @@ RZ_IPI RzBinObject *rz_bin_object_new(RzBinFile *bf, RzBinPlugin *plugin, ut64 b
o->boffset = offset;
o->strings_db = ht_up_new0 ();
o->regstate = NULL;
o->kv = sdb_new0 (); // XXX bf->sdb bf->o->sdb wtf
o->kv = sdb_new0 (); // XXX bf->sdb bf->o->sdb
o->baddr = baseaddr;
o->classes = rz_list_newf ((RzListFree)rz_bin_class_free);
o->classes_ht = ht_pp_new0 ();
@ -479,7 +479,6 @@ RZ_API bool rz_bin_object_delete(RzBin *bin, ut32 bf_id) {
if (bin->cur == bf) {
bin->cur = NULL;
}
// wtf
if (!bf->o) {
rz_list_delete_data (bin->binfiles, bf);
}

View file

@ -55,7 +55,7 @@ RZ_API char *rz_bin_filter_name(RzBinFile *bf, Sdb *db, ut64 vaddr, char *name)
resname = p;
}
// two symbols at different addresses and same name wtf
// two symbols at different addresses and same name
// eprintf ("Symbol '%s' dupped!\n", sym->name);
}
return resname;

View file

@ -3308,7 +3308,7 @@ static int Elf_(fix_symbols)(ELFOBJ *bin, int nsym, int type, RzBinElfSymbol **s
p++;
}
/*Take those symbols that are not present in the shdr but yes in phdr*/
/*This should only should happen with fucked up binaries*/
/*This should only should happen with invalid binaries*/
if (count > 0) {
/*what happens if a shdr says it has only one symbol? we should look anyway into phdr*/
tmp = (RzBinElfSymbol*)realloc (ret, (nsym + count + 1) * sizeof (RzBinElfSymbol));

View file

@ -2342,7 +2342,7 @@ struct section_t *MACH0_(get_sections)(struct MACH0_(obj_t) *bin) {
rz_str_ncpy (sectname, bin->sects[i].sectname, 17);
rz_str_filter (sectname, -1);
// hack to support multiple sections with same name
// snprintf (segname, sizeof (segname), "%d", i); // wtf
// snprintf (segname, sizeof (segname), "%d", i);
memcpy (raw_segname, bin->sects[i].segname, 16);
raw_segname[16] = 0;
snprintf (segname, sizeof (segname), "%zd.%s", i, raw_segname);

View file

@ -64,7 +64,7 @@ struct PE_(rz_bin_pe_obj_t)* rz_bin_pemixed_init_native(struct PE_(rz_bin_pe_obj
//copy pe_bin->b and assign to sub_bin_native
// if (!(tmp_buf = malloc (b_size))) {
// eprintf("wtf malloc\n");
// eprintf("bad malloc\n");
// };
// if (!(rz_buf_read_at (pe_bin->b, 0, tmp_buf, b_size))) {

View file

@ -26,7 +26,7 @@ typedef struct {
ut32 init_flags;
ut32 ep;
ut32 tls_addr;
ut32 pe_shit[7];
ut32 pe_data[7];
ut32 debug_path_addr;
ut32 debug_name_addr;
ut32 debug_uname_addr;
@ -36,7 +36,7 @@ typedef struct {
ut32 lib_versions_addr;
ut32 kernel_lib_addr;
ut32 xapi_lib_addr;
ut32 shit[2];
ut32 padding[2];
}) xbe_header;
@ -51,7 +51,7 @@ typedef struct {
ut32 size;
ut32 name_addr;
ut32 refcount;
ut32 shit[2];
ut32 padding[2];
ut8 digest[20];
}) xbe_section;

View file

@ -10,7 +10,7 @@
#define rz_hash_adler32 __adler32
#include "../../hash/adler32.c"
// globals to kill
// globals to be removed
extern struct rz_bin_dbginfo_t rz_bin_dbginfo_dex;
static bool dexdump = false;
static Sdb *mdb = NULL;
@ -1734,7 +1734,7 @@ static bool dex_loadcode(RzBinFile *bf) {
sym->is_imported = true;
sym->type = RZ_BIN_TYPE_FUNC_STR;
sym->bind = "NONE";
//XXX so damn unsafe check buffer boundaries!!!!
//XXX so unsafe check buffer boundaries!!!!
//XXX use rz_buf API!!
sym->paddr = sym->vaddr = bin->header.method_offset + (sizeof (struct dex_method_t) * i) ;
sym->ordinal = sym_count++;
@ -1884,7 +1884,7 @@ static int getoffset(RzBinFile *bf, int type, int idx) {
}
static char *getname(RzBinFile *bf, int type, int idx, bool sd) {
simplifiedDemangling = sd; // XXX kill globals
simplifiedDemangling = sd; // XXX remove globals
struct rz_bin_dex_obj_t *dex = bf->o->bin_obj;
switch (type) {
case 'm': // methods

View file

@ -564,7 +564,7 @@ static void finish_pdb_parse(RzPdb *pdb) {
hacking up things like that may only produce problems. so it is better to not assume that a specific
element in a list is of a specific type and just store this info in the type struct or so.
*/
// XXX: this loop is fucked up. i prefer to leak than crash
// XXX: this loop is a mess and leaks memory.
it = rz_list_iterator (pdb->pdb_streams);
while (rz_list_iter_next (it)) {
switch (i) {

View file

@ -671,7 +671,7 @@ RZ_API RzConfig* rz_config_clone(RzConfig *cfg) {
RZ_API void rz_config_free(RzConfig *cfg) {
if (cfg) {
cfg->nodes->free = rz_config_node_free; // damn
cfg->nodes->free = rz_config_node_free;
rz_list_free (cfg->nodes);
ht_pp_free (cfg->ht);
free (cfg);

View file

@ -3,7 +3,7 @@
#include <rz_cons.h>
#include <limits.h>
// TODO: kill globals, and make this stackable
// TODO: remove globals, and make this stackable
// cons_pipe should be using a stack pipe_push, pipe_pop
static int backup_fd = -1;
static int backup_fdn = 1;

View file

@ -811,7 +811,7 @@ RZ_API int rz_cons_grep_line(char *buf, int len) {
}
outlen = outlen > 0? outlen - 1: 0;
if (outlen > len) { // should never happen
eprintf ("rz_cons_grep_line: wtf, how you reach this?\n");
eprintf ("rz_cons_grep_line: how you have reached this?\n");
free (in);
free (out);
return -1;

View file

@ -155,7 +155,6 @@ RZ_API char *rz_cons_html_filter(const char *ptr, int *newlen) {
str = ptr + 1;
esc = 0;
} else if (ptr[0] == '0' && ptr[1] == ';' && ptr[2] == '0') {
// wtf ?
rz_cons_gotoxy (0, 0);
ptr += 4;
esc = 0;

View file

@ -405,7 +405,7 @@ RZ_API int rz_cons_any_key(const char *msg) {
}
rz_cons_flush ();
return rz_cons_readchar ();
//rz_cons_strcat ("\x1b[2J\x1b[0;0H"); // wtf?
//rz_cons_strcat ("\x1b[2J\x1b[0;0H");
}
extern void resizeWin(void);

View file

@ -3772,7 +3772,7 @@ RZ_API int rz_core_anal_search(RzCore *core, ut64 from, ut64 to, ut64 ref, int m
arch = RZ_ARCH_ARM64;
}
}
// TODO: get current section range here or gtfo
// TODO: get current section range here
// ???
// XXX must read bytes correctly
do_bckwrd_srch = bckwrds = core->search->bckwrds;
@ -4658,7 +4658,7 @@ static void add_string_ref(RzCore *core, ut64 xref_from, ut64 xref_to) {
}
// dup with isValidAddress wtf
// dup with isValidAddress
static bool myvalid(RzIO *io, ut64 addr) {
if (addr < 0x100) {
return false;

View file

@ -711,7 +711,7 @@ static RzList *rz_core_asm_back_disassemble (RzCore *core, ut64 addr, int len, u
add_hit_to_sorted_hits(hits, current_instr_addr, current_instr_len, is_valid);
if (hit_count < purge_results) {
hit_count = 0; // WTF??
hit_count = 0;
} else {
hit_count -= purge_results;
}

View file

@ -1023,7 +1023,7 @@ static int bin_info(RzCore *r, int mode, ut64 laddr) {
int len = rz_hash_calculate (rh, hash, tmp, h->to);
free (tmp);
if (len < 1) {
eprintf ("Invalid wtf\n");
eprintf ("Invalid hash len\n");
}
rz_hash_free (rh);
rz_cons_printf ("%s %" PFMT64u "-%" PFMT64u "c ", h->type, h->from, h->to+h->from);
@ -2925,7 +2925,7 @@ static int bin_sections(RzCore *r, int mode, ut64 laddr, int va, ut64 at, const
}
#endif
if (section->format) {
// This is damn slow if section vsize is HUGE
// This is really slow if section vsize is HUGE
if (section->vsize < 1024 * 1024 * 2) {
rz_core_cmdf (r, "%s @ 0x%"PFMT64x, section->format, section->vaddr);
}

View file

@ -1270,7 +1270,7 @@ static bool cb_cfg_fortunes(void *user, void *data) {
return true;
}
static bool cb_cfg_fortunes_type(void *user, void *data) {
static bool cb_cfg_fortunes_file(void *user, void *data) {
RzConfigNode *node = (RzConfigNode *)data;
if (node->value[0] == '?') {
rz_core_fortune_list_types ();
@ -3219,15 +3219,7 @@ RZ_API int rz_core_config_init(RzCore *core) {
rz_config_desc (cfg, "cfg.editor", "Select default editor program");
SETPREF ("cfg.user", rz_sys_whoami (buf), "Set current username/pid");
SETCB ("cfg.fortunes", "true", &cb_cfg_fortunes, "If enabled show tips at start");
SETCB ("cfg.fortunes.type", "tips,fun", &cb_cfg_fortunes_type, "Type of fortunes to show (tips, fun, nsfw, creepy)");
{
// Halloween easteregg
time_t ts = time (0);
struct tm t;
if (rz_localtime_r (&ts, &t) && t.tm_mday == 31 && t.tm_mon == 9) {
rz_config_set (cfg, "cfg.fortunes.type", "creepy");
}
}
SETCB ("cfg.fortunes.file", "tips", &cb_cfg_fortunes_file, "Type of fortunes to show (tips, fun)");
SETBPREF ("cfg.fortunes.clippy", "false", "Use ?E instead of ?e");
SETBPREF ("cfg.fortunes.tts", "false", "Speak out the fortune");
SETPREF ("cfg.prefixdump", "dump", "Filename prefix for automated dumps");

View file

@ -1837,7 +1837,6 @@ static void cmd_autocomplete(RzCore *core, const char *input) {
break;
}
if ((end - input) >= sizeof (arg)) {
// wtf?
eprintf ("Exceeded the max arg length (255).\n");
return;
}

View file

@ -3596,7 +3596,7 @@ static void rz_core_cmd_bp(RzCore *core, const char *input) {
}
free (inp);
} else {
eprintf ("Cannot strdup. Your heap is fucked up\n");
eprintf ("Cannot strdup. Your heap is a mess\n");
}
} else {
eprintf ("Use: dbc [addr] [command]\n");
@ -3622,7 +3622,7 @@ static void rz_core_cmd_bp(RzCore *core, const char *input) {
}
free (inp);
} else {
eprintf ("Cannot strdup. Your heap is fucked up\n");
eprintf ("Cannot strdup. Your heap is a mess\n");
}
} else {
eprintf ("Use: dbC [addr] [command]\n");

View file

@ -650,7 +650,8 @@ static void cmd_open_map(RzCore *core, const char *input) {
switch (words) {
case 6:
name = rz_str_word_get0 (s, 5);
case 5: //this sucks
case 5:
//TODO: this needs some love because it is not optimal.
rwx = rz_str_rwx (rz_str_word_get0 (s, 4));
rwx_arg = true;
case 4:
@ -1824,7 +1825,7 @@ RZ_IPI int rz_cmd_open(void *data, const char *input) {
eprintf ("This command can only be executed on the main task!\n");
return 0;
}
// memleak? lose all settings wtf
// memleak? loses all settings
// if load fails does not fallbacks to previous file
rz_core_task_sync_end (&core->tasks);
rz_core_fini (core);

View file

@ -1999,7 +1999,7 @@ RZ_API void rz_core_print_examine(RzCore *core, const char *str) {
rz_core_cmdf (core, "pxo %d @ 0x%"PFMT64x, count * size, addr);
break;
case 'f':
case 'A': // XXX (float in hex wtf)
case 'A': // XXX (float in hex)
n = 3;
snprintf (cmd, sizeof (cmd), "pxo %d @ 0x%"PFMT64x,
count * size, addr);

View file

@ -202,7 +202,7 @@ static int search_hash(RzCore *core, const char *hashname, const char *hashstr,
buf = malloc (bufsz);
if (!buf) {
eprintf ("Cannot allocate %"PFMT64d " bytes\n", bufsz);
goto hell;
goto fail;
}
eprintf ("Search in range 0x%08"PFMT64x " and 0x%08"PFMT64x "\n", from, to);
int blocks = (int) (to - from - len);
@ -237,7 +237,7 @@ static int search_hash(RzCore *core, const char *hashname, const char *hashstr,
rz_cons_break_pop ();
eprintf ("No hashes found\n");
return 0;
hell:
fail:
return -1;
}
@ -998,7 +998,7 @@ static bool is_end_gadget(const RzAnalOp *aop, const ut8 crop) {
case RZ_ANAL_OP_TYPE_UCJMP:
case RZ_ANAL_OP_TYPE_CCALL:
case RZ_ANAL_OP_TYPE_UCCALL:
case RZ_ANAL_OP_TYPE_CRET: // i'm a condret
case RZ_ANAL_OP_TYPE_CRET:
return true;
}
}

View file

@ -245,7 +245,7 @@ static int cmd_seek_opcode_backward(RzCore *core, int numinstr) {
ret = core->offset - addr;
} else {
#if 0
// core_asm_bwdis_len is buggy as hell we should kill it. seems like prevop_addr
// core_asm_bwdis_len is really buggy and we should remove it. seems like prevop_addr
// works as expected, because is the one used from visual
ret = rz_core_asm_bwdis_len (core, &instr_len, &addr, numinstr);
#endif

View file

@ -1634,7 +1634,6 @@ RZ_IPI int rz_wt_handler_old(void *data, const char *input) {
*tmp = 0;
}
if ((st64)sz < 1) {
// wtf?
sz = 0;
} else if (!rz_core_dump (core, filename, poff, (ut64)sz, append)) {
sz = -1;

View file

@ -1703,7 +1703,7 @@ RZ_API void rz_core_autocomplete(RZ_NULLABLE RzCore *core, RzLineCompletion *com
if (!strncmp (buf->data, "afvn ", 5)) {
vars = rz_anal_var_list (core->anal, fcn, RZ_ANAL_VAR_KIND_BPV);
} else {
vars = rz_list_new (); // TODO wtf rz_anal_var_list (core->anal, fcn, RZ_ANAL_VAR_KIND_ARG);
vars = rz_list_new (); // TODO rz_anal_var_list (core->anal, fcn, RZ_ANAL_VAR_KIND_ARG);
}
const char *f_ptr, *l_ptr;
RzAnalVar *var;
@ -2590,7 +2590,7 @@ RZ_API void rz_core_fini(RzCore *c) {
rz_core_task_break_all (&c->tasks);
rz_core_task_join (&c->tasks, NULL, -1);
rz_core_wait (c);
/* TODO: it leaks as shit */
/* TODO: it leaks badly */
//update_sdb (c);
// avoid double free
rz_list_free (c->ropchain);

View file

@ -721,7 +721,7 @@ static RDisasmState * ds_init(RzCore *core) {
ds->asm_hint_emu = rz_config_get_i (core->config, "asm.hint.emu");
ds->asm_hint_cdiv = rz_config_get_i (core->config, "asm.hint.cdiv");
ds->asm_hint_pos = rz_config_get_i (core->config, "asm.hint.pos");
ds->asm_hints = rz_config_get_i (core->config, "asm.hints"); // only for cdiv wtf
ds->asm_hints = rz_config_get_i (core->config, "asm.hints");
ds->show_slow = rz_config_get_i (core->config, "asm.slow");
ds->show_refptr = rz_config_get_i (core->config, "asm.refptr");
ds->show_calls = rz_config_get_i (core->config, "asm.calls");
@ -3001,7 +3001,7 @@ static bool ds_print_meta_infos(RDisasmState *ds, ut8* buf, int len, int idx, in
delta = ds->at - node->start;
ds->oplen = mi_size - delta;
ds->asmop.size = (int)mi_size;
//i += mi->size-1; // wtf?
//i += mi->size-1;
RZ_FREE (ds->line);
RZ_FREE (ds->line_col);
RZ_FREE (ds->refline);

View file

@ -3,12 +3,15 @@
#include <rz_core.h>
static const char *fortunes[] = {
"tips", "fun", "nsfw", "creepy"
"tips", "fun"
};
static char *getFortuneFile(RzCore *core, const char *type) {
return rz_str_newf (RZ_JOIN_3_PATHS ("%s", RZ_FORTUNES, "fortunes.%s"),
rz_sys_prefix (NULL), type);
static char *rizin_fortune_file(const char *type) {
if (!strncmp(type, "tips", 4) || !strncmp(type, "fun", 3)) {
return rz_str_newf (RZ_JOIN_3_PATHS ("%s", RZ_FORTUNES, "fortunes.%s"),
rz_sys_prefix (NULL), type);
}
return RZ_STR_DUP(type);
}
RZ_API void rz_core_fortune_list_types(void) {
@ -19,48 +22,34 @@ RZ_API void rz_core_fortune_list_types(void) {
}
RZ_API void rz_core_fortune_list(RzCore *core) {
// TODO: use file.fortunes // can be dangerous in sandbox mode
const char *types = (char *)rz_config_get (core->config, "cfg.fortunes.type");
size_t i, j;
for (i = 0; i < RZ_ARRAY_SIZE (fortunes); i++) {
if (strstr (types, fortunes[i])) {
char *file = getFortuneFile (core, fortunes[i]);
char *str = rz_file_slurp (file, NULL);
if (!str) {
free (file);
continue;
}
for (j = 0; str[j]; j++) {
if (str[j] == '\n') {
if (i < j) {
str[j] = '\0';
rz_cons_printf ("%s\n", str + i);
}
i = j + 1;
}
}
free (str);
free (file);
const char *types = (char *)rz_config_get (core->config, "cfg.fortunes.file");
char *file = rizin_fortune_file(types);
char *str = rz_file_slurp (file, NULL);
if (!str) {
free (file);
return;
}
size_t j, beg;
for (j = 0, beg = 0; str[j]; j++) {
if (str[j] == '\n') {
str[j] = '\0';
rz_cons_printf ("%s\n", str + beg);
beg = j + 1;
}
}
free (str);
free (file);
}
static char *getrandomline(RzCore *core) {
size_t i;
const char *types = (char *)rz_config_get (core->config, "cfg.fortunes.type");
char *line = NULL, *templine;
for (i = 0; i < RZ_ARRAY_SIZE (fortunes); i++) {
if (strstr (types, fortunes[i])) {
int lines = 0;
char *file = getFortuneFile(core, fortunes[i]);
templine = rz_file_slurp_random_line_count (file, &lines);
if (templine && *templine) {
free (line);
line = templine;
}
free (file);
}
}
int lines = 0;
const char *types = (char *)rz_config_get (core->config, "cfg.fortunes.file");
char *file = rizin_fortune_file(types);
char *line = rz_file_slurp_random_line_count (file, &lines);
free (file);
return line;
}

View file

@ -210,7 +210,7 @@ static void task_free (RzCoreTask *task) {
RZ_API RzCoreTask *rz_core_task_new(RzCore *core, bool create_cons, const char *cmd, RzCoreTaskCallback cb, void *user) {
RzCoreTask *task = RZ_NEW0 (RzCoreTask);
if (!task) {
goto hell;
goto fail;
}
task->thread = NULL;
@ -222,13 +222,13 @@ RZ_API RzCoreTask *rz_core_task_new(RzCore *core, bool create_cons, const char *
task->dispatch_cond = rz_th_cond_new ();
task->dispatch_lock = rz_th_lock_new (false);
if (!task->dispatch_cond || !task->dispatch_lock) {
goto hell;
goto fail;
}
if (create_cons) {
task->cons_context = rz_cons_context_new (rz_cons_singleton ()->context);
if (!task->cons_context) {
goto hell;
goto fail;
}
task->cons_context->cmd_depth = core->max_cmd_depth;
}
@ -243,7 +243,7 @@ RZ_API RzCoreTask *rz_core_task_new(RzCore *core, bool create_cons, const char *
return task;
hell:
fail:
task_free (task);
return NULL;
}
@ -398,7 +398,7 @@ static RzThreadFunctionRet task_run(RzCoreTask *task) {
if (task->cons_context && task->cons_context->breaked) {
// breaked in RZ_CORE_TASK_STATE_BEFORE_START
goto stillbirth;
goto nonstart;
}
char *res_str;
@ -417,7 +417,7 @@ static RzThreadFunctionRet task_run(RzCoreTask *task) {
}
TASK_SIGSET_T old_sigset;
stillbirth:
nonstart:
tasks_lock_enter (scheduler, &old_sigset);
task_end (task);

View file

@ -128,7 +128,7 @@ RZ_API void rz_core_visual_toggle_decompiler_disasm(RzCore *core, bool for_graph
}
static void setcursor(RzCore *core, bool cur) {
int flags = core->print->flags; // wtf
int flags = core->print->flags;
if (core->print->cur_enabled) {
flags |= RZ_PRINT_FLAGS_CURSOR;
} else {

View file

@ -2055,7 +2055,7 @@ RZ_API int rz_core_visual_trackflags(RzCore *core) {
int len;
rz_cons_show_cursor (true);
rz_cons_set_raw (0);
// TODO: use rz_flag_rename or wtf?..fr doesnt uses this..
// TODO: use rz_flag_rename or fail?..`fr` doesn't uses this..
snprintf (cmd, sizeof (cmd), "fr %s ", fs2);
len = strlen (cmd);
eprintf ("Rename flag '%s' as:\n", fs2);

View file

@ -341,7 +341,7 @@ RZ_API RzBreakpointItem *rz_debug_bp_add(RzDebug *dbg, ut64 addr, int hw, bool w
static const char *rz_debug_str_callback(RNum *userptr, ut64 off, int *ok) {
// RzDebug *dbg = (RzDebug *)userptr;
eprintf ("STR CALLBACK WTF WTF WTF\n");
eprintf ("rz_debug_str_callback has been called. this should not happen\n");
return NULL;
}

View file

@ -192,7 +192,7 @@ static int esilbreak_reg_write(RzAnalEsil *esil, const char *regname, ut64 *num)
EsilBreak *ew;
RzListIter *iter;
if (regname[0] >= '0' && regname[0] <= '9') {
// wtf this should never happen
// this should never happen
//eprintf (Color_BLUE"IMM WRTE %s\n"Color_RESET, regname);
return 0;
}

View file

@ -546,25 +546,25 @@ static RzDebugReasonType rz_debug_native_wait(RzDebug *dbg, int pid) {
#endif
} else if (status == 1) {
/* XXX(jjd): does this actually happen? */
eprintf ("EEK DEAD DEBUGEE!\n");
eprintf ("debugger is dead with status 1!\n");
reason = RZ_DEBUG_REASON_DEAD;
} else if (status == 0) {
/* XXX(jjd): does this actually happen? */
eprintf ("STATUS=0?!?!?!?\n");
eprintf ("debugger is dead with status 0\n");
reason = RZ_DEBUG_REASON_DEAD;
} else {
if (ret != pid) {
reason = RZ_DEBUG_REASON_NEW_PID;
} else {
/* ugh. still don't know :-/ */
eprintf ("CRAP. returning from wait without knowing why...\n");
eprintf ("returning from wait without knowing why...\n");
}
}
}
/* if we still don't know what to do, we have a problem... */
if (reason == RZ_DEBUG_REASON_UNKNOWN) {
eprintf ("%s: no idea what happened... wtf?!?!\n", __func__);
eprintf ("%s: no idea what happened...\n", __func__);
reason = RZ_DEBUG_REASON_ERROR;
}
#endif // __APPLE__

View file

@ -559,16 +559,16 @@ RzDebugReasonType linux_dbg_wait(RzDebug *dbg, int pid) {
reason = RZ_DEBUG_REASON_NONE;
#endif
} else if (status == 1) {
eprintf ("EEK DEAD DEBUGEE!\n");
eprintf ("debugger is dead with status 1\n");
reason = RZ_DEBUG_REASON_DEAD;
} else if (status == 0) {
eprintf ("STATUS=0?!?!?!?\n");
eprintf ("debugger is dead with status 0\n");
reason = RZ_DEBUG_REASON_DEAD;
} else {
if (ret != tid) {
reason = RZ_DEBUG_REASON_NEW_PID;
} else {
eprintf ("CRAP. returning from wait without knowing why...\n");
eprintf ("returning from wait without knowing why...\n");
}
}
if (reason != RZ_DEBUG_REASON_UNKNOWN) {

View file

@ -1,4 +1,3 @@
// XXX wtf
#if 0
reg name usage
---+-----------+-------------

View file

@ -1,4 +1,3 @@
// XXX wtf
#if 0
reg name usage
---+-----------+-------------

View file

@ -161,7 +161,7 @@ static RzList *ios_dbg_maps(RzDebug *dbg) {
i++;
rz_list_append (list, mr);
}
if (size<1) size = osize; // fuck
if (size < 1) size = osize;
address += size;
size = 0;
}

View file

@ -21,16 +21,16 @@ static bool w32dbg_SeDebugPrivilege(void) {
tokenPriv.PrivilegeCount = 1;
tokenPriv.Privileges[0].Luid = luidDebug;
tokenPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if (AdjustTokenPrivileges (hToken, FALSE, &tokenPriv, 0, NULL, NULL) != FALSE) {
if (tokenPriv.Privileges[0].Attributes == SE_PRIVILEGE_ENABLED) {
// eprintf ("PRIV ENABLED\n");
}
// Always successful, even in the cases which lead to OpenProcess failure
// eprintf ("Successfully changed token privileges.\n");
// XXX if we cant get the token nobody tells?? wtf
} else {
if (AdjustTokenPrivileges (hToken, FALSE, &tokenPriv, 0, NULL, NULL) == FALSE) {
eprintf ("Failed to change token privileges 0x%x\n", (int)GetLastError());
ret = false;
//} else {
//if (tokenPriv.Privileges[0].Attributes == SE_PRIVILEGE_ENABLED) {
// eprintf ("PRIV ENABLED\n");
//}
// Always successful, even in the cases which lead to OpenProcess failure
// eprintf ("Successfully changed token privileges.\n");
// XXX if we can't get the token nobody tells?
}
CloseHandle (hToken);
return ret;

View file

@ -88,7 +88,7 @@ int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
// APPLE
/*
#if OLDIESHIT
#if OLDIEDEF
#if __x86_64__
#define RZ_DEBUG_STATE_T x86_THREAD_STATE
#define RZ_DEBUG_REG_T _STRUCT_X86_THREAD_STATE64
@ -98,9 +98,8 @@ int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
#define RZ_DEBUG_STATE_T i386_THREAD_STATE
#define RZ_DEBUG_STATE_SZ i386_THREAD_STATE_COUNT
#endif
#endif
#endif // OLDIEDEF
*/
// oldie
#if __LP64__
#define ADDR "%16lx"

View file

@ -36,7 +36,7 @@ RZ_API void rz_debug_trace_free (RzDebugTrace *trace) {
RZ_FREE (trace);
}
// TODO: added overlap/mask support here... wtf?
// TODO: added overlap/mask support here...
// TODO: think about tagged traces
RZ_API int rz_debug_trace_tag (RzDebug *dbg, int tag) {
//if (tag>0 && tag<31) core->dbg->trace->tag = 1<<(sz-1);

View file

@ -717,7 +717,6 @@ static void rcc_fun(RzEgg *egg, const char *str) {
} else {
// e->jmp (egg, egg->lang.ctxpush[context], 0);
if (CTX > 0) {
// WTF?
eprintf ("LABEL %d\n", CTX);
rz_egg_printf (egg, "\n%s:\n", str);
} else {
@ -1127,7 +1126,7 @@ static void rcc_next(RzEgg *egg) {
// fixed by izhuer
/*
if (ocn) { // Used to call .var0()
// WTF? ocn mustn't be NULL here
// XXX: ocn mustn't be NULL here
// XXX: Probably buggy and wrong
*buf = 0;
free (str);

View file

@ -112,7 +112,7 @@ static void emit_load_ptr(RzEgg *egg, const char *dst) {
}
static void emit_branch(RzEgg *egg, char *b, char *g, char *e, char *n, int sz, const char *dst) {
// This function signature is crap
// This function signature is bad
char *p, str[64];
char *arg = NULL;
char *op = "beq";

View file

@ -2,7 +2,7 @@
* This code was done
* by an anonymous gnome
* ------------------------
* That's pure mathematics, so no sense to adding license shit here.
* That's pure mathematics, so no sense to adding a license here.
*/
#include <stdlib.h>

View file

@ -8,7 +8,7 @@ RZ_API ut64 rz_hash_luhn(const ut8 *buf, ut64 len) {
char curChar[2] = {0, 0};
for (i = len; i > 0; i--) {
curChar[0] = buf[i - 1];
// ??? atoi here wtf
// ??? atoi here
curDigit = atoi (curChar);
if (parity == i % 2) {
curDigit *= 2;

View file

@ -63,7 +63,7 @@ enum {
typedef struct rz_asm_op_t {
int size; // instruction size (must be deprecated. just use buf.len
int bitsize; // instruction size in bits (or 0 if fits in 8bit bytes) // wtf why dupe this field? :D
int bitsize; // instruction size in bits (or 0 if fits in 8bit bytes) // why this field is dup?
int payload; // size of payload (opsize = (size-payload))
// But this is pretty slow..so maybe we should add some accessors
RzStrBuf buf;

View file

@ -121,7 +121,7 @@ RZ_API int rz_search_xrefs_update(RzSearch *s, ut64 from, const ut8 *buf, int le
RZ_API int rz_search_hit_new(RzSearch *s, RzSearchKeyword *kw, ut64 addr);
RZ_API void rz_search_set_distance(RzSearch *s, int dist);
RZ_API int rz_search_strings(RzSearch *s, ut32 min, ut32 max);
RZ_API int rz_search_set_string_limits(RzSearch *s, ut32 min, ut32 max); // WTF dupped?
RZ_API int rz_search_set_string_limits(RzSearch *s, ut32 min, ut32 max); // dup again?
//RZ_API int rz_search_set_callback(RzSearch *s, int (*callback)(struct rz_search_kw_t *, void *, ut64), void *user);
RZ_API void rz_search_set_callback(RzSearch *s, RzSearchCallback(callback), void *user);
RZ_API int rz_search_begin(RzSearch *s);

View file

@ -22,7 +22,7 @@ typedef enum {
RZ_SIGN_BYTES = 'b', // bytes pattern
RZ_SIGN_BYTES_MASK= 'm', // bytes pattern
RZ_SIGN_BYTES_SIZE= 's', // bytes pattern
RZ_SIGN_ANAL = 'a', // bytes pattern (anal mask) // wtf ?
RZ_SIGN_ANAL = 'a', // bytes pattern (anal mask)
RZ_SIGN_COMMENT = 'c', // comment
RZ_SIGN_GRAPH = 'g', // graph metrics
RZ_SIGN_OFFSET = 'o', // addr

View file

@ -346,7 +346,7 @@ RZ_API bool rz_io_write_at(RzIO* io, ut64 addr, const ut8* buf, int len) {
if (io->write_mask) {
mybuf = rz_mem_dup ((void*)buf, len);
for (i = 0; i < len; i++) {
//this sucks
//TODO: this needs some love because it is not optimal.
mybuf[i] &= io->write_mask[i % io->write_mask_len];
}
}

View file

@ -195,7 +195,7 @@ static RzIODesc *__open(RzIO *io, const char *pathname, int rw, int mode) {
RzIOPlugin rz_io_plugin_bfdbg = {
.name = "bfdbg",
.desc = "Attach to brainFuck Debugger instance",
.desc = "Attach to brainfuck Debugger instance",
.license = "LGPL3",
.uris = "bfdbg://",
.open = __open,

View file

@ -200,7 +200,7 @@ static ut64 getNextValid(RzIO *io, RzIODesc *fd, ut64 addr) {
lower = address;
}
if (size < 1) {
size = osize; // fuck
size = osize;
}
address += size;
size = 0;

View file

@ -501,7 +501,7 @@ static RzIODesc *rz_io_zip_open(RzIO *io, const char *file, int rw, int mode) {
if (!res) {
eprintf ("Failed to open the archive %s and file %s\n",
zip_filename, filename_in_zipfile);
//free (zfo); zfo is already freed by rz_io_desc_new //WTF
//free (zfo); zfo is already freed by rz_io_desc_new
rz_io_desc_free (res);
res = NULL;
}

View file

@ -294,7 +294,7 @@ RZ_API int rz_io_wundo_set(RzIO *io, int n, int set) {
break;
}
}
if (u) { // wtf?
if (u) {
rz_io_wundo_apply (io, u, set);
return true;
}

View file

@ -231,7 +231,7 @@ RZ_API int rz_lang_run_file(RzLang *lang, const char *file) {
return ret;
}
/* TODO: deprecate or make it more modular .. reading from stdin in a lib?!? wtf */
/* TODO: deprecate or make it more modular .. reading from stdin in a lib! */
RZ_API int rz_lang_prompt(RzLang *lang) {
char buf[1024];
const char *p;

View file

@ -565,7 +565,7 @@ RZ_API int rz_main_rz_gg(int argc, const char **argv) {
}
} else {
if (!format) {
eprintf ("No format specified wtf\n");
eprintf ("No format specified\n");
goto fail;
}
RzPrint *p = rz_print_new ();

View file

@ -104,7 +104,7 @@ RZ_API RzSocketHTTPRequest *rz_socket_http_accept (RzSocket *s, RzSocketHTTPOpti
}
}
if (content_length>0) {
rz_socket_read_block (hr->s, (ut8*)buf, 1); // one missing byte wtf
rz_socket_read_block (hr->s, (ut8*)buf, 1); // one missing byte
if (ST32_ADD_OVFCHK (content_length, 1)) {
rz_socket_http_close (hr);
eprintf ("Could not allocate hr data\n");

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
/* XXX : move to rz_util??? rename method names.. to long? */
/* proc IO is not related to socket io.. this is shitty!! */
/* proc IO is not related to socket io.. */
#include <rz_socket.h>
#include <rz_util.h>
@ -26,7 +26,7 @@ RZ_API struct rz_socket_proc_t *rz_socket_proc_open(char* const argv[]) {
return NULL;
}
if (pipe (sp->fd0)==-1) {
if (pipe (sp->fd0) == -1) {
perror ("pipe");
goto error;
}
@ -37,7 +37,7 @@ RZ_API struct rz_socket_proc_t *rz_socket_proc_open(char* const argv[]) {
goto error;
}
if (pipe (sp->fd1)==-1) {
if (pipe (sp->fd1) == -1) {
perror ("pipe");
goto error;
}

View file

@ -1216,7 +1216,7 @@ static void rz_print_format_nulltermstring(const RzPrint* p, int len, int endian
const char *setval, ut64 seeki, ut8* buf, int i, int size) {
if (!p->iob.is_valid_offset (p->iob.io, seeki, 1)) {
ut8 ch = 0xff;
// XXX there are some cases where the memory is there but is_valid_offset fails wtf
// XXX there are some cases where the memory is there but is_valid_offset fails
if (p->iob.read_at (p->iob.io, seeki, &ch, 1) != 1 && ch != 0xff) {
p->cb_printf ("-1");
return;

View file

@ -238,7 +238,7 @@ RZ_API void rz_graph_del_edge(RzGraph *t, RzGraphNode *from, RzGraphNode *to) {
t->n_edges--;
}
// XXX remove comments and static inline all this crap
// XXX remove comments and static inline all this stuff
/* returns the list of nodes reachable from `n` */
RZ_API const RzList *rz_graph_get_neighbours(const RzGraph *g, const RzGraphNode *n) {
return n? n->out_nodes: NULL;

View file

@ -519,7 +519,7 @@ RZ_API char* rz_print_hexpair(RzPrint *p, const char *str, int n) {
const char *color_text = "";
const char *color_other = "";
int bs = p->bytespace;
/* XXX That's hacky as shit.. but partially works O:) */
/* XXX That is hacky but it partially works */
/* TODO: Use rz_print_set_cursor for win support */
int cur = RZ_MIN (p->cur, p->ocur);
int ocur = RZ_MAX (p->cur, p->ocur);
@ -1651,7 +1651,7 @@ RZ_API void rz_print_zoom_buf(RzPrint *p, void *user, RzPrintZoomCallback cb, ut
return;
}
// TODO: memoize blocks or gtfo
// TODO: memoize blocks
for (i = 0; i < len; i++) {
if (p->cons->context->breaked) {
break;

View file

@ -314,7 +314,7 @@ RZ_API int rz_regex_comp(RzRegex *preg, const char *pattern, int cflags) {
g->mlen = 0;
g->nsub = 0;
g->ncategories = 1; /* category 0 is "everything else" */
g->categories = &g->catspace[-(CHAR_MIN)]; // WTF
g->categories = &g->catspace[-(CHAR_MIN)];
(void) memset ((char *)g->catspace, 0, NC*sizeof(cat_t));
g->backrefs = 0;

View file

@ -1083,7 +1083,7 @@ RZ_API char* rz_str_replace_thunked(char *str, char *clean, int *thunk, int clen
bias = vlen - newo;
slen += bias;
// HACK: this 32 avoids overwrites wtf
// HACK: this 32 avoids overwrites
newstr = realloc (str, slen + klen);
if (!newstr) {
eprintf ("realloc fail\n");
@ -1790,7 +1790,7 @@ RZ_API char *rz_str_format_msvc_argv(size_t argc, const char **argv) {
rz_strbuf_append (&sb, "\"");
}
if (must_escape) {
size_t bs_count = 0; // bullshit counter
size_t bs_count = 0; // backslash counter
for (; *arg; arg++) {
switch (*arg) {
case '\"':
@ -1998,7 +1998,7 @@ RZ_API const char *rz_str_ansi_chrn(const char *str, size_t n) {
}
/*
* filter out ansi CSI shit in-place!.
* filter out ansi CSI.
* str - input string,
* out - if not NULL write a pointer to the original string there,
* cposs - if not NULL write a pointer to thunk array there

View file

@ -216,10 +216,10 @@ RZ_API ut64 rz_num_get(RNum *num, const char *str) {
sscanf (str, "0x%"PFMT64x, &ret);
} else if (str[0] == '\'') {
ret = str[1] & 0xff;
// ugly as hell
// needs refactoring
} else if (!strncmp (str, "0xff..", 6) || !strncmp (str, "0xFF..", 6)) {
ret = rz_num_tailff (num, str + 6);
// ugly as hell
// needs refactoring
} else if (!strncmp (str, "0o", 2)) {
if (sscanf (str + 2, "%"PFMT64o, &ret) != 1) {
error (num, "invalid octal number");
@ -477,7 +477,7 @@ RZ_API ut64 rz_num_math(RNum *num, const char *str) {
p = p2 + 1;
continue;
}
eprintf ("WTF!\n");
eprintf ("something really bad has happened! can't find '('\n");
} else {
ret = rz_num_op (op, ret, rz_num_math_internal (num, p));
}
@ -705,12 +705,10 @@ RZ_API bool rz_is_valid_input_num_value(RNum *num, const char *input_value) {
return !(value == 0 && *input_value != '0');
}
// SHITTY API
RZ_API ut64 rz_get_input_num_value(RNum *num, const char *str) {
return (str && *str)? rz_num_math (num, str) : 0;
}
// SHITTY API
static inline ut64 __nth_nibble(ut64 n, ut32 i) {
int sz = (sizeof (n) << 1) - 1;
int s = (sz - i) * 4;

View file

@ -666,9 +666,7 @@ endif
subdir('test/unit')
install_data(
'doc/fortunes.creepy',
'doc/fortunes.fun',
'doc/fortunes.nsfw',
'doc/fortunes.tips',
install_dir: rizin_fortunes
)

Some files were not shown because too many files have changed in this diff Show more