Skip to content

Commit

Permalink
Small fixes (angr#2956)
Browse files Browse the repository at this point in the history
* Fix inconsistent indentation

* Remove trailing whitespaces

* Use https where possible
  • Loading branch information
mauricesvp authored Oct 29, 2021
1 parent ee82cd5 commit b1da770
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ about: Create a report to help us fix existing bugs and improve angr
*Disclaimer:
The angr suite is maintained by a small team of volunteers.
While we cannot guarantee any timeliness for fixes and enhancements, we will do our best.
For more real-time help with angr, from us and the community, join our [Slack.](http://angr.io/invite/)*
For more real-time help with angr, from us and the community, join our [Slack.](https://angr.io/invite/)*
-->
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ about: Suggest an idea for angr.
*Disclaimer:
The angr suite is maintained by a small team of volunteers.
While we cannot guarantee any timeliness for fixes and enhancements, we will do our best.
For more real-time help with angr, from us and the community, join our [Slack.](http://angr.io/invite/)*
For more real-time help with angr, from us and the community, join our [Slack.](https://angr.io/invite/)*
-->

---
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ about: A question that is *not* a bug or feature request.
*Disclaimer:
The angr suite is maintained by a small team of volunteers.
While we cannot guarantee any timeliness for fixes and enhancements, we will do our best.
For more real-time help with angr, from us and the community, join our [Slack.](http://angr.io/invite/)*
For more real-time help with angr, from us and the community, join our [Slack.](https://angr.io/invite/)*
-->

<!--
Expand All @@ -18,9 +18,9 @@ For more real-time help with angr, from us and the community, join our [Slack.](
Before submitting, make sure that you:
* Search the Issues page for a similar question.
* Search the [Documentation](http://docs.angr.io/) for an answer, as well as our library of [examples](https://github.com/angr/angr-doc/tree/master/examples)
* Search the [Documentation](https://docs.angr.io/) for an answer, as well as our library of [examples](https://github.com/angr/angr-doc/tree/master/examples)
* Are running the latest versions of angr and its components. angr is rapidly-evolving!
* Ask your question on [Slack](http://angr.io/invite/) instead, if it is brief.
* Ask your question on [Slack](https://angr.io/invite/) instead, if it is brief.
-->

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ angr
[![PyPI Statistics](https://img.shields.io/pypi/dm/angr.svg)](https://pypistats.org/packages/angr)
[![Build Status](https://dev.azure.com/angr/angr/_apis/build/status/angr?branchName=master)](https://dev.azure.com/angr/angr/_build/latest?definitionId=18&branchName=master)
[![License](https://img.shields.io/github/license/angr/angr.svg)](https://github.com/angr/angr/blob/master/LICENSE)
[![Gitbook](https://img.shields.io/badge/docs-gitbook-green.svg)](http://docs.angr.io)
[![API Docs](https://img.shields.io/badge/docs-api-green.svg)](http://angr.io/api-doc)
[![Gitbook](https://img.shields.io/badge/docs-gitbook-green.svg)](https://docs.angr.io)
[![API Docs](https://img.shields.io/badge/docs-api-green.svg)](https://angr.io/api-doc)

angr is a platform-agnostic binary analysis framework.
It is brought to you by [the Computer Security Lab at UC Santa Barbara](https://seclab.cs.ucsb.edu), [SEFCOM at Arizona State University](http://sefcom.asu.edu), their associated CTF team, [Shellphish](http://shellphish.net), the open source community, and **[@rhelmot](https://github.com/rhelmot)**.
It is brought to you by [the Computer Security Lab at UC Santa Barbara](https://seclab.cs.ucsb.edu), [SEFCOM at Arizona State University](https://sefcom.asu.edu), their associated CTF team, [Shellphish](https://shellphish.net), the open source community, and **[@rhelmot](https://github.com/rhelmot)**.

# What?

Expand All @@ -23,7 +23,7 @@ angr is a suite of Python 3 libraries that let you load a binary and do a lot of
- Value-set analysis (VSA)
- Decompilation

The most common angr operation is loading a binary: `p = angr.Project('/bin/bash')` If you do this in an enhanced REPL like IPython, you can use tab-autocomplete to browse the [top-level-accessible methods](http://docs.angr.io/docs/toplevel.html) and their docstrings.
The most common angr operation is loading a binary: `p = angr.Project('/bin/bash')` If you do this in an enhanced REPL like IPython, you can use tab-autocomplete to browse the [top-level-accessible methods](https://docs.angr.io/docs/toplevel.html) and their docstrings.

The short version of "how to install angr" is `mkvirtualenv --python=$(which python3) angr && python -m pip install angr`.

Expand Down Expand Up @@ -51,5 +51,5 @@ project.execute()
- Documentation as [HTML](https://docs.angr.io/) and as a [Github repository](https://github.com/angr/angr-doc)
- Dive right in: [top-level-accessible methods](https://docs.angr.io/core-concepts/toplevel)
- [Examples using angr to solve CTF challenges](https://docs.angr.io/examples).
- [API Reference](http://angr.io/api-doc/)
- [API Reference](https://angr.io/api-doc/)
- [awesome-angr repo](https://github.com/degrigis/awesome-angr)
2 changes: 1 addition & 1 deletion angr/analyses/bindiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _get_closest_matches(input_attributes, target_attributes):
return closest_matches


# from http://rosettacode.org/wiki/Levenshtein_distance
# from https://rosettacode.org/wiki/Levenshtein_distance
def _levenshtein_distance(s1, s2):
"""
:param s1: A list or string
Expand Down
2 changes: 1 addition & 1 deletion angr/analyses/girlscout.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _get_next_addr_to_search(self, alignment=None):

def _get_next_code_addr(self, initial_state):
"""
Besides calling _get_next_addr, we will check if data locates at that address seems to be code or not. If not,
Besides calling _get_next_addr, we will check if data locates at that address seems to be code or not. If not,
we'll move on to request for next valid address.
"""
next_addr = self._get_next_addr_to_search()
Expand Down
8 changes: 4 additions & 4 deletions angr/engines/vex/claripy/ccall.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,9 @@ def x86g_calculate_daa_das_aaa_aas(state, flags_and_AX, opcode):
condition = claripy.Or(old_AL > 0x99, old_C == 1)
r_AL = claripy.If(condition, r_AL + 0x60, r_AL)
r_C = claripy.If(condition, one, zero)

r_AL = r_AL&0xFF
r_O = zero
r_O = zero
r_S = claripy.If((r_AL & 0x80) != 0, one, zero)
r_Z = claripy.If(r_AL == 0, one, zero)
r_P = calc_paritybit(r_AL).zero_extend(31)
Expand Down Expand Up @@ -1228,7 +1228,7 @@ def x86g_calculate_aad_aam(state, flags_and_AX, opcode):
#

# Reference for the GDT entry layout
# http://wiki.osdev.org/Global_Descriptor_Table
# https://wiki.osdev.org/Global_Descriptor_Table
def get_segdescr_base(state, descriptor):
lo = descriptor[31:16]
mid = descriptor[39:32]
Expand Down Expand Up @@ -1267,7 +1267,7 @@ def bad(msg):
segment_selector_val = seg_selector >> 3

if state.project.simos.name == "Win32" and (segment_selector_val == 0x6).is_true() and state.project.concrete_target is not None:
return bad("angr doesn't support Windows Heaven's gate calls http://rce.co/knockin-on-heavens-gate-dynamic-processor-mode-switching/ \n"
return bad("angr doesn't support Windows Heaven's gate calls https://rce.co/knockin-on-heavens-gate-dynamic-processor-mode-switching/ \n"
"Please use the native 32 bit libs (not WoW64) or implement a simprocedure to avoid executing these instructions"
)

Expand Down
2 changes: 1 addition & 1 deletion angr/procedures/java_jni/method_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _setup_java_args(self, arg_values, method_id, this_ref=None):

# function arguments
for arg_value_, arg_type in zip(arg_values, method_id.params):

if arg_type in ArchSoot.primitive_types:
# argument has a primitive integral type
# => cast native value to java type
Expand Down
2 changes: 1 addition & 1 deletion angr/procedures/libc/snprintf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def run(self, dst_ptr, size, fmt): # pylint:disable=arguments-differ,unused-arg

if self.state.solver.eval(size) == 0:
return size

# The format str is at index 2
fmt_str = self._parse(2)
out_str = fmt_str.replace(3, self.arg)
Expand Down
1 change: 0 additions & 1 deletion angr/procedures/libc/strtoul.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ def run(self, nptr, endptr, base):
strtol = angr.SIM_PROCEDURES['libc']['strtol']
result = self.inline_call(strtol, nptr, endptr, base).ret_expr
return result

4 changes: 2 additions & 2 deletions angr/procedures/libc/vsnprintf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class vsnprintf(angr.SimProcedure):
def run(self, str_ptr, size, fmt, ap): #pylint:disable=unused-argument
# This function returns
# Add another exit to the retn_addr that is at the top of the stack now

if self.state.solver.eval(size) == 0:
return size

self.state.memory.store(str_ptr, b"\x00")

return size - 1
2 changes: 1 addition & 1 deletion angr/procedures/posix/dup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def run(self, oldfd): # pylint:disable=arguments-differ
for i, fd in enumerate(sorted(self.state.posix.fd.keys())):
if i != fd: # "Free" slot in keys
newfd = i

self.state.posix.fd[newfd] = self.state.posix.fd[oldfd]
return newfd

Expand Down
2 changes: 1 addition & 1 deletion angr/state_plugins/unicorn_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def _hook_intr_x86(self, uc, intno, user_data):
else:
self.trap_ip = self.uc.reg_read(unicorn.x86_const.UC_X86_REG_RIP)

# http://wiki.osdev.org/Exceptions
# https://wiki.osdev.org/Exceptions
if intno == 0:
# divide by zero
_UC_NATIVE.stop(self._uc_state, STOP.STOP_ZERO_DIV)
Expand Down
2 changes: 1 addition & 1 deletion native/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion native/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down

0 comments on commit b1da770

Please sign in to comment.