mirror of
https://github.com/qilingframework/qiling.git
synced 2026-10-12 02:21:40 +00:00
Fix FLS FiberManager writing last_error to a dead attribute
FiberManager.free/set/get set `self.last_error` on the FiberManager instance, but nothing ever reads that attribute. The Windows last-error that GetLastError returns lives on `ql.os.last_error`, so FlsFree, FlsSetValue and FlsGetValue never actually reported ERROR_INVALID_PARAMETER for an invalid FLS index. Route the three writes to `self.ql.os.last_error`, consistent with every other kernel32 hook. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
499218bd1a
commit
d8f904c44a
@@ -33,7 +33,7 @@ class FiberManager:
|
||||
|
||||
def free(self, idx: int) -> bool:
|
||||
if idx not in self.fibers:
|
||||
self.last_error = ERROR_INVALID_PARAMETER
|
||||
self.ql.os.last_error = ERROR_INVALID_PARAMETER
|
||||
return False
|
||||
|
||||
fiber = self.fibers[idx]
|
||||
@@ -99,7 +99,7 @@ class FiberManager:
|
||||
|
||||
def set(self, idx: int, data: int) -> bool:
|
||||
if idx not in self.fibers:
|
||||
self.last_error = ERROR_INVALID_PARAMETER
|
||||
self.ql.os.last_error = ERROR_INVALID_PARAMETER
|
||||
return False
|
||||
|
||||
self.fibers[idx].data = data
|
||||
@@ -108,7 +108,7 @@ class FiberManager:
|
||||
|
||||
def get(self, idx: int) -> int:
|
||||
if idx not in self.fibers:
|
||||
self.last_error = ERROR_INVALID_PARAMETER
|
||||
self.ql.os.last_error = ERROR_INVALID_PARAMETER
|
||||
return 0
|
||||
|
||||
return self.fibers[idx].data
|
||||
|
||||
Reference in New Issue
Block a user