Skip to content

Instantly share code, notes, and snippets.

@StackOverflowExcept1on
Created August 28, 2024 08:50
Show Gist options
  • Save StackOverflowExcept1on/6aea84ef056f94065f25c0bfe796b70b to your computer and use it in GitHub Desktop.
Save StackOverflowExcept1on/6aea84ef056f94065f25c0bfe796b70b to your computer and use it in GitHub Desktop.
;
; +-------------------------------------------------------------------------+
; | This file was generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2024 Hex-Rays, <[email protected]> |
; | License info: 48-2137-ACAB-99 |
; | HexRays |
; +-------------------------------------------------------------------------+
;
; Input SHA256 : 938CCA4D92B67B4075858AF0B4D688425D95F2AA0ADECCCBC7BBEE26A52A9FF7
; Input MD5 : 9CFCE9BFE3D672A0776CA75ACD008BA0
; Input CRC32 : AD93E46B
; Compiler : GNU C++
; File Name : /mnt/tmpfs/libprogram-stage1-eef00c8be8d.so
; Format : ELF64 for x86-64 (Shared object)
; Shared Name 'libprogram.so'
;
; Source File : 'crtstuff.c'
; Source File : 'program.544b1767a0473df8-cgu.0'
; Source File : 'crtstuff.c'
.686p
.mmx
.model flat
.intel_syntax noprefix
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read
LOAD segment mempage public 'DATA' use64
assume cs:LOAD
dword_0 dd 464C457Fh ; DATA XREF: LOAD:00000000000002B0↓o
; LOAD:00000000000002C8↓o ...
; File format: \x7FELF
db 2 ; File class: 64-bit
db 1 ; Data encoding: little-endian
db 1 ; File version
db 0 ; OS/ABI: UNIX System V ABI
db 0 ; ABI Version
db 7 dup(0) ; Padding
dw 3 ; File type: Shared object
dw 3Eh ; Machine: x86-64
dd 1 ; File version
dq 0 ; Entry point
dq 40h ; PHT file offset
dq 1640h ; SHT file offset
dd 0 ; Processor-specific flags
dw 40h ; ELF header size
dw 38h ; PHT entry size
dw 0Ah ; Number of entries in PHT
dw 40h ; SHT entry size
dw 1Ch ; Number of entries in SHT
dw 1Ah ; SHT entry index for string table
; ELF64 Program Header
; PHT Entry 0
dword_40 dd 6 ; DATA XREF: LOAD:0000000000000050↓o
; Type: PHDR
dd 4 ; Flags
dq 40h ; File offset
dq offset dword_40 ; Virtual address
dq 40h ; Physical address
dq 230h ; Size in file image
dq 230h ; Size in memory image
dq 8 ; Alignment
; PHT Entry 1
dd 1 ; Type: LOAD
dd 4 ; Flags
dq 0 ; File offset
dq 0 ; Virtual address
dq 0 ; Physical address
dq 654h ; Size in file image
dq 654h ; Size in memory image
dq 1000h ; Alignment
; PHT Entry 2
dd 1 ; Type: LOAD
dd 5 ; Flags
dq 654h ; File offset
dq offset _init_proc ; Virtual address
dq 1654h ; Physical address
dq 54Ch ; Size in file image
dq 54Ch ; Size in memory image
dq 1000h ; Alignment
; PHT Entry 3
dd 1 ; Type: LOAD
dd 6 ; Flags
dq 0BA0h ; File offset
dq offset __do_global_dtors_aux_fini_array_entry ; Virtual address
dq 2BA0h ; Physical address
dq 248h ; Size in file image
dq 460h ; Size in memory image
dq 1000h ; Alignment
; PHT Entry 4
dd 1 ; Type: LOAD
dd 6 ; Flags
dq 0DE8h ; File offset
dq offset __dso_handle ; Virtual address
dq 3DE8h ; Physical address
dq 8 ; Size in file image
dq 9 ; Size in memory image
dq 1000h ; Alignment
; PHT Entry 5
dd 2 ; Type: DYNAMIC
dd 6 ; Flags
dq 0C28h ; File offset
dq offset stru_2C28 ; Virtual address
dq 2C28h ; Physical address
dq 170h ; Size in file image
dq 170h ; Size in memory image
dq 8 ; Alignment
; PHT Entry 6
dd 6474E552h ; Type: RO-AFTER
dd 4 ; Flags
dq 0BA0h ; File offset
dq offset __do_global_dtors_aux_fini_array_entry ; Virtual address
dq 2BA0h ; Physical address
dq 248h ; Size in file image
dq 460h ; Size in memory image
dq 1 ; Alignment
; PHT Entry 7
dd 6474E550h ; Type: EH_FRAME
dd 4 ; Flags
dq 5D0h ; File offset
dq offset unk_5D0 ; Virtual address
dq 5D0h ; Physical address
dq 1Ch ; Size in file image
dq 1Ch ; Size in memory image
dq 4 ; Alignment
; PHT Entry 8
dd 6474E551h ; Type: STACK
dd 6 ; Flags
dq 0 ; File offset
dq 0 ; Virtual address
dq 0 ; Physical address
dq 0 ; Size in file image
dq 0 ; Size in memory image
dq 0 ; Alignment
; PHT Entry 9
dd 4 ; Type: NOTE
dd 4 ; Flags
dq 270h ; File offset
dq offset dword_270 ; Virtual address
dq 270h ; Physical address
dq 24h ; Size in file image
dq 24h ; Size in memory image
dq 4 ; Alignment
; ELF Note Entry
dword_270 dd 4 ; DATA XREF: LOAD:0000000000000248↑o
; Name Size
dd 14h ; Desc Size
dd 3 ; Type: NT_GNU_BUILD_ID
aGnu db 'GNU',0 ; Name
db 0DFh, 1Fh, 64h, 0C6h, 0FBh, 27h, 54h, 4Eh, 0F3h, 0FAh ; Desc
db 0E5h, 0B7h, 80h, 28h, 41h, 0DDh, 0A7h, 29h, 0C8h, 8Ch
align 8
; ELF Symbol Table
Elf64_Sym <0>
Elf64_Sym <offset aGmonStart - offset unk_378, 20h, 0, 0, \ ; "__gmon_start__"
offset dword_0, 0>
Elf64_Sym <offset aItmDeregistert - offset unk_378, 20h, 0, 0, \ ; "_ITM_deregisterTMCloneTable"
offset dword_0, 0>
Elf64_Sym <offset aItmRegistertmc - offset unk_378, 20h, 0, 0, \ ; "_ITM_registerTMCloneTable"
offset dword_0, 0>
Elf64_Sym <offset aCxaFinalize - offset unk_378, 20h, 0, 0, \ ; "__cxa_finalize"
offset dword_0, 0>
Elf64_Sym <offset aMemcpy - offset unk_378, 10h, 0, 0, offset dword_0,\ ; "memcpy"
0>
Elf64_Sym <offset aGrPanic - offset unk_378, 10h, 0, 0, \ ; "gr_panic"
offset dword_0, 0>
Elf64_Sym <offset aInit - offset unk_378, 12h, 0, 0Ch, offset init, \ ; "init"
2Fh>
; ELF GNU Hash Table
elf_gnu_hash_nbuckets dd 1
elf_gnu_hash_symbias dd 7
elf_gnu_hash_bitmask_nwords dd 1
elf_gnu_hash_shift dd 1Ah
elf_gnu_hash_indexes dq 200000080000000h
elf_gnu_hash_bucket dd 7
elf_gnu_hash_chain dd 7C988539h
; ELF String Table
unk_378 db 0 ; DATA XREF: LOAD:00000000000002B0↑o
; LOAD:00000000000002C8↑o ...
aGmonStart db '__gmon_start__',0 ; DATA XREF: LOAD:00000000000002B0↑o
aItmDeregistert db '_ITM_deregisterTMCloneTable',0
; DATA XREF: LOAD:00000000000002C8↑o
aItmRegistertmc db '_ITM_registerTMCloneTable',0
; DATA XREF: LOAD:00000000000002E0↑o
aCxaFinalize db '__cxa_finalize',0 ; DATA XREF: LOAD:00000000000002F8↑o
aInit db 'init',0 ; DATA XREF: LOAD:0000000000000340↑o
aMemcpy db 'memcpy',0 ; DATA XREF: LOAD:0000000000000310↑o
aGrPanic db 'gr_panic',0 ; DATA XREF: LOAD:0000000000000328↑o
aLibprogramSo db 'libprogram.so',0
; ELF RELA Relocation Table
Elf64_Rela <2BA0h, 8, 16F0h> ; R_X86_64_RELATIVE +16F0h
Elf64_Rela <2BA8h, 8, 1730h> ; R_X86_64_RELATIVE +1730h
Elf64_Rela <2BC8h, 8, 1995h> ; R_X86_64_RELATIVE +1995h
Elf64_Rela <2BD0h, 8, 19CFh> ; R_X86_64_RELATIVE +19CFh
Elf64_Rela <2BD8h, 8, 1979h> ; R_X86_64_RELATIVE +1979h
Elf64_Rela <2BE0h, 8, 588h> ; R_X86_64_RELATIVE +588h
Elf64_Rela <2BF0h, 8, 58Bh> ; R_X86_64_RELATIVE +58Bh
Elf64_Rela <2C08h, 8, 5BDh> ; R_X86_64_RELATIVE +5BDh
Elf64_Rela <2C18h, 8, 5CCh> ; R_X86_64_RELATIVE +5CCh
Elf64_Rela <3DE8h, 8, 3DE8h> ; R_X86_64_RELATIVE +3DE8h
Elf64_Rela <2D98h, 100000006h, 0> ; R_X86_64_GLOB_DAT __gmon_start__
Elf64_Rela <2DA0h, 200000006h, 0> ; R_X86_64_GLOB_DAT _ITM_deregisterTMCloneTable
Elf64_Rela <2DA8h, 300000006h, 0> ; R_X86_64_GLOB_DAT _ITM_registerTMCloneTable
Elf64_Rela <2DB0h, 400000006h, 0> ; R_X86_64_GLOB_DAT __cxa_finalize
Elf64_Rela <2DB8h, 500000006h, 0> ; R_X86_64_GLOB_DAT memcpy
Elf64_Rela <2DC0h, 600000006h, 0> ; R_X86_64_GLOB_DAT gr_panic
; ELF JMPREL Relocation Table
Elf64_Rela <2DE0h, 400000007h, 0> ; R_X86_64_JUMP_SLOT __cxa_finalize
LOAD ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read
_rodata segment byte public 'CONST' use64
assume cs:_rodata
;org 588h
aMsg db 'msg' ; DATA XREF: .data.rel.ro:off_2BE0↓o
aHomeAlexWorkRu db '/home/alex/work/rust-regression/program/src/lib.rs'
; DATA XREF: .data.rel.ro:off_2BF0↓o
aPanickedWith db 'panicked with ',27h ; DATA XREF: .data.rel.ro:off_2C08↓o
asc_5CC db 27h ; DATA XREF: .data.rel.ro:0000000000002C18↓o
_rodata ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read
LOAD segment mempage public 'DATA' use64
assume cs:LOAD
;org 5CDh
align 10h
LOAD ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read
_eh_frame_hdr segment dword public 'CONST' use64
assume cs:_eh_frame_hdr
;org 5D0h
unk_5D0 db 1 ; DATA XREF: LOAD:00000000000001D8↑o
db 1Bh
db 3
db 3Bh ; ;
db 1Ch
db 0
db 0
db 0
db 2
db 0
db 0
db 0
db 70h ; p
db 11h
db 0
db 0
db 38h ; 8
db 0
db 0
db 0
db 70h ; p
db 13h
db 0
db 0
db 64h ; d
db 0
db 0
db 0
_eh_frame_hdr ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read
LOAD segment mempage public 'DATA' use64
assume cs:LOAD
;org 5ECh
align 10h
LOAD ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read
_eh_frame segment qword public 'CONST' use64
assume cs:_eh_frame
;org 5F0h
__FRAME_END__ db 14h
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 1
db 7Ah ; z
db 52h ; R
db 0
db 1
db 78h ; x
db 10h
db 1
db 1Bh
db 0Ch
db 7
db 8
db 90h
db 1
db 0
db 0
db 28h ; (
db 0
db 0
db 0
db 1Ch
db 0
db 0
db 0
db 30h ; 0
db 11h
db 0
db 0
db 0F2h
db 1
db 0
db 0
db 0
db 41h ; A
db 0Eh
db 10h
db 86h
db 2
db 43h ; C
db 0Dh
db 6
db 4Dh ; M
db 83h
db 7
db 8Ch
db 6
db 8Dh
db 5
db 8Eh
db 4
db 8Fh
db 3
db 3
db 0E0h
db 1
db 0Ch
db 7
db 8
db 0
db 0
db 18h
db 0
db 0
db 0
db 48h ; H
db 0
db 0
db 0
db 4
db 13h
db 0
db 0
db 39h ; 9
db 0
db 0
db 0
db 0
db 41h ; A
db 0Eh
db 10h
db 86h
db 2
db 43h ; C
db 0Dh
db 6
db 0
db 0
db 0
db 0
db 0
db 0
db 0
_eh_frame ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
_init segment dword public 'CODE' use64
assume cs:_init
;org 1654h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
; =============== S U B R O U T I N E =======================================
public _init_proc
_init_proc proc near ; DATA XREF: LOAD:00000000000000C0↑o
endbr64 ; _init
sub rsp, 8
mov rax, cs:__gmon_start___ptr
test rax, rax
jz short loc_166A
call rax ; __gmon_start__
loc_166A: ; CODE XREF: _init_proc+12↑j
add rsp, 8
retn
_init_proc endp
_init ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
LOAD segment mempage public 'CODE' use64
assume cs:LOAD
;org 166Fh
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
align 10h
LOAD ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
_fini segment dword public 'CODE' use64
assume cs:_fini
;org 1670h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
; =============== S U B R O U T I N E =======================================
public _term_proc
_term_proc proc near
endbr64 ; _fini
sub rsp, 8
add rsp, 8
retn
_term_proc endp
_fini ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
LOAD segment mempage public 'CODE' use64
assume cs:LOAD
;org 167Dh
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
align 20h
LOAD ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
_text segment para public 'CODE' use64
assume cs:_text
;org 1680h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
; =============== S U B R O U T I N E =======================================
deregister_tm_clones proc near ; CODE XREF: __do_global_dtors_aux:loc_1717↓p
lea rdi, __dso_handle
lea rax, __dso_handle
cmp rax, rdi
jz short locret_16A8
mov rax, cs:_ITM_deregisterTMCloneTable_ptr
test rax, rax
jz short locret_16A8
jmp rax
; ---------------------------------------------------------------------------
align 8
locret_16A8: ; CODE XREF: deregister_tm_clones+11↑j
; deregister_tm_clones+1D↑j
retn
deregister_tm_clones endp
; ---------------------------------------------------------------------------
align 10h
; =============== S U B R O U T I N E =======================================
register_tm_clones proc near ; CODE XREF: frame_dummy+4↓j
lea rdi, __dso_handle
lea rsi, __dso_handle
sub rsi, rdi
mov rax, rsi
shr rsi, 3Fh
sar rax, 3
add rsi, rax
sar rsi, 1
jz short locret_16E8
mov rax, cs:_ITM_registerTMCloneTable_ptr
test rax, rax
jz short locret_16E8
jmp rax
; ---------------------------------------------------------------------------
align 8
locret_16E8: ; CODE XREF: register_tm_clones+22↑j
; register_tm_clones+2E↑j
retn
register_tm_clones endp
; ---------------------------------------------------------------------------
align 10h
; =============== S U B R O U T I N E =======================================
__do_global_dtors_aux proc near ; DATA XREF: .fini_array:__do_global_dtors_aux_fini_array_entry↓o
endbr64
cmp cs:completed_0, 0
jnz short locret_1728
push rbp
cmp cs:__cxa_finalize_ptr, 0
mov rbp, rsp
jz short loc_1717
mov rdi, cs:__dso_handle ; void *
call ___cxa_finalize
loc_1717: ; CODE XREF: __do_global_dtors_aux+19↑j
call deregister_tm_clones
mov cs:completed_0, 1
pop rbp
retn
; ---------------------------------------------------------------------------
align 8
locret_1728: ; CODE XREF: __do_global_dtors_aux+B↑j
retn
__do_global_dtors_aux endp
; ---------------------------------------------------------------------------
align 10h
; =============== S U B R O U T I N E =======================================
frame_dummy proc near ; DATA XREF: .init_array:__frame_dummy_init_array_entry↓o
endbr64
jmp register_tm_clones
frame_dummy endp
; ---------------------------------------------------------------------------
align 20h
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
; core::fmt::write
_ZN4core3fmt5write17h42450338cf9c36b5E proc near
; CODE XREF: core::fmt::Write::write_fmt+17↓j
; <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt+18↓j
var_78 = qword ptr -78h
var_70 = qword ptr -70h
var_68 = qword ptr -68h
var_60 = qword ptr -60h
var_58 = qword ptr -58h
var_50 = qword ptr -50h
var_48 = qword ptr -48h
var_40 = qword ptr -40h
var_38 = byte ptr -38h
var_30 = qword ptr -30h
; __unwind {
push rbp
mov rbp, rsp
push r15
push r14
push r13
push r12
push rbx
sub rsp, 58h
mov [rbp+var_40], 20h ; ' '
mov [rbp+var_38], 3
mov [rbp+var_70], 0
mov [rbp+var_60], 0
mov [rbp+var_50], rdi
mov [rbp+var_48], rsi
mov r12, [rdx+20h]
test r12, r12
mov [rbp+var_30], rdx
jz loc_188C
mov rax, [rdx+28h]
test rax, rax
jz loc_18ED
mov r13, [rdx]
mov r14, [rdx+10h]
add r13, 8
imul rax, 38h ; '8'
mov [rbp+var_78], rax
xor ebx, ebx
xor r15d, r15d
nop dword ptr [rax+rax+00h]
loc_17B0: ; CODE XREF: core::fmt::write+144↓j
mov rdx, [r13+0]
test rdx, rdx
jz short loc_17D0
mov rdi, [rbp+var_50]
mov rax, [rbp+var_48]
mov rsi, [r13-8]
call qword ptr [rax+18h]
test al, al
jnz loc_191D
loc_17D0: ; CODE XREF: core::fmt::write+77↑j
mov eax, [r12+rbx+28h]
mov dword ptr [rbp+var_40], eax
movzx eax, byte ptr [r12+rbx+30h]
mov [rbp+var_38], al
mov eax, [r12+rbx+2Ch]
mov dword ptr [rbp+var_40+4], eax
mov rcx, [r12+rbx+10h]
mov rax, [r12+rbx+18h]
test rcx, rcx
jz short loc_1813
cmp ecx, 1
jnz short loc_1809
shl rax, 4
cmp qword ptr [r14+rax+8], 0
jz short loc_180D
loc_1809: ; CODE XREF: core::fmt::write+BB↑j
xor ecx, ecx
jmp short loc_1818
; ---------------------------------------------------------------------------
loc_180D: ; CODE XREF: core::fmt::write+C7↑j
add rax, r14
mov rax, [rax]
loc_1813: ; CODE XREF: core::fmt::write+B6↑j
mov ecx, 1
loc_1818: ; CODE XREF: core::fmt::write+CB↑j
mov [rbp+var_70], rcx
mov [rbp+var_68], rax
mov rcx, [r12+rbx]
cmp rcx, 2
jz short loc_1840
mov rax, [r12+rbx+8]
cmp ecx, 1
jnz short loc_184A
shl rax, 4
cmp qword ptr [r14+rax+8], 0
jz short loc_1844
loc_1840: ; CODE XREF: core::fmt::write+E8↑j
xor ecx, ecx
jmp short loc_184F
; ---------------------------------------------------------------------------
loc_1844: ; CODE XREF: core::fmt::write+FE↑j
add rax, r14
mov rax, [rax]
loc_184A: ; CODE XREF: core::fmt::write+F2↑j
mov ecx, 1
loc_184F: ; CODE XREF: core::fmt::write+102↑j
mov [rbp+var_60], rcx
mov [rbp+var_58], rax
mov rax, [r12+rbx+20h]
shl rax, 4
mov rdi, [r14+rax]
lea rsi, [rbp+var_70]
call qword ptr [r14+rax+8]
test al, al
jnz loc_191D
add r13, 10h
add rbx, 38h ; '8'
inc r15
cmp [rbp+var_78], rbx
jnz loc_17B0
jmp short loc_18F0
; ---------------------------------------------------------------------------
loc_188C: ; CODE XREF: core::fmt::write+40↑j
mov rbx, [rdx+18h]
test rbx, rbx
jz short loc_18ED
mov r12, [rdx+10h]
mov r13, [rdx]
shl rbx, 4
xor r14d, r14d
xor r15d, r15d
db 2Eh
nop word ptr [rax+rax+00000000h]
loc_18B0: ; CODE XREF: core::fmt::write+1A9↓j
mov rdx, [r13+r14+8]
test rdx, rdx
jz short loc_18CE
mov rdi, [rbp+var_50]
mov rax, [rbp+var_48]
mov rsi, [r13+r14+0]
call qword ptr [rax+18h]
test al, al
jnz short loc_191D
loc_18CE: ; CODE XREF: core::fmt::write+178↑j
mov rdi, [r12+r14]
lea rsi, [rbp+var_70]
call qword ptr [r12+r14+8]
test al, al
jnz short loc_191D
add r14, 10h
inc r15
cmp rbx, r14
jnz short loc_18B0
jmp short loc_18F0
; ---------------------------------------------------------------------------
loc_18ED: ; CODE XREF: core::fmt::write+4D↑j
; core::fmt::write+153↑j
xor r15d, r15d
loc_18F0: ; CODE XREF: core::fmt::write+14A↑j
; core::fmt::write+1AB↑j
mov rax, [rbp+var_30]
cmp r15, [rax+8]
jnb short loc_1921
mov rax, [rbp+var_30]
mov rax, [rax]
shl r15, 4
mov rdi, [rbp+var_50]
mov rcx, [rbp+var_48]
mov rsi, [rax+r15]
mov rdx, [rax+r15+8]
call qword ptr [rcx+18h]
test al, al
jz short loc_1921
loc_191D: ; CODE XREF: core::fmt::write+8A↑j
; core::fmt::write+12F↑j ...
mov al, 1
jmp short loc_1923
; ---------------------------------------------------------------------------
loc_1921: ; CODE XREF: core::fmt::write+1B8↑j
; core::fmt::write+1DB↑j
xor eax, eax
loc_1923: ; CODE XREF: core::fmt::write+1DF↑j
add rsp, 58h
pop rbx
pop r12
pop r13
pop r14
pop r15
pop rbp
retn
; } // starts at 1740
_ZN4core3fmt5write17h42450338cf9c36b5E endp
; ---------------------------------------------------------------------------
align 20h
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
; core::panicking::panic_fmt
_ZN4core9panicking9panic_fmt17hf986df957479a2d9E proc near ; CODE XREF: init+2A↓p
var_40 = xmmword ptr -40h
var_30 = xmmword ptr -30h
var_20 = xmmword ptr -20h
var_10 = qword ptr -10h
var_8 = word ptr -8
; __unwind {
push rbp
mov rbp, rsp
sub rsp, 40h
movups xmm0, xmmword ptr [rdi]
movups xmm1, xmmword ptr [rdi+10h]
movups xmm2, xmmword ptr [rdi+20h]
movaps [rbp+var_20], xmm2
movaps [rbp+var_30], xmm1
movaps [rbp+var_40], xmm0
lea rax, off_2BF0 ; "/home/alex/work/rust-regression/program"...
mov [rbp+var_10], rax
mov [rbp+var_8], 1
lea rdi, [rbp+var_40]
call rust_begin_unwind
; } // starts at 1940
_ZN4core9panicking9panic_fmt17hf986df957479a2d9E endp ; sp-analysis failed
; =============== S U B R O U T I N E =======================================
; core::fmt::Write::write_fmt
_ZN4core3fmt5Write9write_fmt17he5b4ca05c5ed9456E proc near
; CODE XREF: rust_begin_unwind+63↓p
; DATA XREF: .data.rel.ro:0000000000002BD8↓o
mov rdx, rsi
mov rax, [rsi+8]
cmp rax, 1
jz short loc_1989
test rax, rax
loc_1989: ; CODE XREF: core::fmt::Write::write_fmt+B↑j
lea rsi, unk_2BB0
jmp _ZN4core3fmt5write17h42450338cf9c36b5E ; core::fmt::write
_ZN4core3fmt5Write9write_fmt17he5b4ca05c5ed9456E endp
; =============== S U B R O U T I N E =======================================
; <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str
_ZN81_$LT$arrayvec__array_string__ArrayString$LT$_$GT$$u20$as$u20$core__fmt__Write$GT$9write_str17h7f63bc799397b7c4E proc near
; DATA XREF: .data.rel.ro:0000000000002BC8↓o
push r15
push r14
push rbx
mov rbx, rdx
mov eax, [rdi]
mov r15d, 400h
sub r15, rax
cmp r15, rdx
jb short loc_19C3
mov r14, rdi
add rdi, rax
add rdi, 4 ; dest
mov rdx, rbx ; n
call cs:memcpy_ptr
add [r14], ebx
loc_19C3: ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str+16↑j
cmp r15, rbx
setb al
pop rbx
pop r14
pop r15
retn
_ZN81_$LT$arrayvec__array_string__ArrayString$LT$_$GT$$u20$as$u20$core__fmt__Write$GT$9write_str17h7f63bc799397b7c4E endp
; =============== S U B R O U T I N E =======================================
; <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char
_ZN81_$LT$arrayvec__array_string__ArrayString$LT$_$GT$$u20$as$u20$core__fmt__Write$GT$10write_char17h62e5f55538f223e2E proc near
; DATA XREF: .data.rel.ro:0000000000002BD0↓o
mov ecx, [rdi]
mov rdx, rcx
sub rdx, 400h
setnz al
cmp esi, 80h
setb r8b
test r8b, al
jz short loc_19F9
mov [rdi+rcx+4], sil
push 1
jmp loc_1AA9
; ---------------------------------------------------------------------------
loc_19F9: ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char+1C↑j
neg rdx
cmp esi, 800h
setb al
cmp rdx, 2
setnb r8b
test al, r8b
jz short loc_1A2E
mov eax, esi
shr eax, 6
or al, 0C0h
mov [rdi+rcx+4], al
and sil, 3Fh
or sil, 80h
mov [rdi+rcx+5], sil
push 2
jmp short loc_1AA9
; ---------------------------------------------------------------------------
loc_1A2E: ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char+41↑j
cmp esi, 10000h
setb al
cmp rdx, 3
setnb r8b
test al, r8b
jz short loc_1A6D
mov eax, esi
shr eax, 0Ch
or al, 0E0h
mov [rdi+rcx+4], al
mov eax, esi
shr eax, 6
and al, 3Fh
or al, 80h
mov [rdi+rcx+5], al
and sil, 3Fh
or sil, 80h
mov [rdi+rcx+6], sil
push 3
jmp short loc_1AA9
; ---------------------------------------------------------------------------
loc_1A6D: ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char+73↑j
mov al, 1
cmp rdx, 3
jbe short locret_1AB0
mov eax, esi
shr eax, 12h
or al, 0F0h
mov [rdi+rcx+4], al
mov eax, esi
shr eax, 0Ch
and al, 3Fh
or al, 80h
mov [rdi+rcx+5], al
mov eax, esi
shr eax, 6
and al, 3Fh
or al, 80h
mov [rdi+rcx+6], al
and sil, 3Fh
or sil, 80h
mov [rdi+rcx+7], sil
push 4
loc_1AA9: ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char+25↑j
; <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char+5D↑j ...
pop rax
add ecx, eax
mov [rdi], ecx
xor eax, eax
locret_1AB0: ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char+A4↑j
retn
_ZN81_$LT$arrayvec__array_string__ArrayString$LT$_$GT$$u20$as$u20$core__fmt__Write$GT$10write_char17h62e5f55538f223e2E endp
; =============== S U B R O U T I N E =======================================
public init
init proc near ; DATA XREF: LOAD:0000000000000340↑o
var_30 = byte ptr -30h
sub rsp, 38h
lea rax, off_2BE0 ; "msg"
lea rdi, [rsp+38h+var_30]
mov [rdi], rax
mov qword ptr [rdi+8], 1
mov qword ptr [rdi+10h], 8
xorps xmm0, xmm0
movups xmmword ptr [rdi+18h], xmm0
call _ZN4core9panicking9panic_fmt17hf986df957479a2d9E ; core::panicking::panic_fmt
init endp ; sp-analysis failed
; =============== S U B R O U T I N E =======================================
rust_begin_unwind proc near ; CODE XREF: core::panicking::panic_fmt+34↑p
var_468 = byte ptr -468h
var_438 = byte ptr -438h
var_404 = byte ptr -404h
var_400 = byte ptr -400h
sub rsp, 478h
movups xmm0, xmmword ptr [rdi]
movups xmm1, xmmword ptr [rdi+10h]
movups xmm2, xmmword ptr [rdi+20h]
lea rax, [rsp+478h+var_468]
movaps xmmword ptr [rax+20h], xmm2
movaps xmmword ptr [rax+10h], xmm1
movaps xmmword ptr [rax], xmm0
lea rdi, [rsp+478h+var_404]
and dword ptr [rdi], 0
mov rcx, rsp
mov [rcx], rax
lea rax, off_2C08 ; "panicked with '"
lea rsi, [rsp+478h+var_438]
mov [rsi], rax
mov qword ptr [rsi+8], 2
and qword ptr [rsi+20h], 0
lea rax, _ZN76_$LT$core__panic__panic_info__PanicMessage$u20$as$u20$core__fmt__Display$GT$3fmt17h99a5d0e6dcda5aebE ; <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt
mov [rcx+8], rax
mov [rsi+10h], rcx
mov qword ptr [rsi+18h], 1
call _ZN4core3fmt5Write9write_fmt17he5b4ca05c5ed9456E ; core::fmt::Write::write_fmt
lea rdi, [rsp+478h+var_400]
mov esi, [rdi-4]
call cs:gr_panic_ptr
rust_begin_unwind endp ; sp-analysis failed
; =============== S U B R O U T I N E =======================================
; <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt
_ZN76_$LT$core__panic__panic_info__PanicMessage$u20$as$u20$core__fmt__Display$GT$3fmt17h99a5d0e6dcda5aebE proc near
; DATA XREF: rust_begin_unwind+4C↑o
mov rdx, rdi
mov rax, [rdi+8]
cmp rax, 1
jz short loc_1B66
test rax, rax
loc_1B66: ; CODE XREF: <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt+B↑j
mov rdi, [rsi+20h]
mov rsi, [rsi+28h]
jmp _ZN4core3fmt5write17h42450338cf9c36b5E ; core::fmt::write
_ZN76_$LT$core__panic__panic_info__PanicMessage$u20$as$u20$core__fmt__Display$GT$3fmt17h99a5d0e6dcda5aebE endp
_text ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
LOAD segment mempage public 'CODE' use64
assume cs:LOAD
;org 1B73h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
align 20h
LOAD ends
; ===========================================================================
; Segment type: Pure code
; Segment permissions: Read/Execute
_plt segment para public 'CODE' use64
assume cs:_plt
;org 1B80h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
; =============== S U B R O U T I N E =======================================
sub_1B80 proc near ; CODE XREF: .plt:0000000000001B9B↓j
push cs:qword_2DD0
jmp cs:qword_2DD8
sub_1B80 endp
; ---------------------------------------------------------------------------
align 10h
; [00000006 BYTES: COLLAPSED FUNCTION ___cxa_finalize]
; ---------------------------------------------------------------------------
push 0
jmp sub_1B80
_plt ends
; ELF Termination Function Table
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
_fini_array segment qword public 'DATA' use64
assume cs:_fini_array
;org 2BA0h
__do_global_dtors_aux_fini_array_entry dq offset __do_global_dtors_aux
; DATA XREF: LOAD:00000000000000F8↑o
; LOAD:00000000000001A0↑o
_fini_array ends
; ELF Initialization Function Table
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
_init_array segment qword public 'DATA' use64
assume cs:_init_array
;org 2BA8h
__frame_dummy_init_array_entry dq offset frame_dummy
_init_array ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
_data_rel_ro segment qword public 'DATA' use64
assume cs:_data_rel_ro
;org 2BB0h
unk_2BB0 db 0 ; DATA XREF: core::fmt::Write::write_fmt:loc_1989↑o
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 4
db 4
db 0
db 0
db 0
db 0
db 0
db 0
db 4
db 0
db 0
db 0
db 0
db 0
db 0
db 0
dq offset _ZN81_$LT$arrayvec__array_string__ArrayString$LT$_$GT$$u20$as$u20$core__fmt__Write$GT$9write_str17h7f63bc799397b7c4E ; <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str
dq offset _ZN81_$LT$arrayvec__array_string__ArrayString$LT$_$GT$$u20$as$u20$core__fmt__Write$GT$10write_char17h62e5f55538f223e2E ; <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char
dq offset _ZN4core3fmt5Write9write_fmt17he5b4ca05c5ed9456E ; core::fmt::Write::write_fmt
off_2BE0 dq offset aMsg ; DATA XREF: init+4↑o
; "msg"
db 3
db 0
db 0
db 0
db 0
db 0
db 0
db 0
off_2BF0 dq offset aHomeAlexWorkRu
; DATA XREF: core::panicking::panic_fmt+1F↑o
; "/home/alex/work/rust-regression/program"...
db 32h ; 2
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0Bh
db 0
db 0
db 0
db 5
db 0
db 0
db 0
off_2C08 dq offset aPanickedWith ; DATA XREF: rust_begin_unwind+30↑o
; "panicked with '"
db 0Fh
db 0
db 0
db 0
db 0
db 0
db 0
db 0
dq offset asc_5CC ; "'"
db 1
db 0
db 0
db 0
db 0
db 0
db 0
db 0
_data_rel_ro ends
; ELF Dynamic Information
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
LOAD segment mempage public 'DATA' use64
assume cs:LOAD
;org 2C28h
stru_2C28 Elf64_Dyn <0Eh, 6Ah> ; DATA XREF: LOAD:0000000000000168↑o
; .got.plt:_GLOBAL_OFFSET_TABLE_↓o
; DT_SONAME libprogram.so
Elf64_Dyn <1Eh, 8> ; DT_FLAGS
Elf64_Dyn <6FFFFFFBh, 1> ; DT_FLAGS_1
Elf64_Dyn <7, 3F0h> ; DT_RELA
Elf64_Dyn <8, 180h> ; DT_RELASZ
Elf64_Dyn <9, 18h> ; DT_RELAENT
Elf64_Dyn <6FFFFFF9h, 0Ah> ; DT_RELACOUNT
Elf64_Dyn <17h, 570h> ; DT_JMPREL
Elf64_Dyn <2, 18h> ; DT_PLTRELSZ
Elf64_Dyn <3, 2DC8h> ; DT_PLTGOT
Elf64_Dyn <14h, 7> ; DT_PLTREL
Elf64_Dyn <6, 298h> ; DT_SYMTAB
Elf64_Dyn <0Bh, 18h> ; DT_SYMENT
Elf64_Dyn <5, 378h> ; DT_STRTAB
Elf64_Dyn <0Ah, 78h> ; DT_STRSZ
Elf64_Dyn <6FFFFEF5h, 358h> ; DT_GNU_HASH
Elf64_Dyn <19h, 2BA8h> ; DT_INIT_ARRAY
Elf64_Dyn <1Bh, 8> ; DT_INIT_ARRAYSZ
Elf64_Dyn <1Ah, 2BA0h> ; DT_FINI_ARRAY
Elf64_Dyn <1Ch, 8> ; DT_FINI_ARRAYSZ
Elf64_Dyn <0Ch, 1654h> ; DT_INIT
Elf64_Dyn <0Dh, 1670h> ; DT_FINI
Elf64_Dyn <0> ; DT_NULL
LOAD ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
_got segment qword public 'DATA' use64
assume cs:_got
;org 2D98h
__gmon_start___ptr dq offset __gmon_start__ ; DATA XREF: _init_proc+8↑r
_ITM_deregisterTMCloneTable_ptr dq offset _ITM_deregisterTMCloneTable
; DATA XREF: deregister_tm_clones+13↑r
_ITM_registerTMCloneTable_ptr dq offset _ITM_registerTMCloneTable
; DATA XREF: register_tm_clones+24↑r
__cxa_finalize_ptr dq offset __cxa_finalize ; DATA XREF: __do_global_dtors_aux+E↑r
memcpy_ptr dq offset memcpy ; DATA XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str+25↑r
gr_panic_ptr dq offset gr_panic ; DATA XREF: rust_begin_unwind+70↑r
_got ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
_got_plt segment qword public 'DATA' use64
assume cs:_got_plt
;org 2DC8h
_GLOBAL_OFFSET_TABLE_ dq offset stru_2C28
qword_2DD0 dq 0 ; DATA XREF: sub_1B80↑r
qword_2DD8 dq 0 ; DATA XREF: sub_1B80+6↑r
off_2DE0 dq offset __cxa_finalize ; DATA XREF: ___cxa_finalize↑r
_got_plt ends
; ===========================================================================
; Segment type: Uninitialized
; Segment permissions: Read/Write
_relro_padding segment byte public 'BSS' use64
assume cs:_relro_padding
;org 2DE8h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
align 400h
_relro_padding ends
; ===========================================================================
; Segment type: Pure data
; Segment permissions: Read/Write
_data segment qword public 'DATA' use64
assume cs:_data
;org 3DE8h
; void *_dso_handle
__dso_handle dq offset __dso_handle ; DATA XREF: LOAD:0000000000000130↑o
; deregister_tm_clones↑o ...
_data ends
; ===========================================================================
; Segment type: Uninitialized
; Segment permissions: Read/Write
_bss segment byte public 'BSS' use64
assume cs:_bss
;org 3DF0h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
completed_0 db ? ; DATA XREF: __do_global_dtors_aux+4↑r
; __do_global_dtors_aux+2C↑w
_bss ends
; ===========================================================================
; Segment type: Externs
; extern
extrn __gmon_start__:near ; weak ; CODE XREF: _init_proc+14↑p
; DATA XREF: .got:__gmon_start___ptr↑o
extrn _ITM_deregisterTMCloneTable ; weak
; DATA XREF: .got:_ITM_deregisterTMCloneTable_ptr↑o
extrn _ITM_registerTMCloneTable ; weak
; DATA XREF: .got:_ITM_registerTMCloneTable_ptr↑o
; int _cxa_finalize(void *)
extrn __cxa_finalize:near ; weak ; CODE XREF: ___cxa_finalize↑j
; DATA XREF: .got:__cxa_finalize_ptr↑o ...
; void *memcpy(void *dest, const void *src, size_t n)
extrn memcpy:near ; CODE XREF: <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str+25↑p
; DATA XREF: .got:memcpy_ptr↑o
extrn gr_panic:near ; CODE XREF: rust_begin_unwind+70↑p
; DATA XREF: .got:gr_panic_ptr↑o
end
/* This file was generated by the Hex-Rays decompiler version 9.0.0.240807.
Copyright (c) 2007-2021 Hex-Rays <[email protected]>
Detected compiler: GNU C++
*/
#include <defs.h>
//-------------------------------------------------------------------------
// Function declarations
__int64 (**init_proc())(void);
void term_proc();
void **deregister_tm_clones();
__int64 register_tm_clones(void); // weak
void **_do_global_dtors_aux();
__int64 frame_dummy(); // weak
bool __fastcall core::fmt::write(__int64 a1, __int64 a2, _QWORD *a3);
bool __fastcall core::panicking::panic_fmt(__int128 *a1, _QWORD *a2);
bool __fastcall core::fmt::Write::write_fmt(__int64 a1, _QWORD *a2);
bool __fastcall <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str(_DWORD *a1, const void *a2, size_t a3);
char __fastcall <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char(_DWORD *a1, unsigned int a2);
__int64 init(); // weak
__int64 __fastcall rust_begin_unwind(__int128 *a1);
__int64 __fastcall <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt(__int64 a1, __int64 a2);
void sub_1B80();
// int __cxa_finalize(void *);
// __int64 _gmon_start__(void); weak
// int _cxa_finalize(void *);
// void *memcpy(void *dest, const void *src, size_t n);
// __int64 __fastcall gr_panic(_QWORD, _QWORD); weak
//-------------------------------------------------------------------------
// Data declarations
_UNKNOWN unk_2BB0; // weak
char *off_2BE0 = "msg"; // weak
char *off_2BF0 = "/home/alex/work/rust-regression/program/src/lib.rs"; // weak
char *off_2C08 = "panicked with '"; // weak
void *_dso_handle = &_dso_handle; // idb
char completed_0; // weak
//----- (0000000000001654) ----------------------------------------------------
__int64 (**init_proc())(void)
{
__int64 (**result)(void); // rax
result = &_gmon_start__;
if ( &_gmon_start__ )
return (__int64 (**)(void))_gmon_start__();
return result;
}
// 3DF8: using guessed type __int64 _gmon_start__(void);
//----- (0000000000001670) ----------------------------------------------------
void term_proc()
{
;
}
//----- (0000000000001680) ----------------------------------------------------
void **deregister_tm_clones()
{
return &_dso_handle;
}
//----- (00000000000016B0) ----------------------------------------------------
__int64 register_tm_clones()
{
return 0LL;
}
// 16B0: using guessed type __int64 register_tm_clones();
//----- (00000000000016F0) ----------------------------------------------------
void **_do_global_dtors_aux()
{
void **result; // rax
if ( !completed_0 )
{
if ( &_cxa_finalize )
__cxa_finalize(_dso_handle);
result = deregister_tm_clones();
completed_0 = 1;
}
return result;
}
// 3DF0: using guessed type char completed_0;
//----- (0000000000001730) ----------------------------------------------------
__int64 frame_dummy()
{
return register_tm_clones();
}
// 16B0: using guessed type __int64 register_tm_clones(void);
// 1730: using guessed type __int64 frame_dummy();
//----- (0000000000001740) ----------------------------------------------------
bool __fastcall core::fmt::write(__int64 a1, __int64 a2, _QWORD *a3)
{
__int64 v3; // r12
__int64 v4; // rax
__int64 v5; // r14
_QWORD *v6; // r13
__int64 v7; // rbx
unsigned __int64 v8; // r15
__int64 v9; // rcx
__int64 v10; // rax
__int64 v11; // rcx
__int64 v12; // rcx
__int64 v13; // rcx
__int64 v14; // rbx
__int64 v15; // r12
__int64 v16; // r13
__int64 v17; // rbx
__int64 v18; // r14
__int64 v20; // [rsp+8h] [rbp-78h]
_QWORD v21[2]; // [rsp+10h] [rbp-70h] BYREF
__int64 v22; // [rsp+20h] [rbp-60h]
__int64 v23; // [rsp+28h] [rbp-58h]
__int64 v24; // [rsp+30h] [rbp-50h]
__int64 v25; // [rsp+38h] [rbp-48h]
__int64 v26; // [rsp+40h] [rbp-40h]
char v27; // [rsp+48h] [rbp-38h]
_QWORD *v28; // [rsp+50h] [rbp-30h]
v26 = 32LL;
v27 = 3;
v21[0] = 0LL;
v22 = 0LL;
v24 = a1;
v25 = a2;
v3 = a3[4];
v28 = a3;
if ( v3 )
{
v4 = a3[5];
if ( v4 )
{
v5 = a3[2];
v6 = (_QWORD *)(*a3 + 8LL);
v20 = 56 * v4;
v7 = 0LL;
v8 = 0LL;
while ( 1 )
{
if ( *v6 && (*(unsigned __int8 (__fastcall **)(__int64, _QWORD))(v25 + 24))(v24, *(v6 - 1)) )
return 1;
LODWORD(v26) = *(_DWORD *)(v3 + v7 + 40);
v27 = *(_BYTE *)(v3 + v7 + 48);
HIDWORD(v26) = *(_DWORD *)(v3 + v7 + 44);
v9 = *(_QWORD *)(v3 + v7 + 16);
v10 = *(_QWORD *)(v3 + v7 + 24);
if ( !v9 )
goto LABEL_11;
if ( (_DWORD)v9 == 1 )
{
v10 *= 16LL;
if ( !*(_QWORD *)(v5 + v10 + 8) )
break;
}
v11 = 0LL;
LABEL_12:
v21[0] = v11;
v21[1] = v10;
v12 = *(_QWORD *)(v3 + v7);
if ( v12 != 2 )
{
v10 = *(_QWORD *)(v3 + v7 + 8);
if ( (_DWORD)v12 != 1 )
goto LABEL_17;
v10 *= 16LL;
if ( !*(_QWORD *)(v5 + v10 + 8) )
{
v10 = *(_QWORD *)(v5 + v10);
LABEL_17:
v13 = 1LL;
goto LABEL_18;
}
}
v13 = 0LL;
LABEL_18:
v22 = v13;
v23 = v10;
if ( (*(unsigned __int8 (__fastcall **)(_QWORD, _QWORD *))(v5 + 16LL * *(_QWORD *)(v3 + v7 + 32) + 8))(
*(_QWORD *)(v5 + 16LL * *(_QWORD *)(v3 + v7 + 32)),
v21) )
{
return 1;
}
v6 += 2;
v7 += 56LL;
++v8;
if ( v20 == v7 )
return v8 < v28[1]
&& (*(unsigned __int8 (__fastcall **)(__int64, _QWORD, _QWORD))(v25 + 24))(
v24,
*(_QWORD *)(*v28 + 16 * v8),
*(_QWORD *)(*v28 + 16 * v8 + 8));
}
v10 = *(_QWORD *)(v5 + v10);
LABEL_11:
v11 = 1LL;
goto LABEL_12;
}
}
else
{
v14 = a3[3];
if ( v14 )
{
v15 = a3[2];
v16 = *a3;
v17 = 16 * v14;
v18 = 0LL;
v8 = 0LL;
while ( (!*(_QWORD *)(v16 + v18 + 8)
|| !(*(unsigned __int8 (__fastcall **)(__int64, _QWORD))(v25 + 24))(v24, *(_QWORD *)(v16 + v18)))
&& !(*(unsigned __int8 (__fastcall **)(_QWORD, _QWORD *))(v15 + v18 + 8))(*(_QWORD *)(v15 + v18), v21) )
{
v18 += 16LL;
++v8;
if ( v17 == v18 )
return v8 < v28[1]
&& (*(unsigned __int8 (__fastcall **)(__int64, _QWORD, _QWORD))(v25 + 24))(
v24,
*(_QWORD *)(*v28 + 16 * v8),
*(_QWORD *)(*v28 + 16 * v8 + 8));
}
return 1;
}
}
v8 = 0LL;
return v8 < v28[1]
&& (*(unsigned __int8 (__fastcall **)(__int64, _QWORD, _QWORD))(v25 + 24))(
v24,
*(_QWORD *)(*v28 + 16 * v8),
*(_QWORD *)(*v28 + 16 * v8 + 8));
}
//----- (0000000000001940) ----------------------------------------------------
// bad sp value at call has been detected, the output may be wrong!
bool __fastcall core::panicking::panic_fmt(__int128 *a1, _QWORD *a2)
{
__int128 v2; // xmm0
__int128 v3; // xmm1
__int128 v5[3]; // [rsp+0h] [rbp-40h] BYREF
char **v6; // [rsp+30h] [rbp-10h]
__int16 v7; // [rsp+38h] [rbp-8h]
v2 = *a1;
v3 = a1[1];
v5[2] = a1[2];
v5[1] = v3;
v5[0] = v2;
v6 = &off_2BF0;
v7 = 1;
rust_begin_unwind(v5);
return core::fmt::Write::write_fmt((__int64)v5, a2);
}
// 1975: bad sp value at call
// 2BF0: using guessed type char *off_2BF0;
//----- (0000000000001979) ----------------------------------------------------
bool __fastcall core::fmt::Write::write_fmt(__int64 a1, _QWORD *a2)
{
return core::fmt::write(a1, (__int64)&unk_2BB0, a2);
}
//----- (0000000000001995) ----------------------------------------------------
bool __fastcall <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_str(
_DWORD *a1,
const void *a2,
size_t a3)
{
__int64 v4; // rax
size_t v5; // r15
v4 = (unsigned int)*a1;
v5 = 1024 - v4;
if ( 1024 - v4 >= a3 )
{
memcpy((char *)a1 + v4 + 4, a2, a3);
*a1 += a3;
}
return v5 < a3;
}
//----- (00000000000019CF) ----------------------------------------------------
char __fastcall <arrayvec::array_string::ArrayString<_> as core::fmt::Write>::write_char(_DWORD *a1, unsigned int a2)
{
__int64 v2; // rcx
unsigned __int64 v3; // rdx
char result; // al
int v5; // [rsp-8h] [rbp-8h]
v2 = (unsigned int)*a1;
if ( v2 != 1024 && a2 < 0x80 )
{
*((_BYTE *)a1 + v2 + 4) = a2;
v5 = 1;
}
else
{
v3 = 1024LL - (unsigned int)*a1;
if ( v3 >= 2 && a2 < 0x800 )
{
*((_BYTE *)a1 + v2 + 4) = (a2 >> 6) | 0xC0;
*((_BYTE *)a1 + v2 + 5) = a2 & 0x3F | 0x80;
v5 = 2;
}
else if ( v3 >= 3 && a2 < 0x10000 )
{
*((_BYTE *)a1 + v2 + 4) = (a2 >> 12) | 0xE0;
*((_BYTE *)a1 + v2 + 5) = (a2 >> 6) & 0x3F | 0x80;
*((_BYTE *)a1 + v2 + 6) = a2 & 0x3F | 0x80;
v5 = 3;
}
else
{
result = 1;
if ( v3 <= 3 )
return result;
*((_BYTE *)a1 + v2 + 4) = (a2 >> 18) | 0xF0;
*((_BYTE *)a1 + v2 + 5) = (a2 >> 12) & 0x3F | 0x80;
*((_BYTE *)a1 + v2 + 6) = (a2 >> 6) & 0x3F | 0x80;
*((_BYTE *)a1 + v2 + 7) = a2 & 0x3F | 0x80;
v5 = 4;
}
}
*a1 = v5 + v2;
return 0;
}
//----- (0000000000001AB1) ----------------------------------------------------
__int64 init()
{
__int128 v1; // [rsp+8h] [rbp-30h] BYREF
__int64 v2; // [rsp+18h] [rbp-20h]
__int128 v3; // [rsp+20h] [rbp-18h]
*(_QWORD *)&v1 = &off_2BE0;
*((_QWORD *)&v1 + 1) = 1LL;
v2 = 8LL;
v3 = 0LL;
core::panicking::panic_fmt();
return rust_begin_unwind(&v1);
}
// 1940: using guessed type __int64 core::panicking::panic_fmt(void);
// 1AB1: using guessed type __int64 init();
// 2BE0: using guessed type char *off_2BE0;
//----- (0000000000001AE0) ----------------------------------------------------
__int64 __fastcall rust_begin_unwind(__int128 *a1)
{
__int128 v1; // xmm0
__int128 v2; // xmm1
__int64 v3; // rsi
_QWORD v5[2]; // [rsp+0h] [rbp-478h] BYREF
_OWORD v6[3]; // [rsp+10h] [rbp-468h] BYREF
char **v7; // [rsp+40h] [rbp-438h]
__int64 v8; // [rsp+48h] [rbp-430h]
_QWORD *v9; // [rsp+50h] [rbp-428h]
__int64 v10; // [rsp+58h] [rbp-420h]
__int64 v11; // [rsp+60h] [rbp-418h]
unsigned int v12; // [rsp+74h] [rbp-404h] BYREF
_BYTE v13[1024]; // [rsp+78h] [rbp-400h] BYREF
v1 = *a1;
v2 = a1[1];
v6[2] = a1[2];
v6[1] = v2;
v6[0] = v1;
v12 = 0;
v5[0] = v6;
v7 = &off_2C08;
v8 = 2LL;
v11 = 0LL;
v5[1] = <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt;
v9 = v5;
v10 = 1LL;
((void (__fastcall *)(unsigned int *))core::fmt::Write::write_fmt)(&v12);
v3 = v12;
gr_panic(v13, v12);
return <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt((__int64)v13, v3);
}
// 1979: using guessed type __int64 __fastcall core::fmt::Write::write_fmt(_QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD);
// 2C08: using guessed type char *off_2C08;
// 3E20: using guessed type __int64 __fastcall gr_panic(_QWORD, _QWORD);
//----- (0000000000001B56) ----------------------------------------------------
__int64 __fastcall <core::panic::panic_info::PanicMessage as core::fmt::Display>::fmt(__int64 a1, __int64 a2)
{
return core::fmt::write(*(_QWORD *)(a2 + 32), *(_QWORD *)(a2 + 40), a1);
}
// 1740: using guessed type __int64 __fastcall core::fmt::write(_QWORD, _QWORD, _QWORD);
//----- (0000000000001B80) ----------------------------------------------------
void sub_1B80()
{
JUMPOUT(0LL);
}
// 1B86: control flows out of bounds to 0
// nfuncs=20 queued=15 decompiled=15 lumina nreq=0 worse=0 better=0
// ALL OK, 15 function(s) have been successfully decompiled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment