Exhibit 10.22.5.2





FIRST AMENDMENT TO

AMENDED AND RESTATED CREDIT AGREEMENT

BETWEEN

PRIMEENERGY CORPORATION

PRIMEENERGY MANAGEMENT CORPORATION

PRIME OPERATING COMPANY

EASTERN OIL WELL SERVICE COMPANY

SOUTHWEST OILFIELD CONSTRUCTION COMPANY

EOWS MIDLAND COMPANY

AND

GUARANTY BANK, FSB

AS AGENT AND LETTER OF CREDIT ISSUER

AND

BNP PARIBAS,

AS CO-DOCUMENTATION AGENT

AND

JPMORGAN CHASE BANK, N.A.,

AS CO-DOCUMENTATION AGENT

AND

THE LENDERS SIGNATORY HERETO

JULY 17, 2007





REVOLVING LINE OF CREDIT OF
UP TO $150,000,000

REVOLVING LINE OF CREDIT OF UP TO $10,000,000













---

TABLE OF CONTENTS



|            |  |                                            |  |     
|----------- |  | ------------------------------------------ |  | ----
|            |  |                                            |  | PAGE
|ARTICLE I   |  | DEFINITIONS                                |  | 1   
|1.01        |  | Terms Defined Above                        |  | 1   
|1.02        |  | Terms Defined in Agreement                 |  | 1   
|1.03        |  | References                                 |  | 1   
|1.04        |  | Articles and Sections                      |  | 2   
|1.05        |  | Number and Gender                          |  | 2   
|ARTICLE II  |  | AMENDMENTS                                 |  | 2   
|2.01        |  | Amendment of Section 5.2                   |  | 2   
|2.02        |  | Amendment of Section 5.3                   |  | 2   
|2.03        |  | Amendment of Section 6.1(c)                |  | 3   
|ARTICLE III |  | CONDITIONS                                 |  | 3   
|3.01        |  | Receipt of Documents                       |  | 3   
|3.02        |  | Accuracy of Representations and Warranties |  | 3   
|3.03        |  | Matters Satisfactory to Lenders            |  | 3   
|ARTICLE IV  |  | REPRESENTATIONS AND WARRANTIES             |  | 3   
|ARTICLE V   |  | RATIFICATION                               |  | 4   
|ARTICLE VI  |  | MISCELLANEOUS                              |  | 4   
|6.01        |  | Scope of Amendment                         |  | 4   
|6.02        |  | Agreement as Amended                       |  | 4   
|6.03        |  | Parties in Interest                        |  | 4   
|6.04        |  | Rights of Third Parties                    |  | 4   
|6.05        |  | ENTIRE AGREEMENT                           |  | 4   
|6.06        |  | GOVERNING LAW                              |  | 4   
|6.07        |  | JURISDICTION AND VENUE                     |  | 5   



-i-



---

FIRST AMENDMENT TO

AMENDED AND RESTATED CREDIT AGREEMENT

This FIRST AMENDMENT TO AMENDED AND RESTATED CREDIT
AGREEMENT (this First Amendment) is made and entered into effective as of July 17, 2007, by and between PRIMEENERGY CORPORATION, a Delaware corporation (PEC), PRIMEENERGY MANAGEMENT
CORPORATION, a New York corporation, PRIME OPERATING COMPANY, a Texas corporation, EASTERN OIL WELL SERVICE COMPANY, a West Virginia corporation, SOUTHWEST OILFIELD CONSTRUCTION COMPANY, an Oklahoma corporation, and EOWS
MIDLAND COMPANY, a Texas corporation (collectively, the Borrower), with each other lender that is a signatory hereto or becomes a signatory hereto as provided in Section 9.1, (individually, together with its successors
and assigns, a Lender and collectively together, with their respective successors and assigns, the Lenders) and GUARANTY BANK, FSB, a federal savings bank, as agent for the Lenders (in such capacity,
together with its successors in such capacity pursuant to the terms hereof, the Agent) and Letter of Credit Issuer and BNP PARIBAS as Co-Documentation Agent and JPMORGAN CHASE BANK, N.A. as Co-Documentation Agent.

WITNESSETH

WHEREAS,
the above named parties did execute and exchange counterparts of that certain Credit Agreement dated December 28, 2006 (the Agreement), to which reference is here made for all purposes;

WHEREAS, the parties subject to and bound by the Agreement are desirous of amending the Agreement in the particulars hereinafter set forth;

NOW, THEREFORE, in consideration of the mutual covenants and agreements of the parties to the Agreement, as set forth therein, and the mutual
covenants and agreements of the parties hereto, as set forth in this First Amendment, the parties hereto agree as follows:

ARTICLE I

DEFINITIONS

1.01
Terms Defined Above. As used herein, each of the terms Agent, Agreement, Borrower, First Amendment, Lender and Lenders and shall
have the meaning assigned to such term hereinabove.

1.02 Terms Defined in Agreement. As used herein, each term defined in the
Agreement shall have the meaning assigned thereto in the Agreement, unless expressly provided herein to the contrary.

