Windows symbol packages
Содержание:
- OllyMSDN
- Set dynamically
- Using where and frame commands
- Setting breakpoints in dynamically loaded modules
- Флаг отладки
- Как, используя Facebook Debugger, исправить свои WordPress изображения и ссылки (в 2 шагах)
- Starting The Debugger
- HTTP Software
- Formatters
- Notes and Cautions:
- Multiple Users Debugging
- Декомпиляция и дизассемблирование
OllyMSDN
Количество функций WinAPI огромно, и знать их все как свои пять пальцев просто нереально. Поэтому иногда приходится заглядывать в документацию, чтобы уточнить/узнать, что возвращает та или иная функция или какие параметры принимает на вход. К сожалению, стандартный файл помощи не может предоставить всю необходимую информацию, поэтому приходится запускать браузер и идти на MSDN. Так почему бы полностью не заменить этот файл online-документацией? Для этого всего-то надо установить плагин OllyMSDN, убедиться, что в качестве справки у нас стоит файл WIN32.HLP (Помощь -> Выбрать справку по API). Если такого файла нет, то необходимо создать пустой с таким именем и указать его Olly. Теперь, когда ты попытаешься в отладчике получить доступ к файлу справки, плагин перехватит функцию WinHelp() API и вместо старого файла откроет тебе сайт MSDN. А чтобы получить информацию о конкретной функции во время отладки, надо кликнуть правой кнопкой мыши на инструкцию call и выбрать пункт Help on symbolic name или просто нажать <Ctrl + F1>.
Открываем сайт MSDN вместо стандартного файла справки
Set dynamically
You can also enable debug dynamically by calling the method :
let debug = require('debug');
console.log(1, debug.enabled('test'));
debug.enable('test');
console.log(2, debug.enabled('test'));
debug.disable();
console.log(3, debug.enabled('test'));
print :
Usage : can include modes separated by a colon and wildcards.
Note that calling completely overrides previously set DEBUG variable :
Will disable all namespaces. The functions returns the namespaces currently
enabled (and skipped). This can be useful if you want to disable debugging
temporarily without knowing what was enabled to begin with.
For example:
let debug = require('debug');
debug.enable('foo:*,-foo:bar');
let namespaces = debug.disable();
debug.enable(namespaces);
Note: There is no guarantee that the string will be identical to the initial
enable string, but semantically they will be identical.
Using where and frame commands
During analysis of code, you might need to check which function currently runs.
By typing the command, you will learn these things:
- The name of the currently running function.
- The name of the file in which the function runs.
- The number of the line in which the function is.
- The name of the function that called the current function.
- The arguments the current function had.
- If it is a call chain, you will see all of them.
You can analyze the values of variables local to the calling function (or other function in the stack). The command instructs the GDB debugger to work on the specific stack frame or the one you are currently at.
- : sets the current stack frame to the indicated as .
- : displays the state of the current stack frame.
Setting breakpoints in dynamically loaded modules
The problem with dynamically loaded modules is that the debugger doesn’t
know about the symbol information until the module has been loaded by dlopen().
This is extremely annoying if you want to debug constructors that are run
for static variables. The following trick works on systems that use glibc2.
-
Set a breakpoint that the program will hit before it loads the dynamic
module, e.g. in main. - Run the program until it stops at this breakpoint.
-
Now you can set a breakpoint in the function _dl_debug_state.
For this, open the breakpoint list (View|Breakpoints),
Type _dl_debug_state in the edit box and click
Add. -
Continue the program until it stops at this breakpoint, which happens somewhere
inside dlopen()! At this time, the symbols of the dynamic module
are already available, but the constructors are not yet executed. - Now you can set a breakpoint in your constructor.
_dl_debug_statedlopen()
Note that the orphaned breakpoints feature
does not really help. The reason is that orphaned breakpoints are not tried to be
installed until the program stops. For this reason it is still required to set
the breakpoint in _dl_debug_state. However, the breakpoints are
preserved and can be set at any time, even before the program starts.
Флаг отладки
Android устроен таким образом, что не позволит подключиться с помощью отладчика к приложению, которое этого не хочет. А факт «хотения» определяется флагом отладки, который представляет собой простую строку в файле приложения.
Поэтому первое, что мы должны сделать, — это разобрать приложение, выставить флаг отладки в значение true и собрать обратно. Проще всего это сделать с помощью утилиты apktool. Просто натравливаем ее на подопытное приложение, и готово:
В текущем каталоге появится подкаталог app (ну или как назывался пакет с приложением).
Далее переходим в него и видим несколько файлов и каталогов. Нам они еще пригодятся, а пока открываем файл в текстовом редакторе и находим строку, начинающуюся с . Это тег application, который описывает приложение в целом. Именно к нему мы должны добавить атрибут . Просто вставь его сразу после application:
Теперь приложение необходимо запаковать и подписать:
Утилиту sign можно найти на GitHub.
После этого приложение можно установить на устройство.
Как, используя Facebook Debugger, исправить свои WordPress изображения и ссылки (в 2 шагах)
Если вы уже настроили свои теги og, следуя процессу выше, возможно проблемы возникают не из-за структуры вашего сайта. Но Facebook по прежнему показывает не выбранное вами изображение или вообще не отображает его – возможно причина в плагине кэширования. Давайте посмотрим, как с этим справиться.
Шаг 1: Очистите свой кэш в WordPress
Плагины кэширования весьма популярны, по причине их ускорения работы сайта, путём сохранения и повторного использования части контент. Проблема в том, что иногда Facebook старается вытянуть og теги из вашего закэшированного контента, вместо того, чтобы взять из самой свежей версии.
Например, если закеширована копия одной из ваших страниц не содержит тегов og, у Facebook могут возникнуть проблемы с корректным отображением информации. Или вы уже изменили изображение записи, но Facebook по прежнему показывает неактуальную прежнюю версию.
В любом случае, наиболее прямым исправлением проблемы является очистка кэша в WordPress. Существует много способов это сделать, в зависимости от того, какой вы используете плагин. Если вы поклонник W3 Total Cache, например, вам нужно только перейти в админ консоль и открыть вкладку Performance > Dashboard. Вы увидите кнопку с надписью empty all caches справа вверху:

