Function at 0x402970
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4225eb
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x438
mov eax, dword [0x42f040]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [esi + 0x38]
cmp eax, dword [esi + 0x3c]
je 0x4029be
mov dword [esi + 0x3c], eax
mov ecx, dword [esi + 0x44]
lea eax, [esi + 0x44]
mov edx, dword [esi + 0x48]
mov dword [ebp - 0x444], eax
cmp ecx, edx
je 0x4029e0
push ecx
call fcn.00404f20
mov eax, dword [esi + 0x44]
add esp, 4
mov dword [esi + 0x48], eax
mov ecx, dword [esi + 0x50]
mov edx, dword [esi + 0x54]
cmp ecx, edx
je 0x4029f9
push ecx
call fcn.00404f20
mov eax, dword [esi + 0x50]
add esp, 4
mov dword [esi + 0x54], eax
mov ecx, dword [esi + 0x5c]
lea eax, [esi + 0x5c]
mov edx, dword [esi + 0x60]
mov dword [ebp - 0x448], eax
cmp ecx, edx
je 0x402a1b
push ecx
call fcn.00404f20
mov eax, dword [esi + 0x5c]
add esp, 4
mov dword [esi + 0x60], eax
mov eax, dword [esi + 0x20]
cmp dword [eax - 4], 1
jle 0x402a2f
push dword [eax - 0xc]
lea ecx, [esi + 0x20]
call fcn.00401d80
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x424], eax
cmp eax, 0xffffffff
je 0x402cdb
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
lea esi, [edi + 3]
push esi
call fcn.0040dd96
push esi
push 0
push eax
mov dword [ebp - 0x440], eax
call fcn.0040f700
add esp, 0x10
lea eax, [ebp - 0x41c]
push 0
push eax
push edi
mov edi, dword [ebp - 0x440]
push edi
push dword [ebp - 0x424]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov al, byte [edi]
lea esi, [edi + 2]
push 0xd
push esi
mov byte [ebp - 0x41d], al
call fcn.0040ee60
add esp, 8
test eax, eax
je 0x402c7a
nop word [eax + eax]
mov ecx, esi
sub ecx, edi
cmp ecx, dword [ebp - 0x41c]
jg 0x402c7a
push esi
mov byte [eax], 0
lea eax, [ebp - 0x418]
push 0x400
push eax
call fcn.00415abf
lea ecx, [ebp - 0x418]
add esp, 0xc
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402af1
sub ecx, edx
mov al, byte [ebp + ecx - 0x419]
cmp al, 0xd
je 0x402b09
cmp al, 0xa
jne 0x402b1f
lea eax, [ecx - 1]
cmp eax, 0x400
jae 0x402cdf
mov byte [ebp + eax - 0x418], 0
inc esi
add esi, ecx
cmp byte [esi], 0xa
jne 0x402b28
inc esi
movsx eax, byte [ebp - 0x41d]
sub eax, 0x43
je 0x402b8b
sub eax, 1
jne 0x402cb2
xorps xmm0, xmm0
mov dword [ebp - 0x42c], eax
lea ecx, [ebp - 0x418]
mov dword [ebp - 0x428], eax
movups xmmword [ebp - 0x43c], xmm0
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402b60
sub ecx, edx
lea eax, [ebp - 0x418]
push ecx
push eax
lea ecx, [ebp - 0x43c]
call fcn.00404f90
mov edx, dword [ebp - 0x444]
mov dword [ebp - 4], 0
jmp 0x402bdb
xorps xmm0, xmm0
mov dword [ebp - 0x42c], 0
lea ecx, [ebp - 0x418]
mov dword [ebp - 0x428], 0
movups xmmword [ebp - 0x43c], xmm0
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402bb2
sub ecx, edx
lea eax, [ebp - 0x418]
push ecx
push eax
lea ecx, [ebp - 0x43c]
call fcn.00404f90
mov edx, dword [ebp - 0x448]
mov dword [ebp - 4], 1
mov eax, dword [edx + 4]
cmp eax, dword [edx + 8]
je 0x402c0c
movups xmm0, xmmword [ebp - 0x43c]
mov ecx, 0xf
mov byte [ebp - 0x43c], 0
movups xmmword [eax], xmm0
movq xmm0, qword [ebp - 0x42c]
movq qword [eax + 0x10], xmm0
add dword [edx + 4], 0x18
jmp 0x402c21
lea ecx, [ebp - 0x43c]
push ecx
push eax
mov ecx, edx
call fcn.004053a0
mov ecx, dword [ebp - 0x428]
mov dword [ebp - 4], 0xffffffff
cmp ecx, 0xf
jbe 0x402c5c
mov edx, dword [ebp - 0x43c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x402c52
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x402ce4
push ecx
push edx
call fcn.0040db60
add esp, 8
mov al, byte [esi]
add esi, 2
push 0xd
push esi
mov byte [ebp - 0x41d], al
call fcn.0040ee60
add esp, 8
test eax, eax
jne 0x402ac0
push dword [ebp - 0x424]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040db91
add esp, 4
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0040d81c
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
push 0x18e
push str.E:TempDocumentsVisual_Studio_2022ProjectExFC_PatcherExFC_PatcherPatchThread.cpp
push str.0___Invalid_Patch_Code_
call fcn.00408690
push edi
call fcn.0040db91
add esp, 0x10
push dword [ebp - 0x424]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x402c94
call fcn.0040dcb9
call fcn.004117e0
int3