Select Loops and menus
It is primarily used to create menus, which are displayed as a list of menu items in the form of a numerically ordered display on the standard error output, and a PS3 prompt is displayed to request user input (by default, the value of PS3 is "#?"). )。 The heart is PS3. After the prompt, the shell waits for the user to enter, the input
it on your phone. After the mediaserver crashes, it will immediately restart. Therefore, we need system logs to help verify the vulnerability trigger.The mediaserver can be found through the Log. In fact, this figure also contains other information, which will be discussed later.Knowing whyTo figure out why POC does this, you must start with the source code.We will continue to read the source code in/frame
Recent research on RTSP HTTP stream fetching methodVLC over live555 is a very good choice, of course, Andorid framework AV is also supporting RTSP http, the same good choice1. CompilingHttps://wiki.videolan.org/AndroidCompileI am Ubuntu 12.04 may be the environment to install some of the things better because, uh, there seems to be a necessary condition, the network. If you don't have this, you'll meetInexplicable wonder of the matter. I've compiled this before and it doesn't support RTSP, it's
In the live555 mediaserver, RTSP-over-HTTP has been implemented, but it is not enabled by default. To implement this function, call rtspserver: setuptunnelingoverhttp () to specify the port used for RTSP-over-http. This port must be different from the normal RTSP-over-TCP port.In my current version of mediaserver/live555mediaserver. cpp, there is such a program that has been commented out, it is not hard to
implementation of imediaplayerclient. cpp is as follows: l
class BpMediaPlayerClient: public BpInterface
The above implementation is based on the binder framework. You only need to implement it according to the template. The bpxxx class is the proxy class, And the bnxxx class is the native class ). The agent functions communicate with the ontransact functions of the local class.4 media service libmediaservice. So
The code of the multimedia service daemon: Frameworks/base/Media/
Dumpsys is used to dump the information of a system component:
*./frameworks/av/native/cmds/dumpsys/dumpsys.cpp*```sp
The above implementation code shows that dumpsys refers to the 'service' registered by dump in servicemanager. Each 'service' can describe its own information through the 'dump 'interface.
Take media. player as an example:
*./frameworks/av/media/mediaserver/main_mediaserver.cpp*```intmain(intargc,char**argv){MediaPlayerService::i
LIVE555 Study III LIVE555 Basics
LIVE555 Basics
LIVE555 is a cross-platform C ++ open-source project that provides solutions for streaming media. From today on, we will officially start to go deep into the LIVE555 code.
I. Brief Introduction to databases
LIVE555 contains LiveMedia, UsageEnvironment, BasicUsageEnvironment, GroupSock library, MediaServer simple server program, and multiple other test demos.
LiveMediaLibrary: contains a series of classes
, this library mainly contains some basic data structure and the definition of the tool classGroupsock directory, generated static library for Libgroupsock.lib, this library mainly contains the network related class definition and implementationLivemedia directory, generated static library for LibliveMedia.lib, this library contains the implementation of Live555 core functionsUsageenvironment directory, generated static library for LibUsageEnvironment.lib, this library mainly contains some class
returned, the binder is obtained directly. If the binder type returned by the server is BINDER_TYPE_HANDLE, that is, if the server returns only the binder handle, you need to recreate a BpBinder and return it to the client.The code above shows that the binder of the service saved by SM is only a handle, while the client obtains the handle from SM to re-build the proxy binder to communicate with the server.Here, we mention a special situation where both parties of the binder communication can ac
Hardware Platform: Atmel SAMA5D3 SoC + OV2640 Camera SensorAndroid version: 4.2.2The mediaserver process is the container process of the Camera Service. It dynamically loads the Camera HAL and Gralloc HAL. Video data frames must first arrive at the Camera hardware abstraction layer from the Camera driver. On the Camera hardware abstraction layer, video data frames are copied from the video capture buffer to the gralloc buffer.As a display server, the
multimedia framework from Android 2.3. There are stagefright vulnerabilities on all versions prior to Android 5.1. Stagefright is a very complex system library that supports parsing of multiple multimedia file formats such as Mpeg4/mp3. As the core component of Android Multimedia framework, there are more than 11 attack vectors for Stagefright, including browser/mms and so on.As the Stagefright library runs in the MediaServer process, an attacker who
Manager supports the use of string names to find the corresponding service.3, due to various reasons, the server process may be life and death impermanence. If the service Manager is unified, the client will be able to get the latest information from the server as long as it queries the service Manager.six, System service registration process AnalysisLet's take a look at how some of the system services are registered, and use mediaservice to check it out:The startup of the Mediaservice service
()Resets the MediaPlayer toits uninitialized state.void Seekto (int msec)seeks to specified timeposition.void Setaudiostreamtype (Intstreamtype)Sets the audio stream typefor this MediaPlayer.void Setdatasource (Stringpath)Sets the data source (File-path or http/rtsp URL) to use.Voidsetdisplay (Surfaceholder SH)Sets the Surfaceholder touse for displaying the video portion of the media.void SetVolume (Floatleftvolume, float rightvolume)Sets the volume on Thisplayer.void Start ()Starts or Resumesp
:
Then continue to trace the Cameraservice's service-side trace and discover that the binder thread in the/system/bin/mediaserver processing Cameraservice is block too, Then trace the use of call stacks and mutexes for each thread in trace, discovering that the addlistener that handles calls to Cameraservice is blocked because the other binder thread takes the lock first, It then registers the thermal callback in the course of the occupation, but
a new file, first:
3.5 type definition:
Type definition
external/sepolicy/device.te;
Device/mediatek/common/sepolicy/device.te
Type binding:
external/sepolicy/file_contexts;
Device/mediatek/common/sepolicy/file_contexts
(1) Add type Device/mediatek/common/sepolicy/device.te
Type Tfa9897_device, Dev_type;
(2) Association, in Device/mediatek/common/sepolicy/file_contexts
/dev/tfa9897 (/.*)? U:object_r:tfa9897_device:s0
(3) Add the access rights for the corresponding process/domain. such
shells: the first shell is cat, the second shell is the pipe, and the third shell is the while;Until cycle:Until expressionDoCOMMANDDoneTests the expression return value, executes the loop body for the false, and does not execute the loop for the true;Until Infinite loop: (Opposite to while)Method OneUntil ((0))DoCOMMANDDoneMethod TwoUntil falseDoCOMMANDDoneSelect loop:Select VARIABLE in ListDoCOMMANDDoneis a menu extension loop, with syntax similar to a for loop with a list;When you execute a
variable correction operation is performed at the end of each cycle, then the condition is judged.For example:
for((i=0;i20;i++))
do
echo "Helllo I am $i"
done
Select loops and Menus
select variable in listdo 循环体命令doneThe Select loop is used primarily to create menus , and menu items in numerical order are displayed on standard errors and displayed PS3 提示符 , waiting for user input.The user enters a number i
()); } /** Method 2 * Using the Arrays.sort (object[]) implementation, the object must implement the comparable interface and make a replication CompareTo () method */ person2[] ps2 = new person2[]{new Person2 ("P0", 0), New Person2 ("P1", 3), New Person2 ("P2", 5), New Person2 ("P3", 4), New Person2 ("P4", 8), New Person2 ("P5", 6), new Person2 ("P6", 7), new Person2 ("P7", 1), new Person2 ("P8", 2), new Person2 ("P9", 9)}; System.out.println ("\ n use Arrays.sort
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.