Нажмите на кнопку и подождите пока плагин выполнит задачу. Через несколько секунд страница перезагрузится и ваш кэш будет очищен.
Этот процесс на столько же прост и для других плагинов такого, как, например, WP Super Cache. Если вы пользуетесь этим инструментом, вам нужно только перейти во вкладку Settings > WP Super Cache в консоли и найти кнопку Delete Cache:

Другой популярный плагин – WP Fastest Cache. Используя его, для очистки кэша перейдите на WP Fastest Cache и найдите раздел Delete Cache на следующей странице. Здесь вы найдёте ярко голубую кнопку с надписью Delete Cache:

Мы рассмотрели три наиболее популярных плагина кэширования. Если вы пользуетесь другим инструментом, просто посмотрите его документацию. Так непременно должны быть указания о том, как очистить ваш кэш и это будет очень просто сделать.
Шаг 2: Попросите Facebook загрузить заново ваши Теги Open Graph
Этот шаг ещё проще предыдущего. Теперь ваш кэш очищен и установлены теги og для вашего контента, значит Facebook должен уже верно вытянуть информацию из структуры вашей публикации.

На следующей странице вы найдёте отчёт такого же вида, как мы обсуждали ранее. Найдите кнопку Повторить скрапинг (Scrape Again), сразу за полем Время скрапинга (Time Scraped):

