Created
May 2, 2024 22:28
-
-
Save WheretIB/1b94d8d53b6af60aa7b7179f351d01e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Vertex = { p: vector, n: vector } | |
local function f(v: Vertex, t: vector, b: vector) | |
return v.p:Cross(t):Dot(b) | |
end | |
; function f($arg0, $arg1, $arg2) line 10 | |
; align 32 using ud2 | |
.L11: | |
cmp dword ptr [r14+0Ch],6 | |
jne .L2 | |
cmp dword ptr [r14+01Ch],4 | |
jne .L2 | |
cmp dword ptr [r14+02Ch],4 | |
jne .L2 | |
.L12: | |
.L13: | |
11: return v.p:Cross(t):Dot(b) | |
GETTABLEKS R3 R0 K0 ['p'] | |
any <- table, string | |
mov rax,qword ptr [r14] | |
mov rdx,qword ptr [rax+020h] | |
mov rcx,qword ptr [rsp+038h] | |
movzx ecx,byte ptr [rcx+3] | |
and cl,byte ptr [rax+7] | |
shl ecx,5 | |
add rdx,rcx | |
mov eax,dword ptr [rdx+01Ch] | |
and eax,Fh | |
cmp eax,5 | |
jne .L14 | |
mov rax,qword ptr [r12] | |
cmp rax,qword ptr [rdx+010h] | |
jne .L14 | |
cmp dword ptr [rdx+0Ch],0 | |
je .L14 | |
vmovups xmm0,xmmword ptr [rdx] | |
vmovups xmmword ptr [r14+030h],xmm0 | |
.L15: | |
MOVE R5 R1 | |
vector <- vector, any | |
vmovups xmm0,xmmword ptr [r14+010h] | |
vmovups xmmword ptr [r14+050h],xmm0 | |
NAMECALL R3 R3 K1 ['Cross'] | |
function <- vector, string | |
.L16: | |
cmp dword ptr [r14+03Ch],4 | |
jne .L17 | |
cmp dword ptr [r14+05Ch],4 | |
jne .L17 | |
vcvtss2sd xmm0,xmm0,dword ptr [r14+030h] | |
vcvtss2sd xmm1,xmm1,dword ptr [r14+050h] | |
vcvtss2sd xmm2,xmm2,dword ptr [r14+034h] | |
vcvtss2sd xmm3,xmm3,dword ptr [r14+054h] | |
vcvtss2sd xmm4,xmm4,dword ptr [r14+038h] | |
vcvtss2sd xmm5,xmm5,dword ptr [r14+058h] | |
vmulsd xmm6,xmm2,xmm5 | |
vmulsd xmm7,xmm4,xmm3 | |
vsubsd xmm6,xmm6,xmm7 | |
vmulsd xmm4,xmm4,xmm1 | |
vmulsd xmm5,xmm0,xmm5 | |
vsubsd xmm4,xmm4,xmm5 | |
vmulsd xmm0,xmm0,xmm3 | |
vmulsd xmm2,xmm2,xmm1 | |
vsubsd xmm0,xmm0,xmm2 | |
vcvtsd2ss xmm1,xmm6,xmm6 | |
vmovss dword ptr [r14+030h],xmm1 | |
vcvtsd2ss xmm1,xmm4,xmm4 | |
vmovss dword ptr [r14+034h],xmm1 | |
vcvtsd2ss xmm1,xmm0,xmm0 | |
vmovss dword ptr [r14+038h],xmm1 | |
MOVE R5 R2 | |
vector <- vector, any | |
.L18: | |
vmovups xmm0,xmmword ptr [r14+020h] | |
vmovups xmmword ptr [r14+050h],xmm0 | |
NAMECALL R3 R3 K2 ['Dot'] | |
function <- vector, string | |
.L19: | |
cmp dword ptr [r14+05Ch],4 | |
jne .L20 | |
vcvtss2sd xmm0,xmm0,dword ptr [r14+030h] | |
vcvtss2sd xmm1,xmm1,dword ptr [r14+050h] | |
vmulsd xmm0,xmm0,xmm1 | |
vcvtss2sd xmm1,xmm1,dword ptr [r14+034h] | |
vcvtss2sd xmm2,xmm2,dword ptr [r14+054h] | |
vmulsd xmm1,xmm1,xmm2 | |
vcvtss2sd xmm2,xmm2,dword ptr [r14+038h] | |
vcvtss2sd xmm3,xmm3,dword ptr [r14+058h] | |
vmulsd xmm2,xmm2,xmm3 | |
vaddsd xmm0,xmm0,xmm1 | |
vaddsd xmm0,xmm0,xmm2 | |
vmovsd qword ptr [r14+030h],xmm0 | |
mov dword ptr [r14+03Ch],3 | |
lea rax,[r14+040h] | |
mov qword ptr [r15+8],rax | |
RETURN R3 -1 | |
[...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment