2.4.3
Classification and newbuilding supervision
by Bureau Veritas - The Class Certificates
Based on the "Request for Classification" dated 27 September 1979 (Enclosure <IP_ADDRESS>) - 2 pages - Meyer Werft requested Bureau Veritas to proceed with the operations required by their Rules for the purpose of obtaining the classification under Special Survey, i.e. construction drawings were to be checked against the rules and the building of the vessel was to be supervised, same as one year before the DIANA II.
On page 2 of this particular form among other things it is stated:
»Certificates to be issued by the Society on behalf of the National
Authorities.
Load-Line
Statutory Safety Construction, Safety Equipment, Safety Radio
Tonnage National, Suez Canal, Panama Canal«each possibility having a 'YES/NO' box attached.
On the above-mentioned form filled in by Meyer Werft the 'NO' box referring to the load-line is marked, whilst in all other cases the 'YES' boxes are marked.According to the interpretation of the B.V. head office this means that the Yard has requested B.V. just to issue the Load Line Certificate and to specifically exclude any Statutory Certificates. Actually Meyer Werft had filed a further application dated 21 April 1980 with Bureau Veritas, viz. "Application for an International Freeboard Certificate or for an International Load Line Exemption Certificate within the Scope of the International Convention on Load Lines 1966" which would mean that the Yard applied for the same services a second time (Enclosure <IP_ADDRESS>). The Load Line Certificate was in fact issued by B.V.
In 1979/1980 the "1977 Rules of B.V." were in force. According to §§ 11-44, indentations 2 and 3 of those rules the following applied to bow visors:
»2 - Bow and stern doors
21 - When the ship is equipped with a bow door, to allow access to garage, the collision bulkhead must have a removable part. This design is acceptable only above bulkhead deck and only if the removable part has a watertightness and a strength equivalent to those of fixed rule bulkhead.
A movable access ramp may be used for this purpose.
22 - Scantlings of plating and stiffeners of a bow door are to be equivalent to those of adjacent shell structure.«This means that the bow ramp, located above bulkhead deck = car deck, served as the upper extension of the collision bulkhead no matter what the distance to the forward perpendicular was, provided the bow ramp was watertight and had a strength equivalent to those of fixed collision bulkheads.
These conditions were fulfilled by the bow ramp of VIKING SALLY, thus the construction complied with the B.V. Rules in force at the time the vessel was built. Only one year later, in 1981, the SOLAS 1974 Rules were incorporated into the B.V. Rules which had no more effect on VIKING SALLY because she had already been delivered in June 1980.
»3 - Securing of doors
31 - Doors and screen-doors have to be firmly secured by use of cleats conveniently spaced or other similar devices. Particularly it has to be provided one of these devices at each corner of opening. Structure reinforcements have to be realised on door and adjacent shell plating to attached points of cleats, hinges, jacks, etc.«The BV-Hamburg office, in charge of plan approval, received already soon after the signing of the contract a continuous flow of drawings from the Yard and von Tell. According to the B.V. head office all drawings received with approval date and status are listed in the attached Enclosure <IP_ADDRESS>, whilst according to another list sent by B.V. head office by letter of 10 January 1995 to the JAIC - Enclosure <IP_ADDRESS> - further drawings referring to bow visor/bow ramp area, which are not noted in the first list, are noted and have been approved by BV-Hamburg, i.e. drawings 1103-Bow Visor, 1106-Locking Devices of Bow Visor and 1101-Foreship Frame 149-forward.
In their letter to the JAIC dated 10.01.95 B.V. explains the approval procedure including the above-mentioned drawings as follows:
»The bow door drawings of the MV ESTONIA were reviewed by the Hamburg local office of Bureau Veritas which was in charge of the review. List of reviewed drawings is given as annex 4.«
»The drawings were checked against the Bureau Veritas 1977 rules which did not contain formula for the rule strength of securing devices of shell doors opening outwards. Information was received from the bow door designer, Messrs. von Tell, which stated in their telex dated 18 March 1980 to the local Bureau Veritas office in Hamburg that they had designed according to the Lloyd's Register rules.«
What actually happened during the approval phase of the relevant drawings concerning the bow visor and the locking devices is already explained in Subchapter 2.4.2, but is also demonstrated by the approval dates of those drawings, i.e.
| Drawing No. | Subject | Date of approval | Whereabouts of vessel |
| 1103 | - Bow visor | 20.06.80 | yard trials |
| 1106 | - Interlock of bow visor | 20.06.80 | yard trials |
| 49111-373 | - Atlantic Lock | 02.07.80 | vessel already in Finland |
| 49111-372 |
- Automatic and manual locking devices of bow visor |
02.07.80 | vessel already in Finland |
Actually the senior B.V. surveyor G.Lohmann, entrusted with the newbuilding supervision of DIANA II / VIKING SALLY and also with their predeces-sors, had accepted the bow visor in its entirety already on 20.06.80 by his signature on the Receipt/Transfer Certificate (Enclosure <IP_ADDRESS>).
In their letter to the JAIC dated 10.01.95 (Enclosure <IP_ADDRESS>) B.V. also draws the attention to the remarks made in red on drawings 1103 and 49111-330, i.e.
on drawing 1103 - Bow Visor - : Remarks on the drawing
»1. Arrangements of locking devices subject to the approval of the national Authorities.
2. Watertightness of the ramp and local reinforcements of the ship's structures in way of locking devices, cylinders and hinges to Surveyor's satisfaction.
3. Jack lifting eye on arms, atlantic lock eye, side lock eyes, requested in steel grade St52-3.
4. Local reinforcements requested and indicated under the side locks active in y-direction (transverse).«As stated above, this drawing was approved only on 20.06.80 - the day the vessel went out for trials - thus shortly before her delivery - and returned to the Yard subsequently, and it is indeed the question of what use such remarks are if they are made on drawings which are returned to the Yard only after the vessel has already left.
This is slightly different with the von Tell drawing 49111-330 - General Arrangement of Bow Visor and Bow Ramp - which was approved already on 05.11.79 and subsequently returned to von Tell with the following remarks in red:
»1. Arrangement of locking devices and protection against shifting cargoes subject to the approval of the National Authorities.
2. Watertightness of the ramp and bow visor to Surveyor's satisfaction.
3. Local reinforcement of the ship's structure in way of - locking devices - cylinders - hinges to Surveyor's satisfaction.
4. High pressure flexible pipes must be approved by B.V.«B.V.'s explanation for these remarks in their letter of 10.01.95:
»By the remark concerning the National Authorities it was made clear that locking devices were considered as an item subject to the examination and approval of the Finnish Authorities issuing the Passenger Ship Safety Certificate of the vessel.«
In order to obtain clarification how this was actually to be interpreted the official opinion of B.V. was requested via their Stockholm lawyer - Bengt-Åke Johnson - who has commented as follows:
»With regard to the wording in German on the drawing 590/1103 to which you refer in your fax of 20 February 1995, I have learned that Bureau Veritas inserted the wording just to clarify that the approval of Bureau Veritas did only concern the parts of the construction that were covered by the rules of Bureau Veritas then applicable in 1979 and that Bureau Veritas made the remark on the drawings in order to remove doubts and to direct the attention of the shipyard and the Finnish authorities to the fact that the locking devices were to be considered and approved by the Finnish authorities. Accordingly, Bureau Veritas approved the drawings to the extent the arrangements were generally complying with the Bureau Veritas rules, but wanted to draw the attention of the shipyard and the Finnish authorities to the fact, that Bureau Veritas could not approve something, i.e. the locking devices, which were not specifically covered by Bureau Veritas' rules of 1979.«
It is quite obvious by the remark quoted above in their letter to the JAIC of 10.01.95, as well as by the comments of Bengt-Åke Johnson, that B.V. wants to create the impression that the final approval of the locking devices is the responsibility of the National Maritime Administration, i.e. the F.B.N., because they issue the Passenger Ship Safety Certificate.
As a result of this investigation it has to concluded that this is wrong because
(a) Rule 3 of the 1977 B.V. Rules requires, among others, that "Doors ... have to be firmly secured by use of cleats conventionally spaced or other similar devices." It reveals from the B.V. letter to the JAIC dated 10.01.95 - Enclosure <IP_ADDRESS> - that cleats = cleating = locking devices consequently the locking devices of the bow door = visor were part of the B.V. approval;
(b) B.V. had anyway to carry out the approval even if it would have been the responsibility of the F.B.N., because it was a "structural matter" which B.V. had to carry out on behalf of F.B.N. due to the respective contract between the organisations. - See also Subchapter 2.4.4.The above is confirmed by the acting of B.V. surveyor Lohmann as well as by the statement of the principal surveyor of the B.V. Stockholm office, Lars-Olof Ålander, according to which he felt responsible for the locking devices and sensors. - See Enclosure 9.1.134.
Futhermore the B.V. head office was asked to explain by what means, for example, could a plan approver make sure that a "door", i.e. bow visor, would be "firmly secured by use of cleats", i.e. locking devices, dimensioned as per drawing which he is asked to approve? The answer was that B.V. relied on the design office (von Tell AB) and the Yard, respectively their calculations, but made no own calculations.
This means that the relevant drawings were approved on basis of the von Tell AB calculations carried out according to the Lloyd's Register requirements, the result of which was submitted to BV-Hamburg by telex of 18.03.80 (Enclosure <IP_ADDRESS>). The Yard carried out own calculations with about the same result. Consequently both the Yard and its subcontractor individually performed calculations, whilst B.V. and F.B.N. did not.
The B.V. head office was further asked by what means did the B.V. surveyor on site make sure that the Yard/von Tell installed locking devices according to the approved drawings. The answer: »By random inspections.«
Upon request of the B.V. head office after the ESTONIA catastrophe the senior B.V. surveyor G.Lohmann wrote down the remarks made in his notebook during the newbuilding phase in relation to the bow visor (with English translation made by himself indicating what he would like to have noted) - see Enclosure <IP_ADDRESS>
Actually the only notes he made in respect of the bow visor were:
28.03.80 -
"Bugklappenanschluß an Hinterkante" by G.Lo., i.e. "Connection of bow visor to aft part" but was translated by Lohmann with:
"Inspection of hull construction according to the remarks made on drawings of Messrs. Tell during approval." The only von Tell drawing he could have had by then was 49111-330 - "General Arrangement of Bow Visor and Bow Ramp" which shows details of the bow ramp hinges only. Actually it has to be assumed that the remark in the notebook: "Connection of bow visor to aft part" refers to connecting the visor to the vessel, i.e. fitting the hinges together which was done at about that time.
23.04.80 -
"Allgemeine Besichtigung Freibord" by J.D. = J.Drazenowic (the assistant to G.Lohmann), i.e. "General Freeboard Survey" which was translated by G.Lohmann with:
"Checking of closing arrangements for the Freeboard Report Form Mod. 195."
This Freeboard Survey was apparently carried out as a result of the "Application for an International Freeboard Certificate" (Enclosure <IP_ADDRESS>) dated 21.04.1980.
The respective Report on Form 195 is attached as Enclosure <IP_ADDRESS>.
11.06.80 -
"Kontrolle der Seitenhäuser vorn and achtern sowie des achteren Mittelhauses auf dem Hauptdeck - Geringe Restarbeiten"
i.e. "Control of side houses forward and aft as well as the aft centre casing on main deck - minor remaining work", which is translated as:
"Checkings in way of car deck forward including bow ramp and bow visor - resting and connection."
Actually the side houses forward and aft at both sides are the B-deck spaces between A-deck and C-deck which contain stairways, chain lockers, but also the void spaces from which the manual side locks can be operated and where the hydraulic side locks are located.
26.06.80 -
"Fortsetzung des Programms vom 25. Juni 1980 in See, u.a. Kontrolle des Bugvisiers", i.e.
"At sea, continuing the program from 25 June 1980, among other things, bow visor", which is translated as:
"During trials at sea under normal running conditions the space between bow visor and bow ramp has been inspected for tightness."In this respect reference is also made to the statement of G.Todsen - Enclosure <IP_ADDRESS> - where this check is explained in detail.
The extracts from G.Lohmann's notebook closes with the Note:
»For inspections, tests, and trials yard protocols are made from the yard and signed by the parties concerned.«
Both surveyors - G.Lohmann and J.Drazenowic - were then the Oldenburg Field office of B.V..
As the signed statement of G.Lohmann made to this 'Group of Experts' has not been returned by B.V. and thus cannot be made an enclosure to this report, his career and involvement in Meyer Werft newbuildings including VIKING SALLY shall be outlined as follows:
Günther Lohmann was born in 1929 and started his professional career in 1944 as shipbuilding apprentice with HDW-Hamburg and stayed with this yard until 1956.
On 01.05.1956 he started as consulting engineer with engineer H. Rössler VD at Oldenburg and carried out newbuilding inspection and superintendent work for various owners, also non-exclusive surveyor work for B.V. (expert adjoint N.E.) until end of December 1976. From 01.01.1977 he was senior surveyor and exclusive surveyor for B.V. in charge, i.e. responsible, for the Oldenburg office. His district extended from Cuxhaven to Bodenwerder and to the Dutch border, i.e. the Meyer Werft in Papenburg belonged to his area.
He remained in this position until the end of March 1994, whereafter he retired, however, was recommissioned shortly afterwards as a field surveyor.
In his capacity as senior surveyor of the BV-Oldenburg office he supervised to a varying extent the newbuildings APOLLO, DIANA, VIKING 1, 3, 4 & 5, DIANA II, and VIKING SALLY on behalf of Bureau Veritas. Over the years he developed a very good relationship to the responsible people of the Meyer Werft. This included for example the work force who used to consult him whenever they had technical questions to make matters acceptable to class. He also had close contact with representatives of the National Authorities as well as owners' representatives who, as far as VIKING SALLY is concerned, were members of the Johansson family, Captain Brunström, and chief engineer Lars Karlsson.
His main duties were to make sure that the vessels were built according to the approved drawings in relation to the rules and in accordance with sound workmanship.
In line with these activities he had also carefully inspected the construction of the bow visor of VIKING SALLY, its installation, fitting of hinges, and welding of bushings. Furthermore, he did attend the watertightness test before and during trials. He recalls having been in the inner side of the visor during trials out in the North Sea together with the von Tell representative, somebody from the owners and also from the Yard, when it was discovered at full speed that some water was leaking through the rubber packings. Consequently local adjustments of the rubber packings were considered necessary and were made after the return to Emden, whereafter a hose-test confirmed watertightness of the visor.
He has been shown various pictures of the visor hinges with severe burning marks as found after the casualty and confirmed that what is visible on the pictures would never have been accepted by him, because it does not conform to the standard workmanship of the Meyer Werft, and further, is not in agreement with what he had seen. This also relates to the visor lug. The vessel would never have left the Yard in this condition.
He drew attention to the fact that at the same time when VIKING SALLY was under construction the yard was also building tanks for gas tankers which he also inspected on behalf of B.V., in particular the welding seams, where the requirements are very strict. Frequently the same welders were working on VIKING SALLY as well as on the gas tanks. Therefore, he was known to have the tendency to overstress his requirements as to the quality of welding seams in general. He was sometimes criticised for applying the same standard when checking the quality of the welding seams for gas tanks and normal vessels such as VIKING SALLY.
As to the Atlantic lock he stated the same as he did above in respect of the hinges: The welding seams visible on the pictures shown to him would never have been accepted by him, because they do not conform to the standard workmanship of Meyer Werft which he did survey.
In summary, senior surveyor G.Lohmann and his assistant J.Drazenowic did carry out the newbuilding supervision, apparently as required and as necessary in good co-operation with yard workers, F.B.N. inspectors, and subcontractors, e.g. G.Todsen and H.Brandt representing von Tell AG. Reportedly they made sure by random checking that the vessel was built in accordance with the approved drawings, the requirements of the rules and the standard workmanship of Meyer Werft.
The Yard, as well as von Tell, were sending 4 copies of each drawing to be approved to BV-Hamburg of which
1 was returned with approval
1 was sent to head office Paris
1 was sent to Oldenburg office
1 was kept in Hamburg officeAs the B.V. surveyors were at the yard practically every day where they had their own office they also received drawings directly from the yard before these drawings were received from BV-Hamburg with the approval stamp.
Due to the fact that during the first weeks after contract signing it was generally assumed that the entire foreship area would be more or less identical to DIANA II lots of drawings were just copied and marked 590. This refers also to drawing 1106 - Interlock of Bow Visor - which shows the visor hinge construction on both sides of visor and vessel including the hinge plates. Also this drawing was taken over from DIANA II, consequently showed the hinge plate construction as installed on board this vessel, i.e. with 4 hinge plates each side on the vessel, each being 30 mm thick, i.e. in total 120 mm, with fixed bolts. (See attached photo showing DIANA II - Enclosure <IP_ADDRESS>) The drawing 1106 showing the above explained DIANA II construction was sent to BV-Hamburg for approval by letter of 07.11.79. Due to owners' wishes and with the consent of the B.V. surveyor, this hinge plate design was changed in December 1979 from 4 to 2 hinge plates of 60 mm thickness each, and the fixed bolts were changed to the floating-bolts system. In consequence the total thickness of 120 mm (initially 4 x 30 mm, subsequently 2 x 60 mm) remained unchanged (Enclosure <IP_ADDRESS>). Drawing 1106 and the respective detail drawings for production were changed on 02.01.80 as per Enclosure <IP_ADDRESS>.
The revised drawing 1106 was sent by letter of 09.01.80 (Enclosure <IP_ADDRESS>) to von Tell GmbH for approval and the same day to BV-Hamburg for approval (Enclosure <IP_ADDRESS>). Moreover the drawing was also handed over to Lohmann at the yard. The drawing was returned by von Tell already by letter of 15.01.80 without comments, i.e. approved.
B.V. returned the approved drawing 1106 only on 30.06.80 (approval date 20.06.80), but the approved drawing was the one sent on 07.11.79 for approval with the DIANA II version of hinge plates.
It has to be assumed that upon return of the approved drawing 1106 - at a time when the vessel had been fully accepted by the class, was delivered to owners and had left for the Baltic already - the yard just looked for the approval and put the drawing into the archive not noting that it was the wrong one which had been approved.
What happened inside the B.V. organisation is unknown to this 'Group of Experts', however, it is a fact that the B.V. surveyors at the yard were provided with a continuous stream of new drawings simultaneously with the drawings being sent to BV-Hamburg or elsewhere. Therefore, this 'Group of Experts' concludes that senior surveyor G.Lohmann must have had drawing 1106 in the VIKING SALLY version, latest when he inspected the "connection of the visor to the vessel" on 28.03.80 according to his notebook (Enclosure <IP_ADDRESS>) because there can be no doubt that a senior surveyor with the experience of G.Lohmann would have noted at once that there were just 2 instead of 4 hinge plates at each of the hinges unless he was aware of the changes and had the corrected drawing at hand.
Further reference is made to the letter of B.V. of 10.01.95 to the JAIC (Enclosure <IP_ADDRESS>) where on page 4
- The appraisal for the selection of material
- Survey during construction
- Survey of bow visor welds
- Issuance of Statutory Certificates,i.e. issued by B.V. and F.B.N. is commented. In this connection a "Summary of B.V. inspections during the newbuilding phase" is attached as Enclosure <IP_ADDRESS>.1.
On page 5, B.V. discusses the Monitoring of Bow Locking and states:
»Also in 1991-1992 the bow door and bow ramp control and monitoring devices were checked by the Finnish Authorities against the new IMO requirements.«
This is denied by the Finnish Authorities, i.e. the F.B.N., because in their opinion the locking devices of the visors are not their responsibility, but have to be looked after by the Classification Society (which was confirmed by the retired principal surveyor of the BV-Stockholm office - Lars Olof Ålander - see Enclosure <IP_ADDRESS>.2). This will be discussed in more detail in Subchapter 2.4.4. B.V. further discusses in their letter of 10.01.95 the "Bow door cleating and monitoring arrangements" and remarks with regard to the manual side locks:
»2 manually operated fasteners for heavy weather with limit switches on bolts (open and closed position).«
Since it was confirmed by ESTONIA's 2nd engineer Peeter Tüür in his statement dated 03.10.94 - Enclosure 12.5.183 - and also by the system engineer Henrik Sillaste and the motorman Tanel Moosaar during their interview on 10.03.95 - Enclosure <IP_ADDRESS>8 - that it was the boatswain's duty to close these manual side locks whenever heavy weather was forecasted, it has to be assumed that this was common knowledge to both crews of ESTONIA.
The statement of B.V., that these manually operated fasteners were connected to limit switches, however, does not refer to the newbuilding condition when such switches were not installed. It has to be assumed that B.V. either mixed up the limit switch for the indication "visor closed", which is installed in way of the port manual securing device or the limit switches were installed subsequently, which is unlikely. Also the following statement of B.V. is partly wrong:
»The overall cleating was surveyable from a mimic panel (red and green lamps for each cleating group) both at the local control station and on the navigating bridge; video monitoring of the car deck included a view of the ramp closure.«
The overall cleating, i.e. locking devices, was surveyable only from a mimic panel with red and green lamps for each cleating group located in the control station (control panel) on car deck behind the bow ramp but not on the navi-gating bridge. The panel on the bridge just showed one red/ one green each for visor and bow ramp, i.e. the green lamp went on only when the visor was closed and secured, i.e. all respective limit switches had contact. The same refers to the bow ramp, i.e. the ramp had to be pulled tight against the rubber packings, and all 4 securing bolts had to fully engage the mating pockets and contact the sensors; only then would the green lamp indicate the bow ramp being closed and secured.
Note:
According to the wiring diagram for the locking devices the sensors of the Atlantic lock were not connected to the bridge panel which thus initially showed "green" when the visor was closed and just the side locks were closed. According to Captain Haakan Karlsson this had been rectified in 1990/91 when the ferry was taken over by Silja Line.The remaining part of the B.V. letter refers to the time as ESTONIA and shall be discussed in the respective chapter.
After completion of the newbuilding and successful trial runs B.V. issued the class certificates and the vessel was assigned the class notations
I 3/3 E
XPassenger
Ferry
Deep Sea
ICE CLASS I A
X(AUT).
The class certificates for WASA KING ex SILJA STAR ex VIKING SALLY valid from July 1990 to July 1995 is attached as Enclosure <IP_ADDRESS>.
Upon issuance of the said certificate with the above class notation the then valid Rules of Bureau Veritas of 1980 did apply to VIKING SALLY. The Rules relevant for this investigation shall hereinafter be cited and, if required, be commented.
1 - 11 Principle of Classification
11 - Ships whose construction fully satisfies the requirements of the present Rules, or who are deemed to fulfil the requisite conditions of strength and safety, are registered with classification symbols, marks and notations.
12 - The classification symbols express the degree of confidence that the ship deserves.
13 - The marks and notations give some indication on the type of survey of construction, the type of service and navigation for which the ship has been classed, and the special arrangements or installations on board that add to the safety of the ship or cargo in specific conditions of operation.
14 - Classification symbols, marks and notations are assigned or confirmed after study of the survey reports drawn up by the Society's Surveyors and after consulting the Classification Committee.1 - 14 Rules and regulations
11 - The regulations set forth in these Rules cover ships used and loaded in a normal manner and having a qualified crew.
1 - 21 Classification symbols
11 - Classification symbols comprise the division number, rating fraction and equipment symbol. They are grouped together on certificates and in the Register before any other mark or notation.
Consequently the class symbol I 3/3 E etc. means the following:
I = "division number"
For division I ships Chapter 3 and following of the present Rules set forth the conditions for the construction and scantlings of the hull and the essential equipment relating to propulsion and safety. In the event that same construction or scantling requirements are not met but is deemed possible to enter the ship in the Register, she is classed with division II.3/3 = The rating fraction expresses the degree of confidence the ship deserves. Fraction 3/3 is assigned to ships in good condition (fraction 5/6 is assigned to ships in a less satisfactory condition).
E = The equipment symbol. It indicates that the ship's anchors and chain cables meet the applicable requirements of the present Rules.
X= This remark is assigned to ships built under the special survey of the Society in compliance with the requirements of the present Rules or any others deemed equivalent.
passenger ferry
= 41 - The service notations of passenger ships are as follows:
- passenger ships (navire à passagers) for ships intended to carry passengers in the meaning of the 1960 International Convention for the Safety of Life at Sea (SOLAS 1960), Chapter I, rule 2, paragraphs (e) and (f), when they meet the requirements of the present Rules.
- passenger ferry (transbordeur) for passenger ships, corresponding to the definition of the preceding paragraph, specially equipped to carry complete trains or vehicles with their loads shipped by rolling, when they meet the requirements of the present Rules and, in particular, those of section 11-4.Note: Section 11-4 deals with General - Hull structure - Car decks - Access.
deep sea
= This navigation notation is assigned to self-propelled or non-propelled ships and units which are capable of deep sea navigation, in any area and at any period of the year.
Ice Class IA
= Ship strengthened for navigation in severe ice conditions in accordance with the Finnish-Swedish Ice Class Rules 1971 and subsequent amendments.
This means, in summary, as to VIKING SALLY:
- The vessel met all conditions for the construction and scantlings of the hull and the essential components relating to propulsion and safety.
- The vessel was in good condition and deserved the highest degree of confidence.
- The ship's anchors and chain cables met the applicable requirements of the present Rules.
- The ship was built under the special survey of the Society in compliance with the requirements of the Rules in force.
- The ship was capable of deep sea navigation in any area and at any period of the year, i.e. the vessel might trade worldwide around the year.
- The ship was strengthened for navigation in severe ice conditions.As to bow doors Rule 11-4 requires the following:
21 - When the ship is equipped with a bow door, to allow access to garage, the collision bulkhead must have a removable part. This design is acceptable only above bulkhead deck and only if the removable part has a watertightness and a strength equivalent to those of fixed rule bulkhead. A movable access ramp may be used for this purpose.
22 - Scantlings of plating and stiffeners of a bow door are to be equivalent to those of adjacent shell structure.
This means that VIKING SALLY fully complied with the B.V. Rules for car/ passenger ferries and could - from the class point of view - have been traded worldwide all year round.


HLoopy¶
Welcome to the documentation for HLoopy, a python module for analyzing hysteresis loop data.
Contents
Examples¶
This module is largely based on the familiar numpy, pandas and matplotlib APIs we all know and love.
import hloopy as hlpy
# Here is a tsv datafile with 5 comment lines and 3 data columns
datapath = 'path/to/some/data.txt'
# Create an HLoop object, the wrapper around a datafile
hl = hlpy.HLoop(datapath, sep='\t', skiprows=5)
# Indicate which columns are the x and y data (stimulus and response).
hl.setas(x=0, y=1)
# Plotting the loop is easy:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
# Plot, with a few special params. All axes.plot() kwargs are allowed.
hl.plot(ax, ls='--', c='k')
plt.show()
plt.close()
# Now compute the coercivity, remanence and saturation:
from hlpy.extract import Coercivity, Remanence, Saturation
fig, ax = plt.subplots()
hl.plot(ax, ls='--', c='k')
extracts = (Coercivity, Remanence, Saturation)
for e in extracts:
e(hl).plot(ax)
plt.show()
plt.close()
# Use GridPlot() to plot many HLoops on a 2d-grid of axes
# An arbitrary number of extracts can be added to the plot.
from hloopy.plotters import GridPlot
hls = [HLoop(fpath) for fpath in fpath_list]
gp = GridPlot(self.hls, hideaxes=True, legend=True)
gp.extract(Coercivity, Remanence, Saturation)
gp.plot()
plt.close()
Custom Extracts¶
The easiest way to add an extract is to subclass hloolpy.ExtractBase
.
However, the only requirements for an extract are that it takes an
HLoopy.hloop
object when initialized (or called) and that the resulting
object has a .plot(ax, ...)
method.
Here is an example of a new extract that just finds the first point from the HLoop and plots a marker there. See the source for the Extract submodule for more complex examples.
from hloopy import HLoop
from hloopy.extract import ExtractBase
class VanillaExtract(ExtractBase):
def __init__(self, hloop, setting=10):
self.hloop = hloop
self.setting = 10
def plot(self, ax, **kwargs):
style = {'linestyle': 'none', 'marker': 'o'}
style.update(kwargs)
xpoint = hloop.x()[0]
ypoint = hloop.y()[0]
ax.plot(xpoint, ypoint, **style)
Custom Data Preprocessing¶
As is, the hloopy.HLoop
module only allows the x and y data to
be a column taken straight from a data file. Sometimes the need
arises to preprocess the data in some way, possibly merging
two or more columns from the data file. A simple subclass
of the HLoop
allows arbitrary preprocessing:
from hloopy import HLoop
class CustomHLoop(HLoop):
def x(self):
return self.custom_preprocessing(self._x())
def custom_preprocessing(self, arr):
# Do some stuff to arr...
return arr
Modifying the y preprocessing is exactly analogous. The HLoop._x()
method is what the default x()
function calls to get the x axis data:
class HLoop:
def x(self):
return self._x()
# (this is only a sketch of _x()...see code in hloop module)
def _x(self):
return self.df.ix[:, self.xcol]
Storing Frequently Used Custom Classes¶
(Not yet implemented)
Todo¶
- CLI - Copy mostly from sMOKE.py
- Stoner model module - Have this code in modelplotlib
- Write extracts to file.
- Extracts only plot. - Should take the output of a writer as it’s input
- pep8 everything
- .config class files
- Carefully avoid code that makes new copies of the columns in the original DataFrame.
- Memoize HLoop.x(), HLoop.y(). Actually, not really memoize, maybe just compute them once upon initialization. But I did want to allow x()/y() to take parameters, and in that case memoization would be the right thing...
- Gridplot NESW rotation of grid - Copy mostly from sMOKE
- Fix Remanence extract. It’s NaNing on the SOT data.
- ExtractWRiter docstring


Let's learn and share, yo
Two I've used:
Pull data from websites with a visual scraping tool
Makes Cold Email a bit easier
This is what I'm using to make this
It allows you to build presentations using HTML + Javascript
It also has a Visual Editor
Not a coder? Not a problem. There's a fully-featured visual editor for authoring these, try it out at http://slides.com.
Press ESC to enter the slide overview.
Hold down alt and click on any element to zoom in on it using zoom.js. Alt + click anywhere to zoom back out.
Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.
Hit the next arrow...
... to step through ...
... a fragmented slide.
There's different types of fragments, like:
grow
shrink
fade-out
current-visible
highlight-red
highlight-blue
You can select from different transitions, like:
None -
Fade -
Slide -
Convex -
Concave -
Zoom
reveal.js comes with a few themes built in:
Black (default) -
White -
League -
Sky -
Beige -
Simple
Serif -
Blood -
Night -
Moon -
Solarized
Set data-background="#dddddd"
on a slide to change the background color. All CSS color formats are supported.

Different background transitions are available via the backgroundTransition option. This one's called "zoom".
Reveal.configure({ backgroundTransition: 'zoom' })
You can override background transitions per-slide.

function linkify( selector ) {
if( supports3DTransforms ) {
var nodes = document.querySelectorAll( selector );
for( var i = 0, len = nodes.length; i < len; i++ ) {
var node = nodes[i];
if( !node.className ) {
node.className += ' roll';
}
}
}
}
Code syntax highlighting courtesy of highlight.js.
| Item | Value | Quantity |
|---|---|---|
| Apples | $1 | 7 |
| Lemonade | $2 | 18 |
| Bread | $3 | 2 |
These guys come in two forms, inline:
“The nice thing about standards is that there are so many to choose from”
and block:
“For years there has been a theory that millions of monkeys typing at random on millions of typewriters would reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.”
You can link between slides internally, like this.
There's a speaker view. It includes a timer, preview of the upcoming slide as well as your speaker notes.
Press the S key to try it out.
Presentations can be exported to PDF, here's an example:
Set data-state="something"
on a slide and "something"
will be added as a class to the document element when the slide is open.
Additionally custom events can be triggered on a per slide basis by binding to the data-state
name.
Reveal.addEventListener( 'customevent', function() {
console.log( '"customevent" has fired' );
} );
Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen.


--- layout: default --- {% assign today = page.date | date: '%s' %} {% assign start = page.startDate | date: '%s' %} {% assign secondsSince = today | minus: start %} {% assign hoursSince = secondsSince | divided_by: 60 | divided_by: 60 %} {% assign daysSince = hoursSince | divided_by: 24 | plus: 2 %}


--- layout: page category: section1 type: issue01 issue: 01 year: 200x DOI: xxx.xxx title: Multiauthor Article bio: [gagarin, tereshkova, ride, aldrin] description: "short description for metadata and twitter" media: - path: "issue01/section1/foldername/" default: filename.jpg ---
Abstract: your abstract here.
Keywords: keywords for metadata.


--- layout: page title: About header-img: "img/about-bg.png" ---
I am a Computer Science graduate who never developed the skills to pursue my dream of becoming a software developer. I am now going through the journey of acquiring these skills through FlatIron's Online Program.


{% extends "dashboard_layout.html" %} {% block junkview %}
Loading structure from server... It may take a while.


Name this pickup option
{{ $ctrl.errors.name }}
Set the offert days of this event with respect to the interval start.
Set a start minute for the pickup option.
Provide the pickup option with a duration in minutes.
Provide the pickup option with a time that indicates when the last modification to an event is possible.


All Classes
Course
CourseController
CourseRepository
CoursesService
CoursesServiceImpl
H2ServerConfiguration
Instructor
InstructorRepository
JustTheCount
SchoolsApplication
SchoolsApplicationTests
StudCourses
Student
StudentController
StudentRepository
StudentService
StudentServiceImpl
Swagger2Config


Food Rescue is committed to ending Indian food insecurity by directly transferring fresh, usable food that would have otherwise been thrown away from parties, farmers, grocers, restaurants, and other food industry sources to food insecure families throughout the India.
Whether you are a food donor, a volunteer food rescuer, or a receiving agency, the future of the food rescue movement fits in the palm of your hand.
Sir M Visvesvaraya Institute of Technology,
Krishnadevaraya Nagar, Hunasamaranahalli,
International Airport Road, Bangalore - 562157


