Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why did the py ones get removed? #113

Open
ZuhuInc opened this issue Apr 5, 2024 · 4 comments
Open

why did the py ones get removed? #113

ZuhuInc opened this issue Apr 5, 2024 · 4 comments
Labels

Comments

@ZuhuInc
Copy link

ZuhuInc commented Apr 5, 2024

title

@a2x
Copy link
Owner

a2x commented Apr 5, 2024

Still needs to be readded.

@a2x a2x added the enhancement New feature or request label Apr 5, 2024
@interpretercast
Copy link

bcz it's gay

@IDhammaI
Copy link

IDhammaI commented May 8, 2024

import json


def convert_json_to_python_classes(json_path, output_path):
    with open(json_path, 'r', encoding='utf-8') as file:
        data = json.load(file)

    with open(output_path, 'w', encoding='utf-8') as file:
        for class_name, class_content in data['client.dll']['classes'].items():
            file.write(f"class {class_name}:\n")
            fields = class_content.get('fields', {})
            if not fields:
                file.write("    pass\n\n")
            else:
                for field_name, offset in fields.items():
                    hex_offset = hex(offset)
                    file.write(f"    {field_name} = {hex_offset}\n")
                file.write("\n")


json_path = 'client_dll.json'
output_python_path = 'output.py'
convert_json_to_python_classes(json_path, output_python_path)

use this python code to convert client_dll.json -> client_dll.py

@ZuhuInc
Copy link
Author

ZuhuInc commented May 8, 2024

import json


def convert_json_to_python_classes(json_path, output_path):
    with open(json_path, 'r', encoding='utf-8') as file:
        data = json.load(file)

    with open(output_path, 'w', encoding='utf-8') as file:
        for class_name, class_content in data['client.dll']['classes'].items():
            file.write(f"class {class_name}:\n")
            fields = class_content.get('fields', {})
            if not fields:
                file.write("    pass\n\n")
            else:
                for field_name, offset in fields.items():
                    hex_offset = hex(offset)
                    file.write(f"    {field_name} = {hex_offset}\n")
                file.write("\n")


json_path = 'client_dll.json'
output_python_path = 'output.py'
convert_json_to_python_classes(json_path, output_python_path)

use this python code to convert client_dll.json -> client_dll.py

Allraidy made a fix myself but thx anyway 😅

@a2x a2x added todo and removed enhancement New feature or request labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants