Giter Site home page Giter Site logo

warhawk-reversing's Introduction

Hi there ๐Ÿ‘‹

warhawk-reversing's People

Contributors

jmckiern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

warhawk-reversing's Issues

PTR

  • Header of size 0x10
    • 4 byte identifier (is there information contained in this identifier?)
    • X
    • Y
    • Four 0's
  • A. Pointers to RTT headers within NGP pointing to NGP
  • B. Pairs of pointers to faces & vertices pointers within model header in NGP
  • C. Unknown
  • D. Pointers to RTT headers within NGP pointing to VRAM
  • E. Unknown

Note:

  • X = len(C + D + E)
  • Y = len(A + B)

Script folders

Hi All,

what file format stores the script files? (as far as i see all the files are related to movies, sound, models, textures... but what about the scripts?

Thanks

NGP

Overview

Header of size 0x20

Offset Length Example Name Notes
0x00 0x08 0x696570334616A42B Magic Number NGPs always start with this
0x08 0x04 0x466F37AB Object Identifier Present in PTR and VRAM file headers for same object
0x0C 0x04 0x0000001C Table 1 Pointer Relative pointer
0x10 0x04 0x00000070 Texture Table (Table 2) Pointer Relative pointer
0x14 0x04 0x00095FB4 Table 3 Pointer Relative pointer
0x18 0x04 0x00002F68 Table 4 Pointer Relative pointer
0x1C 0x04 0x000022E0 Table 5 Pointer Relative pointer

Overall File Structure

  • Header
  • Table 1
  • Texture Table
  • Unknown
  • Model headers (maybe includes pointer to texture headers?)
  • Unknown
  • Model data
    1. Face data - Each face is 3 vertex indices which are shorts
    2. Vertex data - short_signed
  • Unknown
  • Snippets of stuff with a header (at the bottom of the data?) that includes
    strings like "hud" and "vehicle"
  • Unknown
  • NGP Texture headers
  • Unknown
  • Texture data (pointed to by the above texture headers)
  • Unknown

UV Coordinates

The UV coordinates seem to be centred around 0x3800. However, they're not linear, with the following transformation happening:

Raw Coordinate Data Texture Space Coordinate
0x17DD Approaching 0
0x3800 0.5
0x3C1A Approaching 1

The following function seems to work for what I've tested...

def translate(val):
        return (((val / 0x3800) ** 10) / 2)

Notes

Standard Table

Offset Length Example Name Notes
0x00 0x04 0x00000001 Number of entries in table ย 
0x04 + (n * 0x04) 0x04 0x00000804 Entry in table Relative pointer

Relative Pointer

  • Here, a relative pointer is defined as a pointer to that points to a file address relative to the pointer's address
    • Eg. a relative pointer with value 0x10 at location 0x4 would point to 0x14

Rigged Models Potential Solutions

This might lead to some interesting finds. There's a pattern for NGP files that contain rigged models. Using Model Researcher, you can extract the models using the following parameters. The static meshes are short signed, and those that have moving parts (rigged) are floats. I've highlighted the important bits in the screenshot. This can be imported into your script to make things easier, but automating binary offsets are beyond me. Let me know if you discover anything else.

_warhawk_research

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.