Jorge Aragão is a Brazilian musician. Well known by his pan-Africanist compositions, such as Indentidade (Identity), Coisas de Pele (Skin Thing), Preto da Cor Preta (Black with Black Skin) and others.
Video
Lyrics [1]
We can smile, nothing else prevent us
You cannot run away from this skin thing
Thing that we feel, untying knots
We now know, not all good stuff is from abroad
It’s our song in the streets and bars
Brings us to reason, remembering Palmares
It was good to insist, composing and listening
Who can resist the force of our Pagodes
And if the Samba does, sleepy prisoner of our tom-toms
And a Banjo frees people from their emotions
Exciting even more the head of a composer
Eternal stronghold of peace, the spring of many types of love
[Chorus 2x]
Popular art born from our ground
It is our people who produce the concert and sign as directors
| [1] | http://letras.mus.br/jorge-aragao/69362/ |
comments powered by Disqus


Mortgage Calculator
Calculate Principal
Calculate Monthly
Calculate Length
Monthly
Rate
Length
Calculate
Principal
Principal
Rate
Length
Calculate
Monthly payment
Principal
Monthly
Rate
Calculate
Remaining Years


Attendance
The Constitution specifies that a majority of members constitutes a quorum to do business in each house. Representatives and senators rarely force the presence of a quorum by demanding quorum calls; thus, in most cases, debates continue even if a majority is not present.
>
The Senate uses roll-call votes; a clerk calls out the names of all the senators, each senator stating "aye" or "no" when his or her name is announced. The House reserves roll-call votes for the most formal matters, as a roll-call of all 435 representatives takes quite some time; normally, members vote by electronic device. In the case of a tie, the motion in question fails. In the Senate, the Vice President may (if present) cast the tiebreaking vote.
find your congressman


Pick your country and city from the dropdown boxes below.
Voting is YOUR choice.  YOU need to play a role in choosing our leaders and changing our laws by voting. Vote!


just a programmer!
I 🧔 am a full stack python and JavaScript Developer. I also like coffee but tean would also work.


ME
Suresh Ghimire
Co-founder
About : Us
Where did you studied?
Seto Bangla
Where did you studied?
Seto Bangla
Where did you studied?
Seto Bangla
Statistics :
first: 15%
second: 75%
third: 10%
We are mostly 2nd and 3rd
And we contribute
80%
What they leads to?
Founders
Innovators
Entrepreneur
Where are we?
What they Achieve?
They take Action
And We?
Act
Why?
No.. Because
Skill Based
And.
Fact Based
What karkhana brings to you?
Skill Based
Hands-on
Practical
Problem Solving
Where
@
What is maker movement?
electronics robotics
3-D printing CNC
metalworking woodworking
arts and crafts
SLide 1
hello world
We are makers.
Karkhana and maker?
We are an Education Company Started by Engineers
We have seen the maker culture and experienced it
Ask me?


Tools Used
HTML
CSS
JavaScript
Responsive Design
Flexbox
Tech Stack
Project Details
Goal: Create a wedding website that pulls in the colors from their Save the Dates and has an exceptional user experience.
Role: Designed mock-ups, coded the HTML, and stylized the CSS. As they move forward in their planning process, I will be completing the pages currrently marked as "Coming Soon".
Features: Features an elegant and simple layout that fits their wedding style and encompasses all the details the guests need to know for the wedding, utilized responsive design as many guests will view the website on many different platforms, and incorporated iframes for easy directions.
Challenges: The client wanted to ensure the website was easy to use on mobile, tablet and desktop and was also easy to use for the older generations that would be attending. By using responsive design I was able to stylize the website on all platforms creating a seamless user experience. Additionally I designed a simple layout making the website easy to navigate for the older generation who may not be as tech savy.


Album
Simple one-page template for photo galleries, portfolios, and more.
Pricing
Example pricing page built with Cards and featuring a custom header and footer.
Checkout
Custom checkout form showing our form components and their validation features.
Product
Lean product-focused marketing page with extensive grid and image work.
Cover
A one-page template for building simple and beautiful home pages.
Carousel
Customize the navbar and carousel, then add some new components.
Blog
Magazine like blog template with header, navigation, featured content.
Dashboard
Basic admin dashboard shell with fixed sidebar and navbar.
Sign-in
Custom form layout and design for a simple sign in form.
Sticky footer with fixed navbar (light)
Attach a footer to the bottom of the viewport with a fixed top navbar.
Sticky footer with fixed navbar (dark)
Attach a footer to the bottom of the viewport with a fixed top navbar.
Jumbotron
Build around the jumbotron with a navbar and some basic grid columns.
Content
Content examples.
Components
Components examples.


Highest accuracy of each type of order parameter with respect to ( a) the number of neighborhood particles, and ( b) the radius determining the neighborhood. The results are shown in three different graphs because they can be separated into three tendencies.


