jmckiern / warhawk-reversing Goto Github PK
View Code? Open in Web Editor NEWSome scripts to reverse the file formats used in WarHawk
License: GNU Affero General Public License v3.0
Some scripts to reverse the file formats used in WarHawk
License: GNU Affero General Public License v3.0
Note:
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
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 |
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)
Offset | Length | Example | Name | Notes |
---|---|---|---|---|
0x00 | 0x04 | 0x00000001 | Number of entries in table | ย |
0x04 + (n * 0x04) | 0x04 | 0x00000804 | Entry in table | Relative pointer |
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.