Skip to content

Conversation

4z0t
Copy link
Owner

@4z0t 4z0t commented Nov 12, 2024

Closes #3 and adds a bit of statistics gathered.
Allows to create more readable hooks with .hook file format, which is parsed by patcher into .cpp for further process by compiler.
Before using new hooks format:

#include "../asm.h"
#include "../define.h"
asm(
    
    SECTION(1, 0x86EF2B)
    "jmp "QU(CustomDrawEnter)";"
    
    SECTION(2, 0x456264)
    "subss xmm0, ds:"QU(THICKNESS)";"
    
    SECTION(3, 0x4562CD)
    "addss xmm0, ds:"QU(THICKNESS)";"
    
    SECTION(4, 0x4561A8)
    "call "QU(GetCircleColor)";"
    
    SECTION(5, 0x455E53)
    "mov ecx, 0x30;"
    
    SECTION(6, 0x4561E4)
    "cmp eax, 0x30;"
    
    SECTION(7, 0x455E30)
    "fld dword ptr ["QU(SEGMENT_RAD)"];"  
);

After:

0x86EF2B:
    jmp @CustomDrawEnter

//allow changing thickness of line
0x456264:
    subss xmm0, ds:@THICKNESS

//allow changing thickness of line
0x4562CD:
    addss xmm0, ds:@THICKNESS

//allow changing color
0x4561A8:
    call @GetCircleColor

//increase number of segements
0x455E53:
    mov ecx, 0x30
    
0x4561E4:
    cmp eax, 0x30

//adjust angle to number of segments 2*pi/segments
0x455E30:
    fld dword ptr [@SEGMENT_RAD]

@4z0t 4z0t merged commit cf69242 into main Nov 12, 2024
@4z0t 4z0t deleted the Stats branch November 12, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant