Repository navigation
Conversation
MIPS o32 emits no .plt and no R_MIPS_JUMP_SLOT relocations: libc imports are
called indirectly through a $gp-relative GOT slot (lw $t9, off($gp); jalr $t9),
with the stub->name correspondence carried by the dynamic-symbol GOT layout
(DT_MIPS_LOCAL_GOTNO/DT_MIPS_GOTSYM/DT_PLTGOT, got_index(i)=LOCAL_GOTNO+(i-GOTSYM)).
This is layout (b) from the task brief (classic .MIPS.stubs), and the names ARE
recoverable statically -- a clean port, not a documented seam.
elf_plt::resolve_mips_imports (the analog of MIPS_ElfExtension.fixupGot /
processMipsStubsSection) walks the external-symbol GOT window and names each
import's .MIPS.stubs stub address (the GOT slot's static contents). To resolve
the indirect call, mips_got_const_ranges marks the GOT external slots constant
(ObjectLoadImage::const_ranges -> get_readonly, the setConstant analog) and
bootstrap_from_elf turns on readonlypropagate for MIPS only so the engine folds
the GOT load to the stub address and ActionDeindirect resolves the call to the
named import. Scoped to MIPS; option readonly off restores the raw GOT load.
BEFORE: (*(code *)(dat_411040 & 0xfffffffe))("hello");
AFTER: puts("hello"); printf(0x400888,v1);
Fixture plt_mips32 (linked BE MIPS32, -O0, plain puts/printf) + e2e
verify_mips_plt.rs (ran, not skipped) + two loadimage_object unit tests.
Gates: make test 675/675 PARITY OK; make test-stages 158/158 PARITY OK;
make rust-test green. Purely additive on the real-ELF path; the XML datatest
oracle (which never reaches bootstrap_from_elf) is structurally untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FvRnfTgYKoZvS2TEvdYpWb
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FvRnfTgYKoZvS2TEvdYpWb
mahaloz
added a commit
that referenced
this pull request
Sep 19, 2026
… every target the vararg rule admits A closed format prototype also changes how P4 scores the argument trials of the calls around it. On AArch64 and ARM32 firmware that added more wrong arguments to neighbouring calls than it removed (an x8 of 0 ahead of the real arguments; iproute2 ip's parse_rtattr losing its len), while on x86 every such change removed a phantom. static now resolves at load on x86 only; full still resolves on every target VarargAbi admits. Stage passes 24-26 pin AArch64 default == off and full typed; #13/#19/#23/#28 pin ARM the same way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 19, 2026
… every target the vararg rule admits A closed format prototype also changes how P4 scores the argument trials of the calls around it. On AArch64 and ARM32 firmware that added more wrong arguments to neighbouring calls than it removed (an x8 of 0 ahead of the real arguments; iproute2 ip's parse_rtattr losing its len), while on x86 every such change removed a phantom. static now resolves at load on x86 only; full still resolves on every target VarargAbi admits. Stage passes 24-26 pin AArch64 default == off and full typed; #13/#19/#23/#28 pin ARM the same way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Oct 2, 2026
…ter load A MULTIEQUAL on the global only joins what reaches it, so the load walks pass through one. New fixture functions e_calc, e_two, e_long, e_loop and e_after, stage assertions #23-#30 and the spec prose for the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012UUBmGqZTcD5N8LxpVsiQt
mahaloz
added a commit
that referenced
this pull request
Oct 2, 2026
…ter load A MULTIEQUAL on the global only joins what reaches it, so the load walks pass through one. New fixture functions e_calc, e_two, e_long, e_loop and e_after, stage assertions #23-#30 and the spec prose for the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012UUBmGqZTcD5N8LxpVsiQt
mahaloz
added a commit
that referenced
this pull request
Oct 2, 2026
…ter load A MULTIEQUAL on the global only joins what reaches it, so the load walks pass through one. New fixture functions e_calc, e_two, e_long, e_loop and e_after, stage assertions #23-#30 and the spec prose for the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012UUBmGqZTcD5N8LxpVsiQt
mahaloz
added a commit
to borancar/kuna
that referenced
this pull request
Nov 14, 2026
…dows x86, and type its target On main calleereginputs is on by default, so the virtual-dispatch case now runs on every x86-32 image. Gate it to x86-32 Windows like the direct case (Borland and other x86-32 specs stay inert). A call the caller cleans up after (add esp,4: a C table of __cdecl function pointers reached through ECX) keeps the default, since a __thiscall callee removes its own arguments; a COM call whose interface is pushed from the register ECX was copied from keeps it too. Lay out the target type of a __thiscall-modeled indirect call under that model, so the call prints through a function pointer instead of an uncallable void *. Fixture gains ctable/comcopy (rebuilt from its recipe); stage Noelo-Lab#23-Noelo-Lab#25. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKQeLQDThvbHGNoGw8h
mahaloz
added a commit
that referenced
this pull request
Nov 22, 2026
pushan_vm2_x86_64 gets a SEL handler that computes the next VPC
arithmetically from the low bit of the top of stack and from a comparison
below it (no flag test, as VMProtect's vJCC), and f_sel: x = a0 < 5 stored as
1 or 0 on two paths that join, then SEL on x and a1 < 3. The join merges x
into a symbol recorded as {0, 1}; without the symbol split the VPC stays an
ite over a byte of it and the next dispatch is unresolved (bin before
5e1e0ab0a: "incomplete: 1 unresolved computed jump"); with it all three
returns are recovered. New opcode and program are appended so every other
program's bytes, the data symbols and the existing outputs are unchanged.
Stage kuna-pushan-sound #23 pins the three returns, #20 now counts 17
devirtualized functions; baseline-stages re-recorded (4955 passing keys).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0179iMKQR2hseBprKvbvZRUv
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Analysis-tier: MIPS PLT/stub import-name recovery (Increment 27)
Recovers MIPS libc import names so calls render
puts/printf, notsub_<addr>.What the toolchain produces (investigated, not assumed)
mips-linux-gnu-gcc -O0on amaincallingputs/printfproduces a classic.MIPS.stubs+$gp-relative GOT layout (task brief option b), NOT a regular.plt+R_MIPS_JUMP_SLOT:readelf -r→ "There are no relocations in this file." — noR_MIPS_JUMP_SLOT, no.plt..MIPS.stubsPROGBITS section oflw $t9,-32752($gp); move $t7,$ra; jalr $t9; li $t8,<dynidx>lazy resolver stubs.DT_MIPS_LOCAL_GOTNO=6,DT_MIPS_GOTSYM=5,DT_PLTGOT=0x411020.This is a clean port, not a documented seam — the names ARE recoverable statically. Calls are indirect through a GOT slot (
lw $t9, off($gp); jalr $t9); the stub→name correspondence is the dynamic-symbol GOT layout:got_index(i) = LOCAL_GOTNO + (i - GOTSYM). Each FUNC import's GOT slot holds its.MIPS.stubsstub address (= the dynsymst_value). Cross-checked on the fixture:puts(dynidx 7 → GOT slot0x411040→ stub0x400800),printf(dynidx 8 → GOT slot0x411044→ stub0x4007f0).The port — two halves, both faithful to
MIPS_ElfExtensionelf_plt::resolve_mips_imports, thefixupGotanalog): walks the external-symbol GOT window and names each import's stub address (the slot's static contents = Ghidra'srefAddr). Gated onMips | Mips64, runs before the relocation-driven path (which would early-return on MIPS's empty reloc map). No-op off-MIPS.elf_plt::mips_got_const_ranges+ObjectLoadImage::const_ranges→get_readonly, thesetConstantanalog): marks the GOT external slots constant so the engine folds thelw $t9, off($gp)load (address already$gp-constant from Increment 17) to the stub address;bootstrap_from_elfenablesreadonlypropagatefor MIPS only soActionVarnodeProps::fillinReadOnly+ActionDeindirectresolve the call to the named stub.option readonly offrestores the raw GOT-load rendering.BEFORE / AFTER (
kuna decompile plt_mips32 main)(The
printfformat-string pointer not rendering as a string literal is a separate string-rendering concern, independent of import naming;puts's"hello"already renders.)elf_plt.rsadditionsresolve_mips_imports— MIPS arm ofresolve_plt_imports, gatedMips | Mips64.mips_got_const_ranges— the GOT external slots to mark constant.mips_external_got_entries— shared GOT-window walk.read_mips_dynamic_tags—DT_MIPS_LOCAL_GOTNO/DT_MIPS_GOTSYM/DT_PLTGOTfrom.dynamic.read_word_at_vma+ endianness helpers.Plus
ObjectLoadImage::const_ranges(threaded throughget_readonly/adjust_vma) and the MIPS-onlyreadonlypropagatetoggle inbootstrap_from_elf.Tests
plt_mips32(linked BE MIPS32,-O0for plainputs/printf) + source + README provenance.kuna-console/tests/verify_mips_plt.rs(modeled onverify_riscv64_plt.rs) — ran, not skipped (mips32be.slabuilt; asserts a real decode ofmain+puts(/printf(named,dat_411040/dat_411044gone).loadimage_objectunit tests (mips_stub_imports_resolve_to_named_functions,mips_got_const_ranges_cover_external_slots).Gate results
make test— 675/675 PARITY OKmake test-stages— 158/158 PARITY OKmake rust-test— green (exit 0)Purely additive on the real-ELF path; the XML datatest oracle (which never constructs an
ObjectLoadImageor reachesbootstrap_from_elf) is structurally untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_01FvRnfTgYKoZvS2TEvdYpWb