; assembly | /* r2dec pseudo code output */ | /* balst_stacktraceprintutil.t/none @ 0x40b430 */ | #include | ; (fcn) method.BloombergLP::balst::StackTraceResolverImpl_BloombergLP::balst::ObjectFileFormat::Elf_.processLoadedImage_char_const__void_const__int__void__void_ () | int64_t method_BloombergLP::balst::StackTraceResolverImpl_BloombergLP::balst::ObjectFileFormat::Elf_processLoadedImage_char_const_void_const_int_void_void_ (int64_t arg6, uint32_t arg5, signed int64_t arg4, int64_t arg3, uint32_t arg2, int64_t arg1) { | uint32_t var_4h; | int64_t var_8h; | int64_t var_ch; | int64_t var_10h; | int64_t var_14h; | uint32_t var_18h; | signed int64_t var_1ch; | uint32_t var_20h; | uint32_t var_28h; | uint32_t var_30h; | uint32_t var_38h; | signed int64_t var_44h; | int64_t var_48h; | int64_t var_50h; | int64_t var_60h; | int64_t var_68h; | int64_t var_70h; | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::balst::StackTraceResolverImpl::processLoadedImage(char const*, void const*, int, void*, void*) */ 0x0040b430 push r14 | 0x0040b432 push rbx | 0x0040b433 sub rsp, 0x78 | 0x0040b437 mov qword [rsp + 0x70], rdi | *((rsp + 0x70)) = rdi; 0x0040b43c mov qword [rsp + 0x38], rsi | *((rsp + 0x38)) = rsi; 0x0040b441 mov qword [rsp + 0x68], rdx | *((rsp + 0x68)) = rdx; 0x0040b446 mov dword [rsp + 0x44], ecx | *((rsp + 0x44)) = ecx; 0x0040b44a mov qword [rsp + 0x30], r8 | *((rsp + 0x30)) = r8; 0x0040b44f mov qword [rsp + 0x60], r9 | *((rsp + 0x60)) = r9; 0x0040b454 mov r14, qword [rsp + 0x70] | r14 = *((rsp + 0x70)); 0x0040b459 mov rdi, qword [r14 + 0x60] | 0x0040b45d call 0x40ac30 | BloombergLP::balst::StackTraceResolverImpl::HiddenRec::reset() (*((r14 + 0x60))); 0x0040b462 mov qword [rsp + 0x20], 0 | *((rsp + 0x20)) = 0; 0x0040b46b cmp qword [rsp + 0x38], 0 | | if (*((rsp + 0x38)) != 0) { 0x0040b471 je 0x40b497 | 0x0040b473 mov rax, qword [rsp + 0x38] | rax = *((rsp + 0x38)); 0x0040b478 cmp byte [rax], 0 | | if (*(rax) != 0) { 0x0040b47b je 0x40b497 | 0x0040b47d mov rax, qword [r14 + 0x60] | rax = *((r14 + 0x60)); 0x0040b481 mov byte [rax + 0x94], 0 | *((rax + 0x94)) = 0; 0x0040b488 mov rax, qword [rsp + 0x38] | rax = *((rsp + 0x38)); 0x0040b48d mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x0040b492 jmp 0x40b526 | | } | } else { 0x0040b497 mov rax, qword [r14 + 0x60] | rax = *((r14 + 0x60)); 0x0040b49b mov byte [rax + 0x94], 1 | *((rax + 0x94)) = 1; 0x0040b4a2 mov rsi, qword [r14 + 0x40] | rsi = *((r14 + 0x40)); 0x0040b4a6 movabs rdi, 0x43ff3f | rdi = "/proc/self/exe"; 0x0040b4b0 mov edx, 0x7fc0 | edx = 0x7fc0; 0x0040b4b5 call 0x404d90 | eax = readlink (); 0x0040b4ba mov dword [rsp + 0x1c], eax | *((rsp + 0x1c)) = eax; 0x0040b4be cmp dword [rsp + 0x1c], 0 | | if (*((rsp + 0x1c)) > 0) { 0x0040b4c3 jle 0x40b4ff | 0x0040b4c5 jmp 0x40b4c7 | 0x0040b4c7 cmp dword [rsp + 0x1c], 0x7fc0 | | if (*((rsp + 0x1c)) >= 0x7fc0) { 0x0040b4cf jl 0x40b4e3 | 0x0040b4d1 mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b4d9 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b4e1 jmp 0x40b519 | goto label_0; | } 0x0040b4e3 jmp 0x40b4e5 | 0x0040b4e5 jmp 0x40b4e7 | 0x0040b4e7 mov rax, qword [r14 + 0x40] | rax = *((r14 + 0x40)); 0x0040b4eb movsxd rcx, dword [rsp + 0x1c] | rcx = *((rsp + 0x1c)); 0x0040b4f0 mov byte [rax + rcx], 0 | *((rax + rcx)) = 0; 0x0040b4f4 mov rax, qword [r14 + 0x40] | rax = *((r14 + 0x40)); 0x0040b4f8 mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x0040b4fd jmp 0x40b511 | | } else { 0x0040b4ff mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b507 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b50f jmp 0x40b519 | goto label_0; | } 0x0040b511 mov dword [rsp + 4], 0 | *((rsp + 4)) = 0; | label_0: 0x0040b519 cmp dword [rsp + 4], 0 | | if (*((rsp + 4)) != 0) { 0x0040b51e jne 0x40b6ea | goto label_1; | } 0x0040b524 jmp 0x40b526 | | } 0x0040b526 mov rdi, qword [rsp + 0x20] | 0x0040b52b mov rsi, r14 | 0x0040b52e call 0x40d290 | rax = BloombergLP::bdlb::String::copy(char const*,BloombergLP::bslma::Allocator*) (*((rsp + 0x20)), r14); 0x0040b533 mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x0040b538 lea rbx, [rsp + 0x10] | rbx = rsp + 0x10; 0x0040b53d mov rdi, rbx | 0x0040b540 call 0x40d400 | BloombergLP::balst::StackTraceResolver_FileHelper::StackTraceResolver_FileHelper() (rbx); 0x0040b545 mov rsi, qword [rsp + 0x20] | 0x0040b54a mov rdi, rbx | 0x0040b54d call 0x40d440 | eax = BloombergLP::balst::StackTraceResolver_FileHelper::initialize(char const*) (rbx, *((rsp + 0x20))); 0x0040b552 jmp 0x40b554 | 0x0040b554 mov dword [rsp + 0x18], eax | *((rsp + 0x18)) = eax; 0x0040b558 cmp dword [rsp + 0x18], 0 | | if (*((rsp + 0x18)) != 0) { 0x0040b55d je 0x40b582 | 0x0040b55f mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b567 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b56f jmp 0x40b6d2 | goto label_2; | } 0x0040b582 mov rax, qword [r14 + 0x60] | rax = *((r14 + 0x60)); 0x0040b586 lea rcx, [rsp + 0x10] | rcx = rsp + 0x10; 0x0040b58b mov qword [rax], rcx | *(rax) = rcx; 0x0040b58e mov dword [rsp + 0x14], 0 | *((rsp + 0x14)) = 0; 0x0040b596 mov dword [rsp + 0xc], 0 | *((rsp + 0xc)) = 0; | do { 0x0040b59e mov eax, dword [rsp + 0xc] | eax = *((rsp + 0xc)); 0x0040b5a2 cmp eax, dword [rsp + 0x44] | | if (eax >= *((rsp + 0x44))) { 0x0040b5a6 jl 0x40b5b5 | 0x0040b5a8 mov dword [rsp + 4], 4 | *((rsp + 4)) = 4; 0x0040b5b0 jmp 0x40b6af | goto label_3; | } 0x0040b5b5 mov rax, qword [rsp + 0x68] | rax = *((rsp + 0x68)); 0x0040b5ba movsxd rcx, dword [rsp + 0xc] | rcx = *((rsp + 0xc)); 0x0040b5bf imul rcx, rcx, 0x38 | rcx *= 0x38; 0x0040b5c3 add rax, rcx | rax += rcx; 0x0040b5c6 mov qword [rsp + 0x28], rax | *((rsp + 0x28)) = rax; 0x0040b5cb mov rax, qword [rsp + 0x28] | rax = *((rsp + 0x28)); 0x0040b5d0 mov ecx, 1 | ecx = 1; 0x0040b5d5 cmp ecx, dword [rax] | | if (ecx == *(rax)) { 0x0040b5d7 jne 0x40b68c | 0x0040b5dd mov rax, qword [rsp + 0x30] | rax = *((rsp + 0x30)); 0x0040b5e2 mov qword [rsp + 0x50], rax | *((rsp + 0x50)) = rax; 0x0040b5e7 mov rax, qword [rsp + 0x60] | rax = *((rsp + 0x60)); 0x0040b5ec mov qword [rsp + 0x48], rax | *((rsp + 0x48)) = rax; 0x0040b5f1 cmp qword [rsp + 0x30], 0 | | if (*((rsp + 0x30)) != 0) { 0x0040b5f7 je 0x40b613 | 0x0040b5f9 mov rax, qword [rsp + 0x30] | rax = *((rsp + 0x30)); 0x0040b5fe mov rcx, qword [rsp + 0x28] | rcx = *((rsp + 0x28)); 0x0040b603 xor edx, edx | edx = 0; 0x0040b605 sub rdx, qword [rcx + 0x10] | rdx -= *((rcx + 0x10)); 0x0040b609 add rax, rdx | rax += rdx; 0x0040b60c mov qword [rsp + 0x48], rax | *((rsp + 0x48)) = rax; 0x0040b611 jmp 0x40b626 | | } else { 0x0040b613 mov rax, qword [rsp + 0x60] | rax = *((rsp + 0x60)); 0x0040b618 mov rcx, qword [rsp + 0x28] | rcx = *((rsp + 0x28)); 0x0040b61d add rax, qword [rcx + 0x10] | rax += *((rcx + 0x10)); 0x0040b621 mov qword [rsp + 0x50], rax | *((rsp + 0x50)) = rax; | } 0x0040b626 mov rsi, qword [rsp + 0x48] | 0x0040b62b mov rdx, qword [rsp + 0x50] | 0x0040b630 mov rax, qword [rsp + 0x28] | rax = *((rsp + 0x28)); 0x0040b635 mov rcx, qword [rax + 0x28] | 0x0040b639 mov r8, qword [rsp + 0x20] | 0x0040b63e mov rdi, r14 | 0x0040b641 call 0x40b700 | eax = BloombergLP::balst::StackTraceResolverImpl::resolveSegment(void*,void*,unsigned long,char const*) (r14, *((rsp + 0x48)), *((rsp + 0x50)), *((rax + 0x28)), *((rsp + 0x20))); 0x0040b646 jmp 0x40b648 | 0x0040b648 mov dword [rsp + 0x18], eax | *((rsp + 0x18)) = eax; 0x0040b64c cmp dword [rsp + 0x18], 0 | | if (*((rsp + 0x18)) != 0) { 0x0040b651 je 0x40b670 | 0x0040b653 mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b65b mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b663 jmp 0x40b683 | | } else { 0x0040b670 mov eax, dword [rsp + 0x14] | eax = *((rsp + 0x14)); 0x0040b674 add eax, 1 | eax++; 0x0040b677 mov dword [rsp + 0x14], eax | *((rsp + 0x14)) = eax; 0x0040b67b mov dword [rsp + 4], 0 | *((rsp + 4)) = 0; | } 0x0040b683 cmp dword [rsp + 4], 0 | | if (*((rsp + 4)) != 0) { 0x0040b688 jne 0x40b694 | goto label_4; | } 0x0040b68a jmp 0x40b68c | | } 0x0040b68c mov dword [rsp + 4], 0 | *((rsp + 4)) = 0; | label_4: 0x0040b694 cmp dword [rsp + 4], 0 | | if (*((rsp + 4)) != 0) { 0x0040b699 jne 0x40b6ad | goto label_5; | } 0x0040b69b jmp 0x40b69d | 0x0040b69d mov eax, dword [rsp + 0xc] | eax = *((rsp + 0xc)); 0x0040b6a1 add eax, 1 | eax++; 0x0040b6a4 mov dword [rsp + 0xc], eax | *((rsp + 0xc)) = eax; 0x0040b6a8 jmp 0x40b59e | | } while (1); | label_5: 0x0040b6ad jmp 0x40b6af | | label_3: 0x0040b6af cmp dword [rsp + 4], 4 | | if (*((rsp + 4)) == 4) { 0x0040b6b4 jne 0x40b6d2 | 0x0040b6b6 mov eax, dword [rsp + 0x14] | eax = *((rsp + 0x14)); 0x0040b6ba xor ecx, ecx | ecx = 0; 0x0040b6bc mov edx, 0xffffffff | edx = 0xffffffff; 0x0040b6c1 cmp ecx, eax | | if (ecx < eax) { 0x0040b6c3 cmovl edx, ecx | edx = ecx; | } 0x0040b6c6 mov dword [rsp + 8], edx | *((rsp + 8)) = edx; 0x0040b6ca mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; | } | label_2: 0x0040b6d2 lea rdi, [rsp + 0x10] | 0x0040b6d7 call 0x40d410 | BloombergLP::balst::StackTraceResolver_FileHelper::~StackTraceResolver_FileHelper() (rsp + 0x10); 0x0040b6dc jmp 0x40b6ea | | label_1: 0x0040b6ea mov eax, dword [rsp + 8] | eax = *((rsp + 8)); 0x0040b6ee add rsp, 0x78 | 0x0040b6f2 pop rbx | 0x0040b6f3 pop r14 | 0x0040b6f5 ret | return rax; | }