Нажмите на кнопку и Facebook ещё раз обратится к вашей статье. Если всё работает правильно (а теперь должно быть так), предпросмотр вашего контента будет выглядеть идеально.
Начиная с этого момента всё, что вам нужно делать, это помнить об установке изображений и мета описаний, которые вы хотели бы, чтобы Facebook показывал. Если вы ещё наткнётесь на проблему, попробуйте опять очистить кэш!
Starting The Debugger
In order to enable Xdebug’s debugger you need to make some configuration
settings in php.ini. These settings are to enable the
debugger, and to configure the IP address
and port where the debugger should connect to. There is also a
setting that can be used if your development server
is shared with multiple developers.
If you want the debugger to initiate a session when an error situation
occurs (PHP error or exception) then you also need to change the
setting. Allowed values for this setting are «req» (the
default) which makes the debugger initiate a session as soon as a script is
started, or «jit» when a session should only be initiated on an error.
After made all those settings Xdebug will still not start a debugging session
automatically when a script is run. You need to activate Xdebug’s debugger
and you can do that in three ways:
Using an environment variable
When running the script from the command line you need to set an
environment variable, like:
export XDEBUG_CONFIG="=session_name" php myscript.php
On Windows, setting an environment variable is done with :
set XDEBUG_CONFIG="=session_name"
You can also configure the , ,
and in this same environment variable as
long as you separate the values by a space:
export XDEBUG_CONFIG="=session_name =localhost =1"
All settings that you can set through the XDEBUG_CONFIG setting can also be set
with normal php.ini settings.
Using a GET parameter
If you want to debug a script started through a web browser, simply add
as parameter to the URL.
Instead of using a GET parameter, you can also set XDEBUG_SESSION_START as a
POST parameter, or through a cookie named XDEBUG_SESSION. Refer to the to read on how debug sessions work
from within a browser window.
Using a browser extension
An alternative way to activate the debugger while running PHP through a web
server is by installing one of the following four browser extensions. Each of
them allows you to simply enable the debugger by clicking on one button. When
these extensions are active, they set the XDEBUG_SESSION cookie directly,
instead of going through XDEBUG_SESSION_START as described in
further on.
The extensions are:
- Xdebug Helper for Firefox
-
This extension
for Firefox was built to make debugging with an IDE easier. You can
find the extension at
https://addons.mozilla.org/en-GB/firefox/addon/xdebug-helper-for-firefox/.
The source code for this extension is on GitHub. - Xdebug Helper for Chrome
-
This extension
for Chrome will help you to enable/disable debugging and profiling with
a single click. You can find the extension at
https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc. - XDebugToggle for Safari
-
This extension
for Safari allows you to auto start Xdebug debugging from within Safari.
You can get it from Github at
https://github.com/kampfq/SafariXDebugToggle. - Xdebug launcher for Opera
-
This extension
for Opera allows you to start an Xdebug session from Opera.
Before you start your script you will need to tell your client that it can
receive debug connections, please refer to the documentation of the specific
client on how to do this. To use the bundled client simply start it after
it. You can
start it by running on Linux,
on MacOS, and on
Windows.
When the debug client starts it will show version information and then
waits until a connection is initiated by the debug server (Xdebug):
Xdebug Simple DBGp client () Copyright 2019-2020 by Derick Rethans In dumb client mode Waiting for debug server to connect on port 9000.
After a connection is made the output of the debug server is shown:
Connect from :53764 DBGp/: — For Debugging (ID: /)
Now you can use the commands as explained on the DBGp documentation page. When the script ends the
debug server disconnects from the client and the debug client resumes with
waiting for a new connection. There is a more comprehensive documentation
available for Command Line Debug Client as well.
HTTP Software
Software to debug the HTTP traffic
HTTP Debugger Pro is the HTTP software which provides you with an opportunity to view all HTTP traffic between your
browser and a web server.
HTTP sessions
With our HTTP analyzing software you can edit and resubmit tweaked HTTP sessions back to your server, in order to test/detect
security problems in your code, and check how it handles requests, for example, test the security or authorization flow with or without special headers,
cookies, etc.
Save and Restore Sessions
The HTTP software tool may save your current session to a file. After restoring from session file you will have absolutely the
same data in HTTP Debugger as at the time you saved it.
Developing code with more features, more connectivity, and stricter standards than ever before makes it all the more
difficult to find bugs and fix security flaws. The pressure mounts to deliver functional, safe, and compliant code on
time. You can use HTTP Debugger Pro to detect security problems in your code like fake authentication, unauthorized data
API query or cross-user data query.
All in all, one can say that third-party integrations are challenging for developers. But using suitable tools and high
test coverage can definitely help to master these challenges. The HTTP Debugger Pro identifies and eliminates
integration issues with third-party systems. Usually, the only things we know about the third-party web service is the
endpoint URL and more or less helpful documentation. The problem is, that not only the API itself but also both the
endpoint and the documentation, can change every time. The tool we offer implements troubleshooting weird situations,
such as undocumented features and bugs while accessing these services.
The demands on networks are increasing every day, and the need for proper network performance measurement is more
important than ever before.
When delivering services and applications to users, bandwidth issues, network downtime, and bottlenecks can quickly
escalate into IT crisis mode. The best way to guarantee ongoing user satisfaction is to detect and diagnose performance
issues.
With HTTP Debugger Pro you can accurately measure the network performance of your application; isolate and fix
performance bottlenecks; accurately measure the network performance of a page and view opportunities for boosting its
speed.
Highlighting of Errors and Slow Requests
HTTP Debugger automatically highlights errors, slow and large requests. You can create custom highlighting rules in one
click.
HTTP Debugger automatically numbers all requests in the chronological order.
Incoming HTTP Traffic of Local Servers
With HTTP Debugger you can view the incoming HTTP traffic for locally running web servers, powered by Node.js, IIS
Express, Apache and others.
Modifying HTTP traffic on-the-fly
The HTTP software automatically responds to requests, simulate server responses, add/remove HTTP headers and change HTTP
content.
You can add/remove HTTP headers, change HTTP content, redirect requests from one server to another, and many more.
SSL traffic Decryption
SSL/TLS Encryption is used to ensure the confidentiality of data in transit. Due to the numerous types of threats, encrypted
traffic must be inspected using monitoring tools that are capable of decrypting the data.
With our HTTP sniffer, you can decrypt SSL traffic virtually from any browser or desktop application including Android
emulators, .NET, and JAVA applications.
The software provides you with the Built-in URL/Text converter to decode (or encode) URL, Base64, or Hex encoded
strings.
Export to Excel or JSON/XML/CSV
Export data from HTTP analyzer to Microsoft Excel, or to JSON, XML, TXT, CSV formats for future analysis in external
applications.
Copyright Notice: Please don’t copy or translate this article without prior written permission
from the HTTPDebugger.com
HTTP Debugger is a proxy-less HTTP analyzer for developers that provides the ability to capture and analyze HTTP headers,
cookies, POST params, HTTP content and CORS headers from any browser or desktop application.
Awesome UI and very easy to use. Not a proxy, no network issues!
Download FREE 7-Day Trial
HTTP Debugger
Debug HTTP API calls to a back-end and between back-ends.
Very easy to use.
Not a proxy, no network issues!
Download Free Trial
Formatters
| Formatter | Representation |
|---|---|
| Pretty-print an Object on multiple lines. | |
| Pretty-print an Object all on a single line. | |
| String. | |
| Number (both integer and float). | |
| JSON. Replaced with the string » if the argument contains circular references. | |
| Single percent sign (‘%’). This does not consume an argument. |
Custom formatters
You can add custom formatters by extending the object.
For example, if you wanted to add support for rendering a Buffer as hex with
, you could do something like:
const createDebug = require('debug')
createDebug.formatters.h = (v) => {
return v.toString('hex')
}
// …elsewhere
const debug = createDebug('foo')
debug('this is hex: %h', new Buffer('hello world'))
// foo this is hex: 68656c6c6f20776f726c6421 +0ms
Notes and Cautions:
The following emulation modules have at least basic debugger functionality implemented
- md
- nes
- pce
- pcfx
- psx
- ss
- vb
- wswan
Save States, Power/Reset: Utilizing save states and power toggling/resetting in step mode may lead to
significant malfunctions or glitches in the following emulation modules:
- md
- nes
- psx
- ss
- vb
- wswan
Video Updates: The last valid(non-skipped) video frame is drawn while in step mode. Older versions of Mednafen would
attempt to draw the current, incomplete frame as emulation progressed, but this was rather buggy because the emulation code was not
designed with it in mind.
Read Breakpoints: Opcode, operand, and prefix(in WonderSwan case) fetches will trigger read breakpoints in the NES, PC Engine, and WonderSwan
debuggers.
PC Breakpoints: PC breakpoints are evaluated only for the state of PC at the start of the instruction(or start of prefixes for an instruction
in the case of V30MZ); IE, a PC breakpoint set on the address of an operand byte(6502, HuC6280, V30MZ) or the second
16-bits of a 32-bit instruction(V810) will not be triggered when the instruction is executed.
Branch History: When the CPU debugger view is not active, the branch history will only be updated reliably when at least one breakpoint
is active/installed.
Multiple Users Debugging
Xdebug only allows you to specify one IP address to connect to with
) while doing remote debugging. It does not
automatically connect back to the IP address of the machine the browser
runs on, unless you use .
If all of your developers work on different projects on the same (development)
server, you can make the setting for each directory
through Apache’s .htaccess functionality by using . However, for the case where multiple
developers work on the same code, the .htaccess trick does not work as the
directory in which the code lives is the same.
There are two solutions to this. First of all, you can use a DBGp proxy.
For an overview on how to use this proxy, please refer to the article at Debugging
with multiple users. You can download the proxy on
ActiveState’s web
site as part of the python remote debugging package. There is some
more documentation in the
Komodo FAQ.
Secondly you can
use the setting that was introduced in
Xdebug
2.1.
Декомпиляция и дизассемблирование
Дизассемблерный листинг приложения у нас уже есть, мы получили его, разобрав приложение с помощью apktool. Мы можем импортировать его в Android Studio и начать отладку. Но лучше все-таки попытаться получить исходники Java, гораздо более легкие в чтении.
Для этого приложение необходимо декомпилировать. Сделать это можно с помощью нескольких различных инструментов, но я предпочитаю использовать декомпилятор Jadx. Он хорошо переваривает код, имеет средства деобфускации и активно развивается.
Скачиваем Jadx, запускаем, выбираем apk-файл приложения. Откроется главное окно приложения. Слева будут пакеты, справа исходники. Лучше сразу проверить их корректность (действительно ли получился читаемый Java-код), а затем можно экспортировать их с помощью меню File → Save as gradle project.
Декомпиляция приложения в Jadx
Вариант 1. Присоединись к сообществу «Xakep.ru», чтобы читать все материалы на сайте
Членство в сообществе в течение указанного срока откроет тебе доступ ко ВСЕМ материалам «Хакера», увеличит личную накопительную скидку и позволит накапливать профессиональный рейтинг Xakep Score!
Подробнее
Вариант 2. Открой один материал
Заинтересовала статья, но нет возможности стать членом клуба «Xakep.ru»? Тогда этот вариант для тебя!
Обрати внимание: этот способ подходит только для статей, опубликованных более двух месяцев назад.
Я уже участник «Xakep.ru»