fe2a6db786
rust / build / test / clippy / fmt (push) Has been cancelled
Layout:
- src/ .NET 10 x64 reference: MxNativeCodec, MxNativeClient,
MxAsbClient, probes, tests, harnesses. Executable spec.
- design/ Architectural plan for the Rust port (M0–M6), error
model, protocol invariants, risks (R1–R16), adversarial
review log (review.md).
- rust/ Rust workspace. M0 skeleton + M1 codec parity.
mxaccess-codec: 215 unit tests + 2 cross-implementation
parity tests (byte-identical against .NET reference).
Other crates are M0 stubs awaiting M2+.
- captures/ Frida + netsh + pcap evidence per CLAUDE.md
("captures are evidence, not throwaway logs").
- analysis/ Decompiled C# (frida/proxy/decompiled-*),
Ghidra exports for native DLLs (`exports/` only —
working state at `projects/` and AVEVA's input
binaries at `input/` are gitignored).
- docs/ Reverse-engineering reference docs.
- tools/ Setup-LiveProbeEnv.ps1 (Infisical credential fetcher),
Compute-Crc.ps1 (.NET parity helper).
- .github/workflows/ Rust CI: fmt + build + test + clippy on Windows.
- LICENSE MIT (Joseph Doherty, 2026).
Verified:
- cargo test --workspace → 217 passed (215 unit + 2 .NET parity), 0 failed
- cargo clippy --workspace -- -D warnings → clean
- cargo fmt --all -- --check → clean
- cargo publish --dry-run -p mxaccess-codec → packages cleanly
Excluded from history (see .gitignore):
- **/bin, **/obj, **/target — build artifacts
- analysis/ghidra/projects/ — Ghidra working state (regenerable)
- analysis/ghidra/input/ — AVEVA proprietary DLLs (vendor IP)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
205 lines
6.8 KiB
Markdown
205 lines
6.8 KiB
Markdown
# LmxProxy.dll selected decompile
|
|
|
|
## FUN_10016b50 at 10016b50
|
|
|
|
Signature: `HRESULT __stdcall FUN_10016b50(uint param_1, undefined4 param_2, undefined4 * param_3)`
|
|
|
|
```c
|
|
|
|
/* WARNING: Function: __EH_prolog3_catch replaced with injection: EH_prolog3 */
|
|
/* WARNING: Function: __EH_epilog3 replaced with injection: EH_epilog3 */
|
|
|
|
HRESULT FUN_10016b50(uint param_1,undefined4 param_2,undefined4 *param_3)
|
|
|
|
{
|
|
uint uVar1;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar2;
|
|
undefined *puVar3;
|
|
int iVar4;
|
|
int *piVar5;
|
|
DWORD DVar6;
|
|
undefined4 *puVar7;
|
|
HRESULT HVar8;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar9;
|
|
uint uVar10;
|
|
HRESULT HVar11;
|
|
undefined4 uVar12;
|
|
wchar_t *pwVar13;
|
|
_func_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr
|
|
*p_Var14;
|
|
undefined1 local_40 [36];
|
|
undefined *local_1c;
|
|
undefined4 local_18 [4];
|
|
int local_8;
|
|
undefined4 uStack_4;
|
|
|
|
uStack_4 = 0x30;
|
|
local_8 = 0x10016b5c;
|
|
local_18[0] = 0;
|
|
uVar12 = 0;
|
|
uVar10 = 3;
|
|
puVar3 = FUN_10003248();
|
|
iVar4 = FUN_10003897(puVar3,uVar10);
|
|
puVar3 = FUN_10003248();
|
|
uVar10 = FUN_1000305b(puVar3,iVar4,uVar12);
|
|
if ((char)uVar10 != '\0') {
|
|
pwVar13 = L"OnSetAttributeResult callback received";
|
|
piVar5 = (int *)FUN_10003248();
|
|
FUN_100031b7(piVar5,pwVar13);
|
|
}
|
|
if (DAT_10029594 != 0) {
|
|
DVar6 = GetCurrentThreadId();
|
|
uVar10 = param_1;
|
|
if (DVar6 == DAT_10029594) {
|
|
piVar5 = (int *)(param_1 + 0xc);
|
|
iVar4 = *(int *)(param_1 + 8);
|
|
FUN_1000f663((void *)(iVar4 + 0x2c),¶m_1,piVar5);
|
|
uVar1 = param_1;
|
|
if ((param_1 == *(uint *)(iVar4 + 0x30)) ||
|
|
(FUN_1000f5ef((void *)(param_1 + 0x3c),¶m_1,(int *)(uVar10 + 0x10)),
|
|
param_1 == *(uint *)(uVar1 + 0x40))) {
|
|
return -0x7fffbffb;
|
|
}
|
|
HVar8 = FUN_10003f60(local_18,(undefined2 *)param_3,1);
|
|
if (-1 < HVar8) {
|
|
local_8 = 2;
|
|
FUN_1001611f((void *)(*(int *)(uVar10 + 8) + 0xc),*piVar5,*(long *)(uVar10 + 0x10),local_18)
|
|
;
|
|
local_8 = 0xffffffff;
|
|
HVar8 = FUN_10016d1a();
|
|
return HVar8;
|
|
}
|
|
bVar2 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 8));
|
|
if (bVar2 == (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
return HVar8;
|
|
}
|
|
HVar11 = HVar8;
|
|
p_Var14 = endl_exref;
|
|
pbVar9 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 8),
|
|
L"CUserConnectionCallback::OnSetAttributeResult - Create MxStatus SafeArray failed. hr = "
|
|
);
|
|
pbVar9 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar9,HVar11);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar9,p_Var14);
|
|
return HVar8;
|
|
}
|
|
local_1c = &DAT_100295bc;
|
|
EnterCriticalSection((LPCRITICAL_SECTION)&DAT_100295bc);
|
|
local_8 = 0;
|
|
puVar7 = FUN_10015db2(local_40,(int *)(-(uint)(param_1 != 4) & param_1),*param_3,param_3[1],
|
|
param_3[2],param_3[3],param_2);
|
|
local_8._0_1_ = 1;
|
|
FUN_1001654d(&DAT_100295b0,DAT_100295b0,puVar7);
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
FUN_1000d639((int)local_40);
|
|
local_8 = 0xffffffff;
|
|
LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_100295bc);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
```
|
|
|
|
## FUN_10016d4b at 10016d4b
|
|
|
|
Signature: `HRESULT __stdcall FUN_10016d4b(int * param_1, undefined4 param_2, undefined4 * param_3)`
|
|
|
|
```c
|
|
|
|
/* WARNING: Function: __EH_prolog3_catch replaced with injection: EH_prolog3 */
|
|
/* WARNING: Function: __EH_epilog3 replaced with injection: EH_epilog3 */
|
|
|
|
HRESULT FUN_10016d4b(int *param_1,undefined4 param_2,undefined4 *param_3)
|
|
|
|
{
|
|
int *piVar1;
|
|
int *piVar2;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar3;
|
|
undefined *puVar4;
|
|
int iVar5;
|
|
int *piVar6;
|
|
DWORD DVar7;
|
|
undefined4 *puVar8;
|
|
HRESULT HVar9;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar10;
|
|
uint uVar11;
|
|
undefined4 uVar12;
|
|
wchar_t *pwVar13;
|
|
_func_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr
|
|
*p_Var14;
|
|
undefined1 local_40 [36];
|
|
undefined *local_1c;
|
|
undefined4 local_18 [4];
|
|
int local_8;
|
|
undefined4 uStack_4;
|
|
|
|
uStack_4 = 0x30;
|
|
local_8 = 0x10016d57;
|
|
uVar12 = 0;
|
|
uVar11 = 3;
|
|
puVar4 = FUN_10003248();
|
|
iVar5 = FUN_10003897(puVar4,uVar11);
|
|
puVar4 = FUN_10003248();
|
|
uVar11 = FUN_1000305b(puVar4,iVar5,uVar12);
|
|
if ((char)uVar11 != '\0') {
|
|
pwVar13 = L"OperationComplete callback received";
|
|
piVar6 = (int *)FUN_10003248();
|
|
FUN_100031b7(piVar6,pwVar13);
|
|
}
|
|
if (DAT_10029594 != 0) {
|
|
DVar7 = GetCurrentThreadId();
|
|
piVar6 = param_1;
|
|
if (DVar7 == DAT_10029594) {
|
|
piVar1 = param_1 + 4;
|
|
iVar5 = param_1[3];
|
|
FUN_1000f663((void *)(iVar5 + 0x2c),¶m_1,piVar1);
|
|
piVar2 = param_1;
|
|
if ((param_1 == *(int **)(iVar5 + 0x30)) ||
|
|
(FUN_1000f5ef(param_1 + 0xf,¶m_1,piVar6 + 5), param_1 == (int *)piVar2[0x10])) {
|
|
return -0x7fffbffb;
|
|
}
|
|
HVar9 = FUN_10003f60(local_18,(undefined2 *)param_3,1);
|
|
if (-1 < HVar9) {
|
|
local_8 = 2;
|
|
FUN_10016271((void *)(piVar6[3] + 0xc),*piVar1,piVar6[5],local_18);
|
|
local_8 = 0xffffffff;
|
|
HVar9 = FUN_10016f05();
|
|
return HVar9;
|
|
}
|
|
bVar3 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 8));
|
|
if (bVar3 == (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
return HVar9;
|
|
}
|
|
p_Var14 = endl_exref;
|
|
pbVar10 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 8),
|
|
L"CUserConnectionCallback::CUserConnectionCallback::OperationComplete - Create MxStatus SafeArray failed. hr = "
|
|
);
|
|
pbVar10 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar10,HVar9);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar10,p_Var14);
|
|
HVar9 = FUN_10016f05();
|
|
return HVar9;
|
|
}
|
|
local_1c = &DAT_100295bc;
|
|
EnterCriticalSection((LPCRITICAL_SECTION)&DAT_100295bc);
|
|
local_8 = 0;
|
|
puVar8 = FUN_10015e4e(local_40,param_1,*param_3,param_3[1],param_3[2],param_3[3],param_2);
|
|
local_8._0_1_ = 1;
|
|
FUN_1001654d(&DAT_100295b0,DAT_100295b0,puVar8);
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
FUN_1000d639((int)local_40);
|
|
local_8 = 0xffffffff;
|
|
LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_100295bc);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
```
|
|
|