Download the PHP package vlydev/cs2-masked-inspect without Composer

On this page you can find all versions of the php package vlydev/cs2-masked-inspect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cs2-masked-inspect

cs2-masked-inspect (PHP)

Pure PHP 8.2+ library for encoding and decoding CS2 masked inspect links — no runtime dependencies.

Installation

Usage

Deserialize a CS2 inspect link

Serialize an item to a hex payload

Item with stickers and keychains


Gen codes

Gen codes are space-separated command strings used on CS2 community servers to spawn items.

Format:

Generate a Steam inspect URL from parameters

Convert an ItemPreviewData to a gen code

Parse a gen code string

Convert an existing inspect link directly to a gen code


Validation

Use isMasked() and isClassic() to detect the link type without attempting to decode it.


Validation rules

deserialize() enforces:

Rule Limit Exception
Hex payload length max 4,096 characters InvalidArgumentException
Protobuf field count max 100 per message OverflowException

serialize() enforces:

Field Constraint Exception
paintwear [0.0, 1.0] InvalidArgumentException
customname max 100 characters InvalidArgumentException

How the format works

Three URL formats are handled:

  1. New masked format — pure hex blob after csgo_econ_action_preview:

  2. Hybrid format — old-style S/A/D prefix, but with a hex proto appended after D (instead of a decimal did):

  3. Classic format — old-style S/A/D with a decimal did; requires Steam GC to resolve item details.

For formats 1 and 2 the library decodes the item offline. For format 3 only URL parsing is possible.

The hex blob (formats 1 and 2) has the following binary layout:

Section Size Description
key_byte 1 byte XOR key. 0x00 = no obfuscation (tool links). Other values = native CS2 links.
proto_bytes variable CEconItemPreviewDataBlock protobuf, each byte XOR'd with key_byte.
checksum 4 bytes Big-endian uint32, XOR'd with key_byte.

Checksum algorithm

paintwear encoding

paintwear is stored as a uint32 varint whose bit pattern is the IEEE 754 representation of a float32. The library handles this transparently — callers always work with PHP float values.


Proto field reference

CEconItemPreviewDataBlock

Field Number Type Description
accountid 1 uint32 Steam account ID (often 0)
itemid 2 uint64 Item ID in the owner's inventory
defindex 3 uint32 Item definition index (weapon type)
paintindex 4 uint32 Skin paint index
rarity 5 uint32 Item rarity
quality 6 uint32 Item quality
paintwear 7 uint32* float32 reinterpreted as uint32
paintseed 8 uint32 Pattern seed (0–1000)
killeaterscoretype 9 uint32 StatTrak counter type
killeatervalue 10 uint32 StatTrak value
customname 11 string Name tag
stickers 12 repeated Sticker Applied stickers
inventory 13 uint32 Inventory flags
origin 14 uint32 Origin
questid 15 uint32 Quest ID
dropreason 16 uint32 Drop reason
musicindex 17 uint32 Music kit index
entindex 18 int32 Entity index
petindex 19 uint32 Pet index
keychains 20 repeated Sticker Applied keychains

Sticker

Field Number Type Description
slot 1 uint32 Slot position
sticker_id 2 uint32 Sticker definition ID
wear 3 float32 Wear (fixed32)
scale 4 float32 Scale (fixed32)
rotation 5 float32 Rotation (fixed32)
tint_id 6 uint32 Tint
offset_x 7 float32 X offset (fixed32)
offset_y 8 float32 Y offset (fixed32)
offset_z 9 float32 Z offset (fixed32)
pattern 10 uint32 Pattern (keychains)

Known test vectors

Vector 1 — Native CS2 link (XOR key 0xE3)

Field Value
itemid 46876117973
defindex 7 (AK-47)
paintindex 422
paintseed 922
paintwear ≈ 0.04121
rarity 3
quality 4
sticker IDs [7436, 5144, 6970, 8069, 5592]

Vector 2 — Tool-generated link (key 0x00)

Expected hex:


Running tests


Contributing

Bug reports and pull requests are welcome on GitHub.

  1. Fork the repository
  2. Create a branch: git checkout -b my-fix
  3. Make your changes and add tests
  4. Ensure all tests pass: composer test
  5. Open a Pull Request

All PRs require the CI checks to pass before merging.


Author

VlyDev[email protected]


License

MIT © VlyDev


All versions of cs2-masked-inspect with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vlydev/cs2-masked-inspect contains the following files

Loading the files please wait ...