1.03
References. References in this First Amendment to Article or Section numbers shall be to Articles and Sections of this First Amendment, unless expressly stated herein to the contrary. References in this First Amendment to hereby,
herein, hereinafter, hereinabove, hereinbelow, hereof, and hereunder shall be to this First Amendment in its entirety and not only to the particular Article or Section in which such
reference appears.



1



---

1.04 Articles and Sections. This First Amendment, for convenience only, has been divided into
Articles and Sections and it is understood that the rights, powers, privileges, duties, and other legal relations of the parties hereto shall be determined from this First Amendment as an entirety and without regard to such division into Articles
and Sections and without regard to headings prefixed to such Articles and Sections.

1.05 Number and Gender. Whenever the context
requires, reference herein made to the single number shall be understood to include the plural and likewise the plural shall be understood to include the singular. Words denoting sex shall be construed to include the masculine, feminine, and neuter,
when such construction is appropriate, and specific enumeration shall not exclude the general, but shall be construed as cumulative. Definitions of terms defined in the singular and plural shall be equally applicable to the plural or singular, as
the case may be.

ARTICLE II

AMENDMENTS

The Borrower and the Lender hereby amend the Agreement in the following particulars:

2.01 Amendment of Section 5.2. Section 5.2 of the Agreement is hereby amended as follows:

5.2 Quarterly Financial Statements; Compliance Certificates. Deliver to the Agent, (a) on or before the 45th day after the close of each
of the first three quarterly periods of each fiscal year of the Borrower, a copy of the unaudited consolidated Financial Statements of PEC and its Subsidiaries and Affiliates as at the close of such quarterly period and from the beginning of such
fiscal year to the end of such period, such Financial Statements to be certified by a Responsible Officer of the Borrower as having been prepared in accordance with GAAP consistently applied and as a fair presentation of the condition of the
Borrower, subject to changes resulting from normal year-end audit adjustments, and (b) on or before the 60th day after the close of each fiscal quarter, with the exception of the last fiscal quarter, an unaudited consolidated Financial
Statement of PEC and its Subsidiaries and Affiliates, excluding Prime Offshore L.L.C, and a Compliance Certificate which excludes Prime Offshore L.L.C.

2.02 Amendment of Section 5.3. Section 5.3 of the Agreement is hereby amended as follows:

5.3 Annual Financial Statements. Deliver to the Agent, on or before the 90th day after
the close of each fiscal year of the Borrower, a copy of the annual audited consolidated Financial Statements of PEC and its Subsidiaries and Affiliates and on or before the 105thday after the close of each fiscal year, an unaudited consolidated Financial Statement of PEC and its Subsidiaries and Affiliates, excluding Prime Offshore L.L.C. and a Compliance Certificate which excludes Prime
Offshore L.L.C.



2



---

2.03 Amendment of Section 6.1(c). Section 6.1(c) of the Agreement is hereby amended as
follows:

6.1 Indebtedness. Create  (c) Commodity Hedge Agreements, in a form and substance and with a Person
acceptable to the Agent, provided that (i) each commitment issued under such agreement must also be approved by the Agent, (ii) such agreements may not be entered into with respect to Mortgaged Properties constituting more than 80% of
monthly production of proven producing reserves as forecast in the Agents most recent engineering evaluation; provided, however, the Borrower may enter into such agreements for: (i) October, November and December 2007; as long as the
monthly production subject to such agreements does not exceed 34,111 barrels, 33,319 and 32,621 barrels, respectively, and (ii) 2008, 2009 and 2010; as long as the annual production subject to such agreements does not exceed 346,917 barrels,
288,893 barrels and 241,308 barrels, respectively, and that the monthly production subject to such agreements does not exceed that as forecast in the Agents engineering evaluation as of October 1, 2007.

ARTICLE III

CONDITIONS

The obligation of the Lenders to amend the Agreement as provided herein is subject to the fulfillment of the following conditions
precedent:

3.01 Receipt of Documents. The Agent shall have received, reviewed, and approved the following documents and other
items, appropriately executed when necessary and in form and substance satisfactory to the Agent:



| | (a) | multiple counterparts of this First Amendment as requested by the Agent; and
| | --- | ----------------------------------------------------------------------------



| | (b) | such other agreements, documents, items, instruments, opinions, certificates, waivers, consents, and evidence as the Agent may reasonably request.
| | --- | --------------------------------------------------------------------------------------------------------------------------------------------------

3.02 Accuracy of Representations and Warranties. The representations and warranties contained in Article IV of the Agreement and this First
Amendment shall be true and correct.

3.03 Matters Satisfactory to Lenders. All matters incident to the consummation of the
transactions contemplated hereby shall be satisfactory to the Agent and the Lenders.

ARTICLE IV

REPRESENTATIONS AND WARRANTIES

The Borrower hereby expressly re-makes, in favor of the Agent and the Lenders, all of the representations and warranties set forth in Article IV of the Agreement, and represents and warrants that all such representations and warranties
remain true and unbreached.



3



---

ARTICLE V

RATIFICATION

Each of the parties hereto does hereby adopt, ratify, and confirm the Agreement
and the other Loan Documents, in all things in accordance with the terms and provisions thereof, as amended by this First Amendment.

ARTICLE VI

MISCELLANEOUS

6.01 Scope of Amendment. The scope of this First Amendment is expressly limited to the matters addressed herein and this First Amendment shall not operate as a waiver of any past, present, or future breach,
Default, or Event of Default under the Agreement. except to the extent, if any, that any such breach, Default, or Event of Default is remedied by the effect of this First Amendment.

6.02 Agreement as Amended. All references to the Agreement in any document heretofore or hereafter executed in connection with the transactions
contemplated in the Agreement shall be deemed to refer to the Agreement as amended by this First Amendment.

6.03 Parties in
Interest. All provisions of this First Amendment shall be binding upon and shall inure to the benefit of the Borrower, the Agent and the Lenders and their respective successors and assigns.

6.04 Rights of Third Parties. All provisions herein are imposed solely and exclusively for the benefit of the Agent and the Lenders and the
Borrower, and no other Person shall have standing to require satisfaction of such provisions in accordance with their terms and any or all of such provisions may be freely waived in whole or in part by the Lenders at any time if in their sole
discretion they deem it advisable to do so.

6.05ENTIRE AGREEMENT. THIS FIRST AMENDMENT CONSTITUTES THE ENTIRE AGREEMENT
BETWEEN THE PARTIES HERETO WITH RESPECT TO THE SUBJECT HEREOF AND SUPERSEDES ANY PRIOR AGREEMENT, WHETHER WRITTEN OR ORAL, BETWEEN SUCH PARTIES REGARDING THE SUBJECT HEREOF. FURTHERMORE IN THIS REGARD, THIS FIRST AMENDMENT, THE AGREEMENT, THE NOTE,
THE SECURITY INSTRUMENTS, AND THE OTHER WRITTEN DOCUMENTS REFERRED TO IN THE AGREEMENT OR EXECUTED IN CONNECTION WITH OR AS SECURITY FOR THE NOTE REPRESENT, COLLECTIVELY, THE FINAL AGREEMENT AMONG THE PARTIES THERETO AND MAY NOT BE CONTRADICTED BY
EVIDENCE OF PRIOR, CONTEMPORANEOUS, OR SUBSEQUENT ORAL AGREEMENTS OF THE PARTIES. THERE ARE NO UNWRITTEN ORAL AGREEMENTS AMONG THE PARTIES.

6.06GOVERNING LAW. THIS FIRST AMENDMENT, THE AGREEMENT AND THE NOTE SHALL BE DEEMED TO BE CONTRACTS MADE UNDER AND SHALL BE CONSTRUED IN ACCORDANCE WITH AND GOVERNED BY THE LAWS OF THE STATE OF TEXAS. THE PARTIES
ACKNOWLEDGE AND AGREE



4



---

THAT THIS AGREEMENT AND THE NOTE AND THE TRANSACTIONS CONTEMPLATED HEREBY BEAR A NORMAL, REASONABLE, AND SUBSTANTIAL RELATIONSHIP TO THE STATE OF TEXAS.

6.07JURISDICTION AND VENUE. ALL ACTIONS OR PROCEEDINGS WITH RESPECT TO, ARISING DIRECTLY OR INDIRECTLY IN CONNECTION
WITH, OUT OF, RELATED TO, OR FROM THIS FIRST AMENDMENT, THE AGREEMENT OR ANY OTHER LOAN DOCUMENT MAY BE LITIGATED IN COURTS HAVING SITUS IN HARRIS COUNTY, TEXAS. EACH OF THE BORROWER AND THE LENDER HEREBY SUBMITS TO THE JURISDICTION OF ANY LOCAL,
STATE, OR FEDERAL COURT LOCATED IN HARRIS COUNTY, TEXAS, AND HEREBY WAIVES ANY RIGHTS IT MAY HAVE TO TRANSFER OR CHANGE THE JURISDICTION OR VENUE OF ANY LITIGATION BROUGHT AGAINST IT BY THE BORROWER OR THE LENDERS IN ACCORDANCE WITH THIS SECTION.

(Remainder of Page Intentionally Left Blank)



5



---

IN WITNESS WHEREOF, this First Amendment to Credit Agreement is executed effective the date first
hereinabove written.



BORROWERPRIMEENERGY CORPORATIONPRIMEENERGY MANAGEMENTCORPORATION, PRIME OPERATINGCOMPANY, EASTERN OIL WELL SERVICECOMPANY, SOUTHWEST OILFIELDCONSTRUCTION COMPANYEOWS MIDLAND COMPANYBy:Beverly A. CummingsExecutive Vice President, Treasurer, andChief Financial Officer




6



---

AGENT AND LENDERGUARANTY BANK, FSBBy:Kelly L. Elmore, IIISenior Vice President




7



---

LENDER:BNP PARIBASBy:Douglas R. LiftmanManaging DirectorBy:Name:Title:




8



---

LENDER:JPMORGAN CHASE BANK, N.A.By:Jo Linda PapadakisVice President




9