{"id":18250576,"url":"https://github.com/asivery/netmd-patchlibrary","last_synced_at":"2026-02-19T05:31:35.119Z","repository":{"id":254826879,"uuid":"805430700","full_name":"asivery/netmd-patchlibrary","owner":"asivery","description":"A JavaScript library for writing and reading NetMD devices' patches","archived":false,"fork":false,"pushed_at":"2024-08-26T09:58:22.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-22T10:44:26.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asivery.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-24T14:56:48.000Z","updated_at":"2024-11-13T10:46:09.000Z","dependencies_parsed_at":"2024-08-26T12:26:40.636Z","dependency_job_id":null,"html_url":"https://github.com/asivery/netmd-patchlibrary","commit_stats":null,"previous_names":["asivery/netmd-patchlibrary"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-patchlibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-patchlibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-patchlibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-patchlibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asivery","download_url":"https://codeload.github.com/asivery/netmd-patchlibrary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238869848,"owners_count":19544429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:45:14.719Z","updated_at":"2025-10-15T22:25:14.225Z","avatar_url":"https://github.com/asivery.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# netmd-patchlibrary\n\nThis library aims to provide both a library of, and a way to apply, patches to Sony NetMD devices.\n\nThe library aims to provide a simple interface to read and write NetMD devices' EEPROM images,\nas well as a means to edit them in a programmer-friendly way.\n\nAs of right now, `netmd-patchlibrary` can:\n- Read and write any patch to any supported device\n- Read and write custom FCode values (enable / disable some additional functionalities)\n- Detect CRC errors, and repair them\n- Rewrite the NetMD EEPROM block\n\n## How to use?\n\nExample code:\n\n```typescript\n// [Node.js-only] Create WebUSB object\nconst usb = new WebUSB({ allowAllDevices: true, deviceTimeout: 1000000 });\n// Create netmd-js' context\nconst device = await openNewDevice(usb);\nif(!device) {\n    console.log('No device present');\n    return;\n}\n\n// Create patchlibrary connection\nconst connection = await DeviceConnection.create(device);\nconst deviceType = await connection.getDeviceType();\nconsole.log(\"Device connected:\");\nconsole.log(deviceInfoToString(deviceType));\nconst eepromImage = await connection.readWholeEEPROM(\n    (completed: number, outOf: number) =\u003e console.log(`Reading EEPROM: ${completed} / ${outOf}`)\n);\n\n// Create patchlibrary context\n// If you are working on an EEPROM image file, you can create the deviceType based on\n// The device's PID, FW Version and HWID fields:\n// const deviceType = getDeviceTypeFor(0x00C8, \"S1.600\", 3);\n\nconst data = new EEPROMData(eepromImage, deviceType);\nconsole.log(`EEPROM Verification errors: ${JSON.stringify(data.loadingErrors)}`);\n\n// To read the patches:\nfor(let i = 0; i\u003cdata.deviceType.patchesCount; i++){\n    let patchInfo = data.getPatchValue(i);\n    console.log(patchToString(patchInfo));\n    console.log(`ID: ${JSON.stringify(lookup(patchInfo))}`);\n}\n\n// To write a patch to a specified slot:\ndata.applyPatch(HFEC, 7);\n\n// To get the original image back you can either:\n// - Use the currently cached stripped image from data:\nconst strippedImage = data.image;\n// then rewrite the CRC values:\nconst complete = addCRCValues(strippedImage);\n// - Create deltas between the current state, and the original image:\nconst deltas = data.createDeltas();\n// then either apply these deltas to the device:\nawait connection.writeDeltas(deltas, (completed: number, outOf: number) =\u003e console.log(`Write EEPROM delta: ${completed} / ${outOf}`));\n// - After calling createDeltas(), read the `originalImage` field.\n// Running createDeltas() causes the EEPROMData class to treat the current\n// state as the original one, so that when called multiple times, it will\n// always only return the changes since the last call.\nconst complete2 = data.originalImage;\n```\n\n# What patches are available?\n\nTo see what patches are currently available, please see [this list](patches.md).\n\n# Contributions\n\nAny and all contributions are always welcome!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fnetmd-patchlibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasivery%2Fnetmd-patchlibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fnetmd-patchlibrary/lists"}