Functions to create and manipulate instructions. More...
Data Structures | |
| struct | _dr_instr_label_data_t |
Defines | |
| #define | EFLAGS_READ_CF 0x00000001 |
| #define | EFLAGS_READ_PF 0x00000002 |
| #define | EFLAGS_READ_AF 0x00000004 |
| #define | EFLAGS_READ_ZF 0x00000008 |
| #define | EFLAGS_READ_SF 0x00000010 |
| #define | EFLAGS_READ_TF 0x00000020 |
| #define | EFLAGS_READ_IF 0x00000040 |
| #define | EFLAGS_READ_DF 0x00000080 |
| #define | EFLAGS_READ_OF 0x00000100 |
| #define | EFLAGS_READ_NT 0x00000200 |
| #define | EFLAGS_READ_RF 0x00000400 |
| #define | EFLAGS_WRITE_CF 0x00000800 |
| #define | EFLAGS_WRITE_PF 0x00001000 |
| #define | EFLAGS_WRITE_AF 0x00002000 |
| #define | EFLAGS_WRITE_ZF 0x00004000 |
| #define | EFLAGS_WRITE_SF 0x00008000 |
| #define | EFLAGS_WRITE_TF 0x00010000 |
| #define | EFLAGS_WRITE_IF 0x00020000 |
| #define | EFLAGS_WRITE_DF 0x00040000 |
| #define | EFLAGS_WRITE_OF 0x00080000 |
| #define | EFLAGS_WRITE_NT 0x00100000 |
| #define | EFLAGS_WRITE_RF 0x00200000 |
| #define | EFLAGS_READ_ALL 0x000007ff |
| #define | EFLAGS_WRITE_ALL 0x003ff800 |
| #define | EFLAGS_READ_6 0x0000011f |
| #define | EFLAGS_WRITE_6 0x0008f800 |
| #define | EFLAGS_WRITE_TO_READ(x) ((x) >> 11) |
| #define | EFLAGS_READ_TO_WRITE(x) ((x) << 11) |
| #define | PREFIX_LOCK 0x1 |
| #define | PREFIX_JCC_NOT_TAKEN 0x2 |
| #define | PREFIX_JCC_TAKEN 0x4 |
Typedefs | |
| typedef struct _dr_instr_label_data_t | dr_instr_label_data_t |
Enumerations | |
| enum | { EFLAGS_CF = 0x00000001, EFLAGS_PF = 0x00000004, EFLAGS_AF = 0x00000010, EFLAGS_ZF = 0x00000040, EFLAGS_SF = 0x00000080, EFLAGS_DF = 0x00000400, EFLAGS_OF = 0x00000800 } |
Functions | |
| instr_t * | instr_create (void *drcontext) |
| void | instr_init (void *drcontext, instr_t *instr) |
| void | instr_free (void *drcontext, instr_t *instr) |
| void | instr_reset (void *drcontext, instr_t *instr) |
| void | instr_reuse (void *drcontext, instr_t *instr) |
| void | instr_destroy (void *drcontext, instr_t *instr) |
| instr_t * | instr_get_next (instr_t *instr) |
| instr_t * | instr_get_prev (instr_t *instr) |
| void | instr_set_next (instr_t *instr, instr_t *next) |
| void | instr_set_prev (instr_t *instr, instr_t *prev) |
| void * | instr_get_note (instr_t *instr) |
| void | instr_set_note (instr_t *instr, void *value) |
| app_pc | instr_get_branch_target_pc (instr_t *cti_instr) |
| void | instr_set_branch_target_pc (instr_t *cti_instr, app_pc pc) |
| bool | instr_is_exit_cti (instr_t *instr) |
| bool | instr_is_interrupt (instr_t *instr) |
| bool | instr_ok_to_mangle (instr_t *instr) |
| void | instr_set_ok_to_mangle (instr_t *instr, bool val) |
| void | instr_set_meta_no_translation (instr_t *instr) |
| bool | instr_ok_to_emit (instr_t *instr) |
| void | instr_set_ok_to_emit (instr_t *instr, bool val) |
| int | instr_length (void *drcontext, instr_t *instr) |
| bool | instr_is_encoding_possible (instr_t *instr) |
| byte * | instr_encode (void *drcontext, instr_t *instr, byte *pc) |
| byte * | instr_encode_to_copy (void *drcontext, instr_t *instr, byte *copy_pc, byte *final_pc) |
| int | instr_mem_usage (instr_t *instr) |
| instr_t * | instr_clone (void *drcontext, instr_t *orig) |
| instr_t * | instr_build (void *drcontext, int opcode, int num_dsts, int num_srcs) |
| instr_t * | instr_build_bits (void *drcontext, int opcode, uint num_bytes) |
| bool | instr_valid (instr_t *instr) |
| app_pc | instr_get_app_pc (instr_t *instr) |
| int | instr_get_opcode (instr_t *instr) |
| void | instr_set_opcode (instr_t *instr, int opcode) |
| int | instr_num_srcs (instr_t *instr) |
| int | instr_num_dsts (instr_t *instr) |
| void | instr_set_num_opnds (void *drcontext, instr_t *instr, int num_dsts, int num_srcs) |
| opnd_t | instr_get_src (instr_t *instr, uint pos) |
| opnd_t | instr_get_dst (instr_t *instr, uint pos) |
| void | instr_set_src (instr_t *instr, uint pos, opnd_t opnd) |
| void | instr_set_dst (instr_t *instr, uint pos, opnd_t opnd) |
| opnd_t | instr_get_target (instr_t *cti_instr) |
| void | instr_set_target (instr_t *cti_instr, opnd_t target) |
| bool | instr_operands_valid (instr_t *instr) |
| void | instr_set_operands_valid (instr_t *instr, bool valid) |
| bool | instr_opcode_valid (instr_t *instr) |
| uint | instr_get_eflags (instr_t *instr) |
| uint | instr_get_opcode_eflags (int opcode) |
| uint | instr_get_arith_flags (instr_t *instr) |
| void | instr_set_raw_bits (instr_t *instr, byte *addr, uint length) |
| void | instr_set_raw_bits_valid (instr_t *instr, bool valid) |
| bool | instr_raw_bits_valid (instr_t *instr) |
| bool | instr_has_allocated_bits (instr_t *instr) |
| bool | instr_needs_encoding (instr_t *instr) |
| bool | instr_is_meta_may_fault (instr_t *instr) |
| void | instr_set_meta_may_fault (instr_t *instr, bool val) |
| void | instr_allocate_raw_bits (void *drcontext, instr_t *instr, uint num_bytes) |
| instr_t * | instr_set_translation (instr_t *instr, app_pc addr) |
| void | instr_make_persistent (void *drcontext, instr_t *instr) |
| byte * | instr_get_raw_bits (instr_t *instr) |
| void | instr_free_raw_bits (void *drcontext, instr_t *instr) |
| byte | instr_get_raw_byte (instr_t *instr, uint pos) |
| void | instr_set_raw_byte (instr_t *instr, uint pos, byte byte) |
| void | instr_set_raw_bytes (instr_t *instr, byte *start, uint num_bytes) |
| void | instr_set_raw_word (instr_t *instr, uint pos, uint word) |
| uint | instr_get_raw_word (instr_t *instr, uint pos) |
| instr_t * | instr_set_prefix_flag (instr_t *instr, uint prefix) |
| bool | instr_get_prefix_flag (instr_t *instr, uint prefix) |
| void | instr_set_x86_mode (instr_t *instr, bool x86) |
| bool | instr_get_x86_mode (instr_t *instr) |
| void | instr_shrink_to_16_bits (instr_t *instr) |
| void | instr_shrink_to_32_bits (instr_t *instr) |
| bool | instr_uses_reg (instr_t *instr, reg_id_t reg) |
| bool | instr_uses_fp_reg (instr_t *instr) |
| bool | instr_reg_in_src (instr_t *instr, reg_id_t reg) |
| bool | instr_reg_in_dst (instr_t *instr, reg_id_t reg) |
| bool | instr_writes_to_reg (instr_t *instr, reg_id_t reg) |
| bool | instr_reads_from_reg (instr_t *instr, reg_id_t reg) |
| bool | instr_writes_to_exact_reg (instr_t *instr, reg_id_t reg) |
| bool | instr_replace_src_opnd (instr_t *instr, opnd_t old_opnd, opnd_t new_opnd) |
| bool | instr_same (instr_t *instr1, instr_t *instr2) |
| bool | instr_reads_memory (instr_t *instr) |
| bool | instr_writes_memory (instr_t *instr) |
| bool | instr_has_rel_addr_reference (instr_t *instr) |
| bool | instr_get_rel_addr_target (instr_t *instr, app_pc *target) |
| int | instr_get_rel_addr_dst_idx (instr_t *instr) |
| int | instr_get_rel_addr_src_idx (instr_t *instr) |
| app_pc | instr_compute_address (instr_t *instr, dr_mcontext_t *mc) |
| bool | instr_compute_address_ex (instr_t *instr, dr_mcontext_t *mc, uint index, OUT app_pc *addr, OUT bool *write) |
| bool | instr_compute_address_ex_pos (instr_t *instr, dr_mcontext_t *mc, uint index, OUT app_pc *addr, OUT bool *is_write, OUT uint *pos) |
| uint | instr_memory_reference_size (instr_t *instr) |
| dr_instr_label_data_t * | instr_get_label_data_area (instr_t *instr) |
| bool | instr_is_mov (instr_t *instr) |
| bool | instr_is_call (instr_t *instr) |
| bool | instr_is_call_direct (instr_t *instr) |
| bool | instr_is_call_indirect (instr_t *instr) |
| bool | instr_is_return (instr_t *instr) |
| bool | instr_is_cti (instr_t *instr) |
| bool | instr_is_cti_short (instr_t *instr) |
| bool | instr_is_cti_loop (instr_t *instr) |
| bool | instr_is_cti_short_rewrite (instr_t *instr, byte *pc) |
| bool | instr_is_cbr (instr_t *instr) |
| bool | instr_is_mbr (instr_t *instr) |
| bool | instr_is_ubr (instr_t *instr) |
| bool | instr_is_far_cti (instr_t *instr) |
| bool | instr_is_far_abs_cti (instr_t *instr) |
| bool | instr_is_syscall (instr_t *instr) |
| bool | instr_is_wow64_syscall (instr_t *instr) |
| bool | instr_is_prefetch (instr_t *instr) |
| bool | instr_is_mov_constant (instr_t *instr, ptr_int_t *value) |
| bool | instr_is_floating (instr_t *instr) |
| bool | instr_is_mmx (instr_t *instr) |
| bool | instr_is_sse_or_sse2 (instr_t *instr) |
| bool | instr_is_mov_imm_to_tos (instr_t *instr) |
| bool | instr_is_label (instr_t *instr) |
| bool | instr_is_undefined (instr_t *instr) |
| int | instr_get_interrupt_number (instr_t *instr) |
| void | instr_invert_cbr (instr_t *instr) |
| instr_t * | instr_convert_short_meta_jmp_to_long (void *drcontext, instrlist_t *ilist, instr_t *instr) |
| bool | instr_jcc_taken (instr_t *instr, reg_t eflags) |
| int | instr_cmovcc_to_jcc (int cmovcc_opcode) |
| bool | instr_cmovcc_triggered (instr_t *instr, reg_t eflags) |
| bool | instr_is_nop (instr_t *instr) |
| instr_t * | instr_create_0dst_0src (void *drcontext, int opcode) |
| instr_t * | instr_create_0dst_1src (void *drcontext, int opcode, opnd_t src) |
| instr_t * | instr_create_0dst_2src (void *drcontext, int opcode, opnd_t src1, opnd_t src2) |
| instr_t * | instr_create_0dst_3src (void *drcontext, int opcode, opnd_t src1, opnd_t src2, opnd_t src3) |
| instr_t * | instr_create_1dst_0src (void *drcontext, int opcode, opnd_t dst) |
| instr_t * | instr_create_1dst_1src (void *drcontext, int opcode, opnd_t dst, opnd_t src) |
| instr_t * | instr_create_1dst_2src (void *drcontext, int opcode, opnd_t dst, opnd_t src1, opnd_t src2) |
| instr_t * | instr_create_1dst_3src (void *drcontext, int opcode, opnd_t dst, opnd_t src1, opnd_t src2, opnd_t src3) |
| instr_t * | instr_create_1dst_5src (void *drcontext, int opcode, opnd_t dst, opnd_t src1, opnd_t src2, opnd_t src3, opnd_t src4, opnd_t src5) |
| instr_t * | instr_create_2dst_0src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2) |
| instr_t * | instr_create_2dst_1src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t src) |
| instr_t * | instr_create_2dst_2src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t src1, opnd_t src2) |
| instr_t * | instr_create_2dst_3src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t src1, opnd_t src2, opnd_t src3) |
| instr_t * | instr_create_2dst_4src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t src1, opnd_t src2, opnd_t src3, opnd_t src4) |
| instr_t * | instr_create_3dst_0src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t dst3) |
| instr_t * | instr_create_3dst_3src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t dst3, opnd_t src1, opnd_t src2, opnd_t src3) |
| instr_t * | instr_create_3dst_4src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t dst3, opnd_t src1, opnd_t src2, opnd_t src3, opnd_t src4) |
| instr_t * | instr_create_3dst_5src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t dst3, opnd_t src1, opnd_t src2, opnd_t src3, opnd_t src4, opnd_t src5) |
| instr_t * | instr_create_4dst_1src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t dst3, opnd_t dst4, opnd_t src) |
| instr_t * | instr_create_4dst_4src (void *drcontext, int opcode, opnd_t dst1, opnd_t dst2, opnd_t dst3, opnd_t dst4, opnd_t src1, opnd_t src2, opnd_t src3, opnd_t src4) |
| instr_t * | instr_create_popa (void *drcontext) |
| instr_t * | instr_create_pusha (void *drcontext) |
| void | instr_disassemble (void *drcontext, instr_t *instr, file_t outfile) |
| size_t | instr_disassemble_to_buffer (void *drcontext, instr_t *instr, char *buf, size_t bufsz) |
Functions to create and manipulate instructions.
| #define EFLAGS_READ_6 0x0000011f |
Reads all 6 arithmetic flags (CF, PF, AF, ZF, SF, OF).
| #define EFLAGS_READ_AF 0x00000004 |
Reads AF (Auxiliary Carry Flag).
| #define EFLAGS_READ_ALL 0x000007ff |
Reads all flags.
| #define EFLAGS_READ_CF 0x00000001 |
Reads CF (Carry Flag).
| #define EFLAGS_READ_DF 0x00000080 |
Reads DF (Direction Flag).
| #define EFLAGS_READ_IF 0x00000040 |
Reads IF (Interrupt Enable Flag).
| #define EFLAGS_READ_NT 0x00000200 |
Reads NT (Nested Task).
| #define EFLAGS_READ_OF 0x00000100 |
Reads OF (Overflow Flag).
| #define EFLAGS_READ_PF 0x00000002 |
Reads PF (Parity Flag).
| #define EFLAGS_READ_RF 0x00000400 |
Reads RF (Resume Flag).
| #define EFLAGS_READ_SF 0x00000010 |
Reads SF (Sign Flag).
| #define EFLAGS_READ_TF 0x00000020 |
Reads TF (Trap Flag).
| #define EFLAGS_READ_TO_WRITE | ( | x | ) | ((x) << 11) |
Converts an EFLAGS_READ_* value to the corresponding EFLAGS_WRITE_* value.
| #define EFLAGS_READ_ZF 0x00000008 |
Reads ZF (Zero Flag).
| #define EFLAGS_WRITE_6 0x0008f800 |
Writes all 6 arithmetic flags (CF, PF, AF, ZF, SF, OF).
| #define EFLAGS_WRITE_AF 0x00002000 |
Writes AF (Auxiliary Carry Flag).
| #define EFLAGS_WRITE_ALL 0x003ff800 |
Writes all flags.
| #define EFLAGS_WRITE_CF 0x00000800 |
Writes CF (Carry Flag).
| #define EFLAGS_WRITE_DF 0x00040000 |
Writes DF (Direction Flag).
| #define EFLAGS_WRITE_IF 0x00020000 |
Writes IF (Interrupt Enable Flag).
| #define EFLAGS_WRITE_NT 0x00100000 |
Writes NT (Nested Task).
| #define EFLAGS_WRITE_OF 0x00080000 |
Writes OF (Overflow Flag).
| #define EFLAGS_WRITE_PF 0x00001000 |
Writes PF (Parity Flag).
| #define EFLAGS_WRITE_RF 0x00200000 |
Writes RF (Resume Flag).
| #define EFLAGS_WRITE_SF 0x00008000 |
Writes SF (Sign Flag).
| #define EFLAGS_WRITE_TF 0x00010000 |
Writes TF (Trap Flag).
| #define EFLAGS_WRITE_TO_READ | ( | x | ) | ((x) >> 11) |
Converts an EFLAGS_WRITE_* value to the corresponding EFLAGS_READ_* value.
| #define EFLAGS_WRITE_ZF 0x00004000 |
Writes ZF (Zero Flag).
| #define PREFIX_JCC_NOT_TAKEN 0x2 |
Branch hint: conditional branch is taken.
| #define PREFIX_JCC_TAKEN 0x4 |
Branch hint: conditional branch is not taken.
| #define PREFIX_LOCK 0x1 |
Makes the instruction's memory accesses atomic.
| typedef struct _dr_instr_label_data_t dr_instr_label_data_t |
Data slots available in a label (instr_create_label()) instruction for storing client-controlled data. Accessible via instr_get_label_data_area().
| anonymous enum |
The actual bits in the eflags register that we care about:
11 10 9 8 7 6 5 4 3 2 1 0 OF DF SF ZF AF PF CF
| void instr_allocate_raw_bits | ( | void * | drcontext, | |
| instr_t * | instr, | |||
| uint | num_bytes | |||
| ) |
Allocates num_bytes
of memory for instr's
raw bits. If instr
currently points to raw bits, the allocated memory is initialized with the bytes pointed to. instr
is then set to point to the allocated memory.
| instr_t* instr_build | ( | void * | drcontext, | |
| int | opcode, | |||
| int | num_dsts, | |||
| int | num_srcs | |||
| ) |
Convenience routine: calls
and returns the resulting instr_t.
| instr_t* instr_build_bits | ( | void * | drcontext, | |
| int | opcode, | |||
| uint | num_bytes | |||
| ) |
Convenience routine: calls
and returns the resulting instr_t.
Returns a copy of orig
with separately allocated memory for operands and raw bytes if they were present in orig
. Cloning an instruction with a non-zero note
field is not supported.
| int instr_cmovcc_to_jcc | ( | int | cmovcc_opcode | ) |
Converts a cmovcc opcode cmovcc_opcode
to the OP_jcc opcode that tests the same bits in eflags.
| bool instr_cmovcc_triggered | ( | instr_t * | instr, | |
| reg_t | eflags | |||
| ) |
Given eflags
, returns whether or not the conditional move instruction instr
would execute the move. The conditional move can be an OP_cmovcc or an OP_fcmovcc instruction.
| app_pc instr_compute_address | ( | instr_t * | instr, | |
| dr_mcontext_t * | mc | |||
| ) |
Returns NULL if none of instr's
operands is a memory reference. Otherwise, returns the effective address of the first memory operand when the operands are considered in this order: destinations and then sources. The address is computed using the passed-in registers. mc->flags
must include DR_MC_CONTROL and DR_MC_INTEGER.
| bool instr_compute_address_ex | ( | instr_t * | instr, | |
| dr_mcontext_t * | mc, | |||
| uint | index, | |||
| OUT app_pc * | addr, | |||
| OUT bool * | write | |||
| ) |
Performs address calculation in the same manner as instr_compute_address() but handles multiple memory operands. The index
parameter should be initially set to 0 and then incremented with each successive call until this routine returns false, which indicates that there are no more memory operands. The address of each is computed in the same manner as instr_compute_address() and returned in addr
; whether it is a write is returned in is_write
. Either or both OUT variables can be NULL. mc->flags
must include DR_MC_CONTROL and DR_MC_INTEGER.
| bool instr_compute_address_ex_pos | ( | instr_t * | instr, | |
| dr_mcontext_t * | mc, | |||
| uint | index, | |||
| OUT app_pc * | addr, | |||
| OUT bool * | is_write, | |||
| OUT uint * | pos | |||
| ) |
Performs address calculation in the same manner as instr_compute_address_ex() with additional information of which opnd is used for address computation returned in pos
. If pos
is NULL, it is the same as instr_compute_address_ex().
| instr_t* instr_convert_short_meta_jmp_to_long | ( | void * | drcontext, | |
| instrlist_t * | ilist, | |||
| instr_t * | instr | |||
| ) |
Assumes that instr is a meta instruction (!instr_ok_to_mangle()) and an instr_is_cti_short() (8-bit reach). Converts instr's opcode to a long form (32-bit reach). If instr's opcode is OP_loop* or OP_jecxz, converts it to a sequence of multiple instructions (which is different from instr_is_cti_short_rewrite()). Each added instruction is marked !instr_ok_to_mangle(). Returns the long form of the instruction, which is identical to instr
unless instr
is OP_loop* or OP_jecxz, in which case the return value is the final instruction in the sequence, the one that has long reach.
| instr_t* instr_create | ( | void * | drcontext | ) |
| instr_t* instr_create_0dst_0src | ( | void * | drcontext, | |
| int | opcode | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
and no sources or destinations.
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
and a single source (src
).
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
and two sources (src1
, src2
).
| instr_t* instr_create_0dst_3src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
and three sources (src1
, src2
, src3
).
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
and one destination (dst
).
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, one destination(dst
), and one source (src
).
| instr_t* instr_create_1dst_2src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst, | |||
| opnd_t | src1, | |||
| opnd_t | src2 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, one destination (dst
), and two sources (src1
, src2
).
| instr_t* instr_create_1dst_3src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, one destination (dst
), and three sources (src1
, src2
, src3
).
| instr_t* instr_create_1dst_5src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3, | |||
| opnd_t | src4, | |||
| opnd_t | src5 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, one destination (dst
), and five sources (src1
, src2
, src3
, src4
, src5
).
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, two destinations (dst1
, dst2
) and no sources.
| instr_t* instr_create_2dst_1src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | src | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, two destinations (dst1
, dst2
) and one source (src
).
| instr_t* instr_create_2dst_2src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | src1, | |||
| opnd_t | src2 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, two destinations (dst1
, dst2
) and two sources (src1
, src2
).
| instr_t* instr_create_2dst_3src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, two destinations (dst1
, dst2
) and three sources (src1
, src2
, src3
).
| instr_t* instr_create_2dst_4src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3, | |||
| opnd_t | src4 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, two destinations (dst1
, dst2
) and four sources (src1
, src2
, src3
, src4
).
| instr_t* instr_create_3dst_0src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | dst3 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, three destinations (dst1
, dst2
, dst3
) and no sources.
| instr_t* instr_create_3dst_3src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | dst3, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, three destinations (dst1
, dst2
, dst3
) and three sources (src1
, src2
, src3
).
| instr_t* instr_create_3dst_4src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | dst3, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3, | |||
| opnd_t | src4 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, three destinations (dst1
, dst2
, dst3
) and four sources (src1
, src2
, src3
, src4
).
| instr_t* instr_create_3dst_5src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | dst3, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3, | |||
| opnd_t | src4, | |||
| opnd_t | src5 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, three destinations (dst1
, dst2
, dst3
) and five sources (src1
, src2
, src3
, src4
, src5
).
| instr_t* instr_create_4dst_1src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | dst3, | |||
| opnd_t | dst4, | |||
| opnd_t | src | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, four destinations (dst1
, dst2
, dst3
, dst4
) and 1 source (src
).
| instr_t* instr_create_4dst_4src | ( | void * | drcontext, | |
| int | opcode, | |||
| opnd_t | dst1, | |||
| opnd_t | dst2, | |||
| opnd_t | dst3, | |||
| opnd_t | dst4, | |||
| opnd_t | src1, | |||
| opnd_t | src2, | |||
| opnd_t | src3, | |||
| opnd_t | src4 | |||
| ) |
Convenience routine that returns an initialized instr_t allocated on the thread-local heap with opcode opcode
, four destinations (dst1
, dst2
, dst3
, dst4
) and four sources (src1
, src2
, src3
, src4
).
| instr_t* instr_create_popa | ( | void * | drcontext | ) |
Convenience routine that returns an initialized instr_t for OP_popa.
| instr_t* instr_create_pusha | ( | void * | drcontext | ) |
Convenience routine that returns an initialized instr_t for OP_pusha.
| void instr_destroy | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Performs instr_free() and then deallocates the thread-local heap storage for instr
.
| void instr_disassemble | ( | void * | drcontext, | |
| instr_t * | instr, | |||
| file_t | outfile | |||
| ) |
Prints the instruction instr
to file outfile
. Does not print address-size or data-size prefixes for other than just-decoded instrs, and does not check that the instruction has a valid encoding. Prints each operand with leading zeros indicating the size. The default is to use AT&T-style syntax, unless the -syntax_intel runtime option is specified.
| size_t instr_disassemble_to_buffer | ( | void * | drcontext, | |
| instr_t * | instr, | |||
| char * | buf, | |||
| size_t | bufsz | |||
| ) |
Prints the instruction instr
to the buffer buf
. Always null-terminates, and will not print more than bufsz
characters, which includes the final null character. Returns the number of characters printed, not including the final null.
Does not print address-size or data-size prefixes for other than just-decoded instrs, and does not check that the instruction has a valid encoding. Prints each operand with leading zeros indicating the size. The default is to use AT&T-style syntax, unless the -syntax_intel runtime option is specified.
| byte* instr_encode | ( | void * | drcontext, | |
| instr_t * | instr, | |||
| byte * | pc | |||
| ) |
Encodes instr
into the memory at pc
. Uses the x86/x64 mode stored in instr, not the mode of the current thread. Returns the pc after the encoded instr, or NULL if the encoding failed. If instr is a cti with an instr_t target, the note fields of instr and of the target must be set with the respective offsets of each instr_t! (instrlist_encode does this automatically, if the target is in the list). x86 instructions can occupy up to 17 bytes, so the caller should ensure the target location has enough room to avoid overflow.
| byte* instr_encode_to_copy | ( | void * | drcontext, | |
| instr_t * | instr, | |||
| byte * | copy_pc, | |||
| byte * | final_pc | |||
| ) |
Encodes instr
into the memory at copy_pc
in preparation for copying to final_pc
. Any pc-relative component is encoded as though the instruction were located at final_pc
. This allows for direct copying of the encoded bytes to final_pc
without re-relativization.
Uses the x86/x64 mode stored in instr, not the mode of the current thread. Returns the pc after the encoded instr, or NULL if the encoding failed. If instr is a cti with an instr_t target, the note fields of instr and of the target must be set with the respective offsets of each instr_t! (instrlist_encode does this automatically, if the target is in the list). x86 instructions can occupy up to 17 bytes, so the caller should ensure the target location has enough room to avoid overflow.
| void instr_free | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Deallocates all memory that was allocated by instr
. This includes raw bytes allocated by instr_allocate_raw_bits() and operands allocated by instr_set_num_opnds(). Does not deallocate the storage for instr
itself.
| void instr_free_raw_bits | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
If instr
has raw bits allocated, frees them.
| app_pc instr_get_app_pc | ( | instr_t * | instr | ) |
Get the original application PC of instr
if it exists.
| uint instr_get_arith_flags | ( | instr_t * | instr | ) |
Returns instr's
arithmetic flags (bottom 6 eflags) use as EFLAGS_ constants or'ed together. If instr's
eflags behavior has not been calculated yet or is invalid, the entire eflags use is calculated and returned (not just the arithmetic flags).
| app_pc instr_get_branch_target_pc | ( | instr_t * | cti_instr | ) |
Return the taken target pc of the (direct branch) instruction.
Returns instr's
destination operand at position pos
(0-based).
| uint instr_get_eflags | ( | instr_t * | instr | ) |
Returns instr's
eflags use as EFLAGS_ constants or'ed together.
| int instr_get_interrupt_number | ( | instr_t * | instr | ) |
Assumes that instr's
opcode is OP_int and that either instr's
operands or its raw bits are valid. Returns the first source operand if instr's
operands are valid, else if instr's
raw bits are valid returns the first raw byte.
| dr_instr_label_data_t* instr_get_label_data_area | ( | instr_t * | instr | ) |
instr
is not a label instruction. Returns the next instr_t in the instrlist_t that contains instr
.
| void* instr_get_note | ( | instr_t * | instr | ) |
Gets the value of the user-controlled note field in instr
.
has_instr_jmp_targets
set to true. | int instr_get_opcode | ( | instr_t * | instr | ) |
Returns instr's
opcode (an OP_ constant).
| uint instr_get_opcode_eflags | ( | int | opcode | ) |
Returns the eflags usage of instructions with opcode opcode
, as EFLAGS_ constants or'ed together.
| bool instr_get_prefix_flag | ( | instr_t * | instr, | |
| uint | prefix | |||
| ) |
Assumes that prefix
is a PREFIX_ constant. Returns true if instr's
prefixes contain the flag prefix
.
Returns the previous instr_t in the instrlist_t that contains instr
.
| byte* instr_get_raw_bits | ( | instr_t * | instr | ) |
Assumes that instr's
raw bits are valid. Returns a pointer to instr's
raw bits.
| byte instr_get_raw_byte | ( | instr_t * | instr, | |
| uint | pos | |||
| ) |
Assumes that instr's
raw bits are valid and have > pos
bytes. Returns a pointer to instr's
raw byte at position pos
(beginning with 0).
| uint instr_get_raw_word | ( | instr_t * | instr, | |
| uint | pos | |||
| ) |
Assumes that instr's
raw bits are valid and have > pos
+ 3 bytes. Returns the 4 bytes beginning at position pos
(0-based).
| int instr_get_rel_addr_dst_idx | ( | instr_t * | instr | ) |
If any of instr's
destination operands is a rip-relative memory reference, returns the operand position. If there is no such destination operand, returns -1.
| int instr_get_rel_addr_src_idx | ( | instr_t * | instr | ) |
If any of instr's
source operands is a rip-relative memory reference, returns the operand position. If there is no such source operand, returns -1.
| bool instr_get_rel_addr_target | ( | instr_t * | instr, | |
| app_pc * | target | |||
| ) |
If any of instr's
operands is a rip-relative memory reference, returns the address that reference targets. Else returns false.
Returns instr's
source operand at position pos
(0-based).
Assumes that cti_instr
is a control transfer instruction Returns the first source operand of cti_instr
(its target).
| bool instr_get_x86_mode | ( | instr_t * | instr | ) |
Returns true if instr
is an x86 instruction (32-bit) and false if instr
is an x64 instruction (64-bit).
| bool instr_has_allocated_bits | ( | instr_t * | instr | ) |
Returns true iff instr
has its own allocated memory for raw bits.
| bool instr_has_rel_addr_reference | ( | instr_t * | instr | ) |
Returns true iff any of instr's
operands is a rip-relative memory reference.
| void instr_init | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Initializes instr
. Sets the x86/x64 mode of instr
to the mode of dcontext.
| void instr_invert_cbr | ( | instr_t * | instr | ) |
Assumes that instr
is a conditional branch instruction Reverses the logic of instr's
conditional e.g., changes OP_jb to OP_jnb. Works on cti_short_rewrite as well.
| bool instr_is_call | ( | instr_t * | instr | ) |
Returns true iff instr's
opcode is OP_call, OP_call_far, OP_call_ind, or OP_call_far_ind.
| bool instr_is_call_direct | ( | instr_t * | instr | ) |
Returns true iff instr's
opcode is OP_call or OP_call_far.
| bool instr_is_call_indirect | ( | instr_t * | instr | ) |
Returns true iff instr's
opcode is OP_call_ind or OP_call_far_ind.
| bool instr_is_cbr | ( | instr_t * | instr | ) |
Returns true iff instr
is a conditional branch: OP_jcc, OP_jcc_short, OP_loop*, or OP_jecxz.
| bool instr_is_cti | ( | instr_t * | instr | ) |
Returns true iff instr
is a control transfer instruction of any kind This includes OP_jcc, OP_jcc_short, OP_loop*, OP_jecxz, OP_call*, and OP_jmp*.
| bool instr_is_cti_loop | ( | instr_t * | instr | ) |
Returns true iff instr
is one of OP_loop* or OP_jecxz.
| bool instr_is_cti_short | ( | instr_t * | instr | ) |
Returns true iff instr
is a control transfer instruction that takes an 8-bit offset: OP_loop*, OP_jecxz, OP_jmp_short, or OP_jcc_short
| bool instr_is_cti_short_rewrite | ( | instr_t * | instr, | |
| byte * | pc | |||
| ) |
Returns true iff instr's
opcode is OP_loop* or OP_jecxz and instr has been transformed to a sequence of instruction that will allow a 32-bit offset. If pc
!= NULL, pc
is expected to point the the beginning of the encoding of instr
, and the following instructions are assumed to be encoded in sequence after instr
. Otherwise, the encoding is expected to be found in instr's
allocated bits.
| bool instr_is_encoding_possible | ( | instr_t * | instr | ) |
Returns true iff instr
can be encoding as a valid IA-32 instruction.
| bool instr_is_exit_cti | ( | instr_t * | instr | ) |
Returns true iff instr
is a conditional branch, unconditional branch, or indirect branch with a program address target (NOT an instr_t address target) and instr
is ok to mangle.
| bool instr_is_far_abs_cti | ( | instr_t * | instr | ) |
Returns true if instr
is an absolute call or jmp that is far.
| bool instr_is_far_cti | ( | instr_t * | instr | ) |
Returns true iff instr
is a far control transfer instruction: OP_jmp_far, OP_call_far, OP_jmp_far_ind, OP_call_far_ind, OP_ret_far, or OP_iret.
| bool instr_is_floating | ( | instr_t * | instr | ) |
Returns true iff instr
is a floating point instruction.
| bool instr_is_interrupt | ( | instr_t * | instr | ) |
Return true iff instr's
opcode is OP_int, OP_into, or OP_int3.
| bool instr_is_label | ( | instr_t * | instr | ) |
Returns true iff instr
is a label meta-instruction.
| bool instr_is_mbr | ( | instr_t * | instr | ) |
Returns true iff instr
is a multi-way (indirect) branch: OP_jmp_ind, OP_call_ind, OP_ret, OP_jmp_far_ind, OP_call_far_ind, OP_ret_far, or OP_iret.
| bool instr_is_meta_may_fault | ( | instr_t * | instr | ) |
Return true iff instr
is not a meta-instruction that can fault (see instr_set_meta_may_fault() for more information).
| bool instr_is_mmx | ( | instr_t * | instr | ) |
Returns true iff instr
is part of Intel's MMX instructions.
| bool instr_is_mov | ( | instr_t * | instr | ) |
Returns true iff instr
is an IA-32 "mov" instruction: either OP_mov_st, OP_mov_ld, OP_mov_imm, OP_mov_seg, or OP_mov_priv.
| bool instr_is_mov_constant | ( | instr_t * | instr, | |
| ptr_int_t * | value | |||
| ) |
Tries to identify common cases of moving a constant into either a register or a memory address. Returns true and sets *value
to the constant being moved for the following cases: mov_imm, mov_st, and xor where the source equals the destination.
| bool instr_is_mov_imm_to_tos | ( | instr_t * | instr | ) |
Returns true iff instr
is a "mov $imm -> (%esp)".
| bool instr_is_nop | ( | instr_t * | instr | ) |
Returns true if instr
is one of a class of common nops. currently checks:
| bool instr_is_prefetch | ( | instr_t * | instr | ) |
Returns true iff instr
is a prefetch instruction: OP_prefetchnta, OP_prefetchnt0, OP_prefetchnt1, OP_prefetchnt2, OP_prefetch, or OP_prefetchw.
| bool instr_is_return | ( | instr_t * | instr | ) |
Returns true iff instr's
opcode is OP_ret, OP_ret_far, or OP_iret.
| bool instr_is_sse_or_sse2 | ( | instr_t * | instr | ) |
Returns true iff instr
is part of Intel's SSE or SSE2 instructions.
| bool instr_is_syscall | ( | instr_t * | instr | ) |
Returns true iff instr
is used to implement system calls: OP_int with a source operand of 0x80 on linux or 0x2e on windows, or OP_sysenter, or OP_syscall, or instr_is_wow64_syscall() for WOW64.
| bool instr_is_ubr | ( | instr_t * | instr | ) |
Returns true iff instr
is an unconditional direct branch: OP_jmp, OP_jmp_short, or OP_jmp_far.
| bool instr_is_undefined | ( | instr_t * | instr | ) |
Returns true iff instr
is an "undefined" instruction (ud2)
| bool instr_is_wow64_syscall | ( | instr_t * | instr | ) |
Returns true iff instr
is the indirect transfer from the 32-bit ntdll.dll to the wow64 system call emulation layer. This instruction will also return true for instr_is_syscall, as well as appear as an indirect call, so clients modifying indirect calls may want to avoid modifying this type.
| bool instr_jcc_taken | ( | instr_t * | instr, | |
| reg_t | eflags | |||
| ) |
Given eflags
, returns whether or not the conditional branch, instr
, would be taken.
| int instr_length | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Returns the length of instr
. As a side effect, if instr_ok_to_mangle(instr) and instr's
raw bits are invalid, encodes instr
into bytes allocated with instr_allocate_raw_bits(), after which instr is marked as having valid raw bits.
| void instr_make_persistent | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Calling this function with instr
makes it safe to keep the instruction around indefinitely when its raw bits point into the cache. The function allocates memory local to instr
to hold a copy of the raw bits. If this was not done, the original raw bits could be deleted at some point. Making an instruction persistent is necessary if you want to keep it beyond returning from the call that produced the instruction.
| int instr_mem_usage | ( | instr_t * | instr | ) |
Returns number of bytes of heap used by instr
.
| uint instr_memory_reference_size | ( | instr_t * | instr | ) |
Calculates the size, in bytes, of the memory read or write of instr
. If instr
does not reference memory, or is invalid, returns 0. If instr
is a repeated string instruction, considers only one iteration.
| bool instr_needs_encoding | ( | instr_t * | instr | ) |
Returns true iff instr's
raw bits are not a valid encoding of instr
.
| int instr_num_dsts | ( | instr_t * | instr | ) |
Returns the number of destination operands of instr
.
| int instr_num_srcs | ( | instr_t * | instr | ) |
Returns the number of source operands of instr
.
| bool instr_ok_to_emit | ( | instr_t * | instr | ) |
Return true iff instr
is to be emitted into the cache.
| bool instr_ok_to_mangle | ( | instr_t * | instr | ) |
Return true iff instr
is not a meta-instruction (see instr_set_ok_to_mangle() for more information).
| bool instr_opcode_valid | ( | instr_t * | instr | ) |
Returns true iff instr's
opcode is valid. If the opcode is ever set to other than OP_INVALID or OP_UNDECODED it is assumed to be valid. However, calling instr_get_opcode() will attempt to decode a valid opcode, hence the purpose of this routine.
| bool instr_operands_valid | ( | instr_t * | instr | ) |
Returns true iff instr's
operands are up to date.
| bool instr_raw_bits_valid | ( | instr_t * | instr | ) |
Returns true iff instr's
raw bits are a valid encoding of instr.
| bool instr_reads_from_reg | ( | instr_t * | instr, | |
| reg_id_t | reg | |||
| ) |
Assumes that reg is a DR_REG_ constant. Returns true iff at least one of instr's operands reads from a register that overlaps reg (checks both source operands and addressing registers used in destination operands).
Returns false for multi-byte nops with an operand using reg.
| bool instr_reads_memory | ( | instr_t * | instr | ) |
Returns true iff any of instr's
source operands is a memory reference.
Returns false for multi-byte nops with a memory operand.
| bool instr_reg_in_dst | ( | instr_t * | instr, | |
| reg_id_t | reg | |||
| ) |
Assumes that reg
is a DR_REG_ constant. Returns true iff at least one of instr's
destination operands references reg
.
| bool instr_reg_in_src | ( | instr_t * | instr, | |
| reg_id_t | reg | |||
| ) |
Assumes that reg
is a DR_REG_ constant. Returns true iff at least one of instr's
source operands references reg
.
Returns false for multi-byte nops with a source operand using reg.
Replaces all instances of old_opnd
in instr's
source operands with new_opnd
(uses opnd_same() to detect sameness).
| void instr_reset | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Performs both instr_free() and instr_init(). instr
must have been initialized.
| void instr_reuse | ( | void * | drcontext, | |
| instr_t * | instr | |||
| ) |
Frees all dynamically allocated storage that was allocated by instr
, except for allocated bits. Also zeroes out instr's
fields, except for raw bit fields, whether instr
is instr_ok_to_mangle(), and the x86 mode of instr
. instr
must have been initialized.
Returns true iff instr1
and instr2
have the same opcode, prefixes, and source and destination operands (uses opnd_same() to compare the operands).
| void instr_set_branch_target_pc | ( | instr_t * | cti_instr, | |
| app_pc | pc | |||
| ) |
Set the taken target pc of the (direct branch) instruction.
Sets instr's
destination operand at position pos
to be opnd
. Also calls instr_set_raw_bits_valid(instr
, false) and instr_set_operands_valid(instr
, true).
| void instr_set_meta_may_fault | ( | instr_t * | instr, | |
| bool | val | |||
| ) |
| void instr_set_meta_no_translation | ( | instr_t * | instr | ) |
A convenience routine that calls both instr_set_ok_to_mangle (instr, false) and instr_set_translation (instr, NULL).
Sets the next field of instr
to point to next
.
| void instr_set_note | ( | instr_t * | instr, | |
| void * | value | |||
| ) |
Sets the user-controlled note field in instr
to value
.
| void instr_set_num_opnds | ( | void * | drcontext, | |
| instr_t * | instr, | |||
| int | num_dsts, | |||
| int | num_srcs | |||
| ) |
Assumes that instr
has been initialized but does not have any operands yet. Allocates storage for num_srcs
source operands and num_dsts
destination operands.
| void instr_set_ok_to_emit | ( | instr_t * | instr, | |
| bool | val | |||
| ) |
Set instr
to "ok to emit" if val
is true and "not ok to emit" if val
is false. An instruction that should not be emitted is treated normally by DR for purposes of exits but is not placed into the cache. It is used for final jumps that are to be elided.
| void instr_set_ok_to_mangle | ( | instr_t * | instr, | |
| bool | val | |||
| ) |
Sets instr
to "ok to mangle" if val
is true and "not ok to
mangle" if val
is false. An instruction that is "not ok to
mangle" is treated by DR as a "meta-instruction", distinct from normal application instructions, and is not mangled in any way. This is necessary to have DR not create an exit stub for a direct jump. All non-meta instructions that are added to basic blocks or traces should have their translation fields set (via instr_set_translation(), or the convenience routine instr_set_meta_no_translation()) when recreating state at a fault; meta instructions should not fault (unless such faults are handled by the client) and are not considered application instructions but rather added instrumentation code (see dr_register_bb_event() for further information on recreating).
| void instr_set_opcode | ( | instr_t * | instr, | |
| int | opcode | |||
| ) |
Assumes opcode
is an OP_ constant and sets it to be instr's opcode.
| void instr_set_operands_valid | ( | instr_t * | instr, | |
| bool | valid | |||
| ) |
Sets instr's
operands to be valid if valid
is true, invalid otherwise.
Assumes that prefix
is a PREFIX_ constant. Ors instr's
prefixes with prefix
. Returns the supplied instr (for easy chaining).
Sets the prev field of instr
to point to prev
.
| void instr_set_raw_bits | ( | instr_t * | instr, | |
| byte * | addr, | |||
| uint | length | |||
| ) |
Assumes that instr
does not currently have any raw bits allocated. Sets instr's
raw bits to be length
bytes starting at addr
. Does not set the operands invalid.
| void instr_set_raw_bits_valid | ( | instr_t * | instr, | |
| bool | valid | |||
| ) |
Sets instr's
raw bits to be valid if valid
is true, invalid otherwise.
| void instr_set_raw_byte | ( | instr_t * | instr, | |
| uint | pos, | |||
| byte | byte | |||
| ) |
Assumes that instr's
raw bits are valid and allocated by instr
and have > pos
bytes. Sets instr's raw byte at position pos
(beginning with 0) to the value byte
.
| void instr_set_raw_bytes | ( | instr_t * | instr, | |
| byte * | start, | |||
| uint | num_bytes | |||
| ) |
Assumes that instr's
raw bits are valid and allocated by instr
and have >= num_bytes bytes. Copies the num_bytes
beginning at start to instr's
raw bits.
| void instr_set_raw_word | ( | instr_t * | instr, | |
| uint | pos, | |||
| uint | word | |||
| ) |
Assumes that instr's
raw bits are valid and allocated by instr
and have > pos+3 bytes. Sets the 4 bytes beginning at position pos
(0-based) to the value word.
Sets instr's
source operand at position pos
to be opnd
. Also calls instr_set_raw_bits_valid(instr
, false) and instr_set_operands_valid(instr
, true).
Assumes that cti_instr
is a control transfer instruction. Sets the first source operand of cti_instr
to be target
. Also calls instr_set_raw_bits_valid(instr
, false) and instr_set_operands_valid(instr
, true).
Sets the translation pointer for instr
, used to recreate the application address corresponding to this instruction. When adding or modifying instructions that are to be considered application instructions (i.e., non meta-instructions: see instr_ok_to_mangle), the translation should always be set. Pick the application address that if executed will be equivalent to restarting instr
. Currently the translation address must lie within the existing bounds of the containing code block. Returns the supplied instr
(for easy chaining). Use instr_get_app_pc to see the current value of the translation.
| void instr_set_x86_mode | ( | instr_t * | instr, | |
| bool | x86 | |||
| ) |
Each instruction stores whether it should be interpreted in 32-bit (x86) or 64-bit (x64) mode. This routine sets the mode for instr
.
| void instr_shrink_to_16_bits | ( | instr_t * | instr | ) |
Shrinks all registers not used as addresses, and all immed integer and address sizes, to 16 bits. Does not shrink DR_REG_ESI or DR_REG_EDI used in string instructions.
| void instr_shrink_to_32_bits | ( | instr_t * | instr | ) |
Shrinks all registers, including addresses, and all immed integer and address sizes, to 32 bits.
| bool instr_uses_fp_reg | ( | instr_t * | instr | ) |
Returns true iff at least one of instr's
operands references a floating point register.
| bool instr_uses_reg | ( | instr_t * | instr, | |
| reg_id_t | reg | |||
| ) |
Assumes that reg
is a DR_REG_ constant. Returns true iff at least one of instr's
operands references a register that overlaps reg
.
Returns false for multi-byte nops with an operand using reg.
| bool instr_valid | ( | instr_t * | instr | ) |
Returns true iff instr's
opcode is NOT OP_INVALID. Not to be confused with an invalid opcode, which can be OP_INVALID or OP_UNDECODED. OP_INVALID means an instruction with no valid fields: raw bits (may exist but do not correspond to a valid instr), opcode, eflags, or operands. It could be an uninitialized instruction or the result of decoding an invalid sequence of bytes.
| bool instr_writes_memory | ( | instr_t * | instr | ) |
Returns true iff any of instr's
destination operands is a memory reference.
| bool instr_writes_to_exact_reg | ( | instr_t * | instr, | |
| reg_id_t | reg | |||
| ) |
Assumes that reg
is a DR_REG_ constant. Returns true iff at least one of instr's
destination operands is the same register (not enough to just overlap) as reg
.
| bool instr_writes_to_reg | ( | instr_t * | instr, | |
| reg_id_t | reg | |||
| ) |
Assumes that reg
is a DR_REG_ constant. Returns true iff at least one of instr's
destination operands is a register operand for a register that overlaps reg
.


Open Angel Arena 4.8.2 Update
General Changes
Creep heroes (Spirit Bear, Warlock' Golem etc.) no longer count as heroes for the Capture Points.
Full list of creep heroes can be found
here
.
Item Changes
Bloodstone:
Fixed Bloodstone losing charges when upgraded and not gaining charges.
Regen per charge reduced from 0.4 to
0.3
Hero Changes
Silencer:
Fixed Glaives of Wisdom not working.
Glaives of Wisdom damage type changed from Physical to
Magical
.
If Silencer has Aghanim Scepter and attacked target has Spell Immunity, Glaives of Wisdom damage will be physical.
Previous
Home
Next


140x140
Name:
Email:
Change Photo
Settings
Username
It is your current name
Change name
Email
It is your current email
Change email
Change Password
Current Password
Password is incorrect
New Password
Passwords do not match
Confirm
Password
Change password


What happens when your standard Python numerical computing libraries don't contain an operation you need? If you're forced to write a custom operation and it requires a for loop (i.e. you can't easily vectorize the operation using standard numpy/scipy operations), Cython may be a lifesaver. I recently encountered this when using the Method of Lines to solve some partial differential equations that model unsteady-state diffusion and reaction within a spherical catalyst pellet (more on this interesting chemical engineering problem in a future blog post). I'll present an example of setting up a custom finite difference calculation using Cython within a Google Colab notebook.
Within Colab, first load cython:
%load_ext cython
Next, cimport both cython and numpy, then write your function (remembering to declare return and all variable types). For some background, fd_interior_spherical_axisymmetic()
numerically approximates the spatial derivate term for the axisymmetric spherical diffusion problem (see DOI: 10.1371/journal.pone.0135506 for details).
%%cython
cimport cython
cimport numpy as np
cdef inline np.ndarray[np.float64_t, ndim=1] fd_interior_spherical_axisymmetic(\
np.ndarray[np.float64_t, ndim=1] f,
np.float64_t dr_nondim):
"""
f : numpy array for the concentration as a function of r (r from 0 to 1)
dr : the distance between radial points (non-dimensionalized)
returns :
numerical approximation of the spatial derivative terms at the interior
discretized points of an axisymmetric, spherical particle, i.e. :
1/r^2 d(r^2 df/dr)/dr
"""
cdef int i = 1
cdef int endpts = 2
cdef np.ndarray[np.float64_t, ndim=1] answer
answer = np.zeros(f.shape[0]-endpts, dtype=np.float64)
for i in range(1,f.shape[0]-1):
answer[i-1]=((i+1)*f[i+1]- 2*i*f[i] + (i-1)*f[i-1])/(i*dr_nondim**2)
return answer
def fd_interior_spherical_axisymmetic_wrapper(np.ndarray[np.float64_t, ndim=1] f,
np.float64_t dr_nondim):
return fd_interior_spherical_axisymmetic(f,dr_nondim)
import numpy as np
import timeit
Let's now define a pure pythonic function to do the same:
def pure_python_compute(f, dr_nondim):
answer = np.zeros(len(f)-2)
for i in range(1,f.shape[0]-1):
answer[i-1]=((i+1)*f[i+1]- 2*i*f[i] + (i-1)*f[i-1])/(i*dr_nondim**2)
return answer
Finally, let's compare their running times:
testarr = np.linspace(0,100,10000)
%timeit pure_python_compute(testarr,1)
%timeit fd_interior_spherical_axisymmetic_wrapper(testarr,1)
Which shows:
10 loops, best of 3: 20.7 ms per loop 10000 loops, best of 3: 65.3 µs per loop
This speedup of ~300x is absolutely critical given the number of times this function must be evaluated when solving a set of PDEs using the Method of Lines.


| Function | parse_args | I put command line args and their proper values together in a
|
| Function | complete_args_dict | Compatibility function; adds all missing values to the command line
|
| Function | load_config | I return a arg_list of IRCServer inherited objects from config.py.
|
| Function | load_language | Installs language lcode; if not given the language from the
configuration
|
| Function | try_to_log_msg | Attempting to log something. If logfiles don't exist because logging
|
| Function | time_ago_in_words | I convert a the difference in time for a numeric to a textual
|
| Function | get_time_part | Undocumented |


Student
Songkhla, TH
<EMAIL_ADDRESS>+66936875862
Skills
Python
HTML
W3.css
SYSTEM ANALYSIS AND DESIGN
Languages
Thailand
English
Chinese
Work Experience
WEB PROGRAMMING, W3.CSS, HTML, PYTHON
Jan 2018 - Current
Create a web site to practice your programming skills.
HUMAN FACT INFO SYSTEM, DATABASE SYSTEM, DATA COMMUNI AND COM NETWORK
Aug 2016 - Dec 2016
Create an app on your phone with Android Studio and create a web site for attractions in Songkhla.
LOGIC, FOUND OF INFOMATION SYS
Dec 2015 - May 2016
Practice in logic programming in Flowchart.
Education
W3.CSS, PYTHON< HTML
Forever
Have to learn web programming, and practice writing w3.css html python and by all present.
Prince of songkla university
2015 - 2019
Faculty of Management Science Branch Information System
Hatyai Wittayalai2 School
2013 - 2015
Math and English program