{"id":50685441,"url":"https://github.com/mefistotelis/pylabview","last_synced_at":"2026-06-08T22:32:38.321Z","repository":{"id":40544665,"uuid":"214717792","full_name":"mefistotelis/pylabview","owner":"mefistotelis","description":"Python reader of LabVIEW RSRC files (VI, CTL, LLB). File format description on the Wiki.","archived":false,"fork":false,"pushed_at":"2026-05-30T06:02:09.000Z","size":1139,"stargazers_count":130,"open_issues_count":11,"forks_count":32,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-05-30T07:10:33.418Z","etag":null,"topics":["extractor","fileformat","labview","python3","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jcreigh/pylabview","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mefistotelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-12T21:29:44.000Z","updated_at":"2026-05-30T06:02:13.000Z","dependencies_parsed_at":"2023-02-01T03:30:51.899Z","dependency_job_id":null,"html_url":"https://github.com/mefistotelis/pylabview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mefistotelis/pylabview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefistotelis%2Fpylabview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefistotelis%2Fpylabview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefistotelis%2Fpylabview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefistotelis%2Fpylabview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mefistotelis","download_url":"https://codeload.github.com/mefistotelis/pylabview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefistotelis%2Fpylabview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34083848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["extractor","fileformat","labview","python3","reverse-engineering"],"created_at":"2026-06-08T22:32:37.504Z","updated_at":"2026-06-08T22:32:38.307Z","avatar_url":"https://github.com/mefistotelis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pylabview\n\nTools for extracting, changing, and re-creating LabVIEV RSRC files, like VIs or CTLs.\n\nBase concepts:\n\n* the input RSRC file is extracted to a collection of files that contain all the\n  information necessary to recreate the original file\n* the re-creation is made in a way which allows to output file identical to the\n  original on a binary level, unless there is a known and accepted reason for\n  binary divergence\n* one RSRC file is extracted into multiple files, usually one per block within the\n  source file, plus one main catalogue file listing the blocks\n* if extraction of a block to text form is not supported or just fails to create\n  file which would allow 1:1 binary recreation, then the block is extracted as\n  binary blob\n* extracted block files can be modified, and the reader tool will try to re-create\n  a correctly formatted RSRC file with these modifications\n* tools to modify the RSRC data use extracted RSRC file blocks as input\n\n# Motivation\n\nLabView environment is unneccessarily closed. Its mechanisms prevent the developers\nfrom modifying projects outside of the GUI, which makes scalability painful.\n\nIf you want to modify something in 1000 of files, and you're not really into\nclicking through all that, this might be the tool for you.\n\nBesides batch processing of LabView files, this tool should be also helpful\nfor fixing the ones which LabView refuses to read.\n\n# Tools\n\nRunning the tools without parameters will give you details on supported commands\nin each of them.\n\nTo get specifics about command line arguments of each tool, run them with `--help`\noption. Some tools also have additional remarks in their headers - try viewing them.\n\nThe first tool to use is `readRSRC.py` and extract the RSRC file into a form\nwhich is easier to understand and modify.\n\n# Supported versions\n\nThe tools were tested on all standard VIs from LabVIEW 2014 and LabVIEW 6.0.\nThese standard VIs included a variety of versions, ie LV14 contains some VIs\ncreated in previous versions down to LabVIEW 8.6.\n\nBut the actual development was made with LabVIEW 2014 in mind. Other versions may get\nless resources converted to XML, or may require some tweaks to work.\n\n# Python environment\n\nAs for [Python](https://en.wikipedia.org/wiki/Python_\\(programming_language\\)) versions\nbest suited to run these scripts - newer should be better.\nIt is recommended to use at least Python 3.8, as XML parser is older versions does\nnot preserve order of attributes. Without this feature the tool will still work\n(down to 3.5), but generated binary data will be different due to reordering\nof some tags. It is uncertain whether the different ordering has impact on stability\nof the created binary files. Some fixes to the XML parser from Python 3.9 can also\naffect generated files, due to better handling of non-text ASCII codes within values\nof attributes.\n\n# Running\n\nTo run the tools with your Python, use a shell like `bash` or `cmd`. You can have\nthe scripts directly in the [CWD](https://en.wikipedia.org/wiki/Working_directory),\nor installed as a module. If you choose the direct CWD option, remember you need\nto have `pylabview` folder in the CWD for Python to find the accompanying files.\n\nExample command:\n\n```\n./pylabview/readRSRC.py --version\n```\n\n# Verification\n\nIf you want to verify whether your specific file will be handled correctly by the tool, try:\n- extracting it to XML\n- re-creating it from the XML\n- checking whether oroginal and re-created file are binary identical, or load with all features in LabVIEW\n\nNote that some files created by the tool will not be binary identical to the\noriginals. This includes many LLB files, and some VIs from LV6.0 and older.\nThe differenes in LLB can happen because string names in these files are not ordered,\nand the order depends on specific timing between threads while the file was saved\n(this tool always uses the same ordering of all items).\nThe differenes in old VI files are due to unpredicatable values used for padding\nbetween actual data (this tool uses zeros for padding).\n\nA few example files are included in the project.\n\n# Tests\n\nThe tool comes with a few tests, implemented to be used by [pytest](https://docs.pytest.org).\nTo execute these, just run in home folder of the project:\n\n```\npytest tests -o log_cli=true\n```\n\nThese are the tests executed after each commit, providing Continous Integration\nfor the project. Though there, additinal set of VI/LLB files is downloaded; you\ncan fetch those files manually (the link is within `.github/workflows` scripts)\nand unzip them to the `./examples` folder. All files within that folder are used\nduring `pytest` runs.\n\nThe output files will be stored in `test_out` directory.\n\nThere is also a second set of tests, implementing similar test cases as shell scripts.\nRun them from `bash`:\n\n```\ncd tests\n./recreate-vi_lib-llb.sh ../examples\n./recreate-vi_lib-vis.sh ../examples\n\n```\n\nThe output files and logs will be stored in `test_out` directory.\n\n# Use cases\n\nThe general intended use of the tools is as follows:\n- extract RSRC file to XML form\n- look at the resulting XML, perform modifications\n- re-create RSRC file from the XML\n\nSeveral specific things you can do with these tools are listed below.\nOne caveat worth noticing is that these tasks are not fully automated. To use\nthese functions, you must know what you're doing, and modify the scripts where\napropriate.\n\n### Look at the data inside VI file\n\nIf you don't have a LabVIEW license, and want to look inside some VIs, these\ntools can help. You can convert your VIs to XML format, and then look at the XML.\n\nIt is possible to write a viewer, which displays the XML data in graphical\nform, like they look in LabVIEW. Such viewer does not exist at the moment.\n\n### Look at the compiled code inside VI file\n\nIf you want to look at assembly bytecode, the tool will create a BIN file with\nthat code during VI extraction. It will even prepare a MAP file, with some known\nsymbols within the code. Base address of the extracted code is always 0x0.\nRelocations and imports are stored in an array called 'Patches', and for most\nversions of LV, the tool will store these within XML file.\n\n### Batch process VIs\n\nYou can extract, modify and re-create VIs. So as long as you can write a script\nwhich does proper modification to XMLs, you can automatically apply a change\nto thousands of VI files, without the need of clicking through LabVIEW GUI.\n\n### Reverse a compiled VI project\n\nYou can look into internals of a compiled VI project. You can also, to some\nextent, convert the EXE cack to source form. Though at the moment, the tools\nwill not allow you to automatically recover Block Diagram which is lost during\nVIs compilation process. There is a script which recovers Front Panel from\na VI which had it removed.\n\nIt is possible to write a tool which recovers these items completely, though.\n\n### Fix damaged VI files\n\nThe extractor can be modified to ignore errors and read damaged VI file. Then\nit can re-create the VI from XML, and it will use proper format required by\nLabVIEW. So it can be used to fix a VI file, though there is no premade\nparameter which will do it for you.\n\n### Backport VI files\n\nYou can modify version numbers in XML files, and the tools will re-create\nVIs using structures from the updated version markings. There is no automated\nversion changer though - if the switch requires some blocks to be renamed,\nor some data added - you will have to do it manually.\n\n# Reversing EXE back to buildable project\n\nWhile it is possible to reverse the EXE built with LabVIEW to its source, there\nare no tools to automate such conversion at the moment. When VI files are being\nbuild, some elements are removed from them:\n- Block Diagram is removed, leaving only compiled version. The compiled version\n is kind of OBJ file, which can only run on a specific CPU, and specific\n version of LabVIEW Runtime Environment (LVRT).\n- If GUI of the VI file is never shown, the unused VI Front Panel is also removed.\n\nThe missing elements can be re-created, and doing so with use of the XML format\nis much easier than doing that directly with binary form of the VI files.\nA script which reads the XML and re-constructs missing parts is in the project,\nthough it currently reconstructs only Front Panel. The reconstructing script\nis not as thoroughly tested as the XML extractor, so may require some tweaks to\nwork with a specific project.\n\nEven without the VIs fully reversed so source form, it is possible to extract\nthe EXE back to a project, which then can be re-built with the same version of\nLabView which was originally used. It is then possible to start replacing\nsingle VIs with a newly created ones, while retaining useability of the whole\nproject.\n\nIn order to reverse an executable back to LabView project:\n\n### 1. Extract RSRC file from the executable\n\nUse any tool you see fit. In case of Windows `PE` executable, you may use\n`wrestool`, or if you prefer GUIs, [Resource Hacker](https://en.wikipedia.org/wiki/Resource_Hacker).\nYou may also just find `RSRC` in file content and copy the data starting from\nthat position, using `dd`. Any method should work, as long as you receive the\nfile with `RSRC` header.\n\n### 2. Decrypt the ZIP from within RSRC file\n\nThe `RSRC` file will contain weakly encrypted ZIP. Extract it with the tools from this repo.\n\n### 3. Get proper LabVIEW version\n\nLook inside VI files from the ZIP to figure out which version of LabVIEW was used to create them. You can look at the versions by extraction one of the vIs to XML form. Use the exact same version for further steps.\n\n### 4. Make new LabView project\n\nCreate a folder. Open LabVIEW. Create new LabView project in the new folder.\n\n### 5. Copy VIs to the project folder\n\nCreate sub-folder within the project folder, ie. `app` or `lv` or however you want to call the labview app part; copy the files extracted from ZIP there.\n\n### 6. Copy non-VI dependencies\n\nCopy any config and data files (and folders) distributed with original binary (either within the ZIP, or just placed in the same folder where the EXE you've extracted) to the project folder.\n\n### 7. Copy LV Runtime Engine settings\n\nCopy options from BinryName.ini into your BinaryName.lvproj (created in step 4).\n\n### 8. Open the project in LabView\n\nJust run LabVIEW and open your project. Noe that LabVIEW still considers your project to be empty.\n\n### 9. Add VIs to the LV project\n\nAdd each folder from your labview app part to the project. Use \"My Computer\" -\u003e \"Add\" -\u003e \"Folder (Auto-populating)\".\n\n### 10. Create build target in the LV project\n\nTo make the new build target, use \"Build Specifications\" -\u003e \"New\" -\u003e \"Application\".\n\n### 11. Set build target settings\n\nSet proper \"Name: and \"Target filename\" in build target \"Information\" tab.\n\n### 12. Set build target Startup VI\n\nLook at the starting form from original app. Find the starting panel in your VIs, and add it as \"Startup VIs\" in build target \"Source files\" tab.\n\nYou shouldn't have to put anything in \"Always included\" list in build target \"Source files\" tab. Each VI stores its dependencies, so LV should be able to figure out which files to include in your build. But if you want - you can add some files there now.\n\n### 13. Disable removing things from VIs\n\nDisable all the \"Remove ...\" and \"Disconnect ...\" options in build target \"Additional Exclusions\" tab.\n\n### 14. Fix \"Missing items\"\n\nLabVIEW will likely inform you of \"Missing items\" in the project. You can fix these by placing files in correct places or modifying file paths within the files which reference them. Usually, LabVIEW will ask you dozens of questions in regard to which file you want to use; but after that, most \"Missing items\" will be fixed. Probably not all though - VIs with both Front Panel and Block Diagram removed will require manual fixing of the paths inside, as LabVIEW will refuse to load them, and therefore will not re-save them with different paths.\n\n### 15. Build the project\n\nIf you encounter further errors, fix them. If you've solved the \"Missing items\", everything else is simple and you shouldn't have much problems.\n\nNow you have a LabVIEW project which allows you to re-build the EXE.\n\nYou may look into converting to XML all the VIs which are missing Front Panel,\nand recovering these Front Panels.\n\n# Text Code Pages\n\nThe RSRC files use various code pages, depending on OS on which the file was created.\nOn reading RSRC file, you can provide the code page as a parameter.\n\nExample code pages you could use:\n\n| TextEncoding | Related Operating System |\n| ------------ | ------------------------ |\n| mac_cyrillic | MacOS Bulgarian, Byelorussian, Macedonian, Russian, Serbian |\n| mac_greek    | MacOS Greek |\n| mac_iceland  | MacOS Icelandic |\n| mac_latin2   | MacOS Central and Eastern Europe |\n| mac_roman    | MacOS Western Europe (and US) |\n| mac_turkish  | MacOS Turkish |\n| cp1250       | Windows Central and Eastern Europe |\n| cp1251       | Windows Bulgarian, Byelorussian, Macedonian, Russian, Serbian |\n| cp1252       | Windows Western Europe (and US) |\n| cp1253       | Windows Greek |\n| cp1254       | Windows Turkish |\n| cp1255       | Windows Hebrew |\n| cp1256       | Windows Arabic |\n| cp1257       | Windows Baltic languages |\n| cp1258       | Windows Vietnamese |\n| shift_jis    | Windows Japanese |\n| gbk          | Windows Chinese (simplified) |\n| cp949        | Windows Korean Hangul |\n| cp950        | Windows Chinese (traditional) |\n| utf-8        | Universal encoding, used by everyone except NI for decades |\n\nNote that changing text code pages of VI files will not influence extraction\nof ZIP files which were stored inside RSRC sections, and the code pages of\nfile names within the ZIP. Use proper `unzip` switches to change these.\n\n# File format\n\nTo learn about file format, check out wiki of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefistotelis%2Fpylabview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmefistotelis%2Fpylabview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefistotelis%2Fpylabview/lists"}