; assembly | /* r2dec pseudo code output */ | /* balst_stacktraceprintutil.t/assume @ 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_ (uint32_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; | uint32_t var_40h; | signed int64_t var_4ch; | uint32_t var_50h; | uint32_t var_58h; | 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 + 0x40], rsi | *((rsp + 0x40)) = rsi; 0x0040b441 mov qword [rsp + 0x68], rdx | *((rsp + 0x68)) = rdx; 0x0040b446 mov dword [rsp + 0x4c], ecx | *((rsp + 0x4c)) = ecx; 0x0040b44a mov qword [rsp + 0x30], r8 | *((rsp + 0x30)) = r8; 0x0040b44f mov qword [rsp + 0x38], r9 | *((rsp + 0x38)) = r9; 0x0040b454 mov r14, qword [rsp + 0x70] | r14 = *((rsp + 0x70)); 0x0040b459 cmp qword [rsp + 0x30], 0 | | if (*((rsp + 0x30)) != 0) { 0x0040b45f je 0x40b467 | 0x0040b461 cmp qword [rsp + 0x38], 0 | | } 0x0040b467 mov rdi, qword [r14 + 0x60] | 0x0040b46b call 0x40ac30 | BloombergLP::balst::StackTraceResolverImpl::HiddenRec::reset() (*((r14 + 0x60))); 0x0040b470 mov qword [rsp + 0x20], 0 | *((rsp + 0x20)) = 0; 0x0040b479 cmp qword [rsp + 0x40], 0 | | if (*((rsp + 0x40)) != 0) { 0x0040b47f je 0x40b4a5 | 0x0040b481 mov rax, qword [rsp + 0x40] | rax = *((rsp + 0x40)); 0x0040b486 cmp byte [rax], 0 | | if (*(rax) != 0) { 0x0040b489 je 0x40b4a5 | 0x0040b48b mov rax, qword [r14 + 0x60] | rax = *((r14 + 0x60)); 0x0040b48f mov byte [rax + 0x94], 0 | *((rax + 0x94)) = 0; 0x0040b496 mov rax, qword [rsp + 0x40] | rax = *((rsp + 0x40)); 0x0040b49b mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x0040b4a0 jmp 0x40b534 | | } | } else { 0x0040b4a5 mov rax, qword [r14 + 0x60] | rax = *((r14 + 0x60)); 0x0040b4a9 mov byte [rax + 0x94], 1 | *((rax + 0x94)) = 1; 0x0040b4b0 mov rsi, qword [r14 + 0x40] | rsi = *((r14 + 0x40)); 0x0040b4b4 movabs rdi, 0x43fc4f | rdi = "/proc/self/exe"; 0x0040b4be mov edx, 0x7fc0 | edx = 0x7fc0; 0x0040b4c3 call 0x404d90 | eax = readlink (); 0x0040b4c8 mov dword [rsp + 0x1c], eax | *((rsp + 0x1c)) = eax; 0x0040b4cc cmp dword [rsp + 0x1c], 0 | | if (*((rsp + 0x1c)) > 0) { 0x0040b4d1 jle 0x40b50d | 0x0040b4d3 jmp 0x40b4d5 | 0x0040b4d5 cmp dword [rsp + 0x1c], 0x7fc0 | | if (*((rsp + 0x1c)) >= 0x7fc0) { 0x0040b4dd jl 0x40b4f1 | 0x0040b4df mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b4e7 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b4ef jmp 0x40b527 | goto label_0; | } 0x0040b4f1 jmp 0x40b4f3 | 0x0040b4f3 jmp 0x40b4f5 | 0x0040b4f5 mov rax, qword [r14 + 0x40] | rax = *((r14 + 0x40)); 0x0040b4f9 movsxd rcx, dword [rsp + 0x1c] | rcx = *((rsp + 0x1c)); 0x0040b4fe mov byte [rax + rcx], 0 | *((rax + rcx)) = 0; 0x0040b502 mov rax, qword [r14 + 0x40] | rax = *((r14 + 0x40)); 0x0040b506 mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x0040b50b jmp 0x40b51f | | } else { 0x0040b50d mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b515 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b51d jmp 0x40b527 | goto label_0; | } 0x0040b51f mov dword [rsp + 4], 0 | *((rsp + 4)) = 0; | label_0: 0x0040b527 cmp dword [rsp + 4], 0 | | if (*((rsp + 4)) != 0) { 0x0040b52c jne 0x40b6f8 | goto label_1; | } 0x0040b532 jmp 0x40b534 | | } 0x0040b534 mov rdi, qword [rsp + 0x20] | 0x0040b539 mov rsi, r14 | 0x0040b53c call 0x40d2a0 | rax = BloombergLP::bdlb::String::copy(char const*,BloombergLP::bslma::Allocator*) (*((rsp + 0x20)), r14); 0x0040b541 mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x0040b546 lea rbx, [rsp + 0x10] | rbx = rsp + 0x10; 0x0040b54b mov rdi, rbx | 0x0040b54e call 0x40d410 | BloombergLP::balst::StackTraceResolver_FileHelper::StackTraceResolver_FileHelper() (rbx); 0x0040b553 mov rsi, qword [rsp + 0x20] | 0x0040b558 mov rdi, rbx | 0x0040b55b call 0x40d450 | eax = BloombergLP::balst::StackTraceResolver_FileHelper::initialize(char const*) (rbx, *((rsp + 0x20))); 0x0040b560 jmp 0x40b562 | 0x0040b562 mov dword [rsp + 0x18], eax | *((rsp + 0x18)) = eax; 0x0040b566 cmp dword [rsp + 0x18], 0 | | if (*((rsp + 0x18)) != 0) { 0x0040b56b je 0x40b590 | 0x0040b56d mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b575 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b57d jmp 0x40b6e0 | goto label_2; | } 0x0040b590 mov rax, qword [r14 + 0x60] | rax = *((r14 + 0x60)); 0x0040b594 lea rcx, [rsp + 0x10] | rcx = rsp + 0x10; 0x0040b599 mov qword [rax], rcx | *(rax) = rcx; 0x0040b59c mov dword [rsp + 0x14], 0 | *((rsp + 0x14)) = 0; 0x0040b5a4 mov dword [rsp + 0xc], 0 | *((rsp + 0xc)) = 0; | do { 0x0040b5ac mov eax, dword [rsp + 0xc] | eax = *((rsp + 0xc)); 0x0040b5b0 cmp eax, dword [rsp + 0x4c] | | if (eax >= *((rsp + 0x4c))) { 0x0040b5b4 jl 0x40b5c3 | 0x0040b5b6 mov dword [rsp + 4], 4 | *((rsp + 4)) = 4; 0x0040b5be jmp 0x40b6bd | goto label_3; | } 0x0040b5c3 mov rax, qword [rsp + 0x68] | rax = *((rsp + 0x68)); 0x0040b5c8 movsxd rcx, dword [rsp + 0xc] | rcx = *((rsp + 0xc)); 0x0040b5cd imul rcx, rcx, 0x38 | rcx *= 0x38; 0x0040b5d1 add rax, rcx | rax += rcx; 0x0040b5d4 mov qword [rsp + 0x28], rax | *((rsp + 0x28)) = rax; 0x0040b5d9 mov rax, qword [rsp + 0x28] | rax = *((rsp + 0x28)); 0x0040b5de mov ecx, 1 | ecx = 1; 0x0040b5e3 cmp ecx, dword [rax] | | if (ecx == *(rax)) { 0x0040b5e5 jne 0x40b69a | 0x0040b5eb mov rax, qword [rsp + 0x30] | rax = *((rsp + 0x30)); 0x0040b5f0 mov qword [rsp + 0x58], rax | *((rsp + 0x58)) = rax; 0x0040b5f5 mov rax, qword [rsp + 0x38] | rax = *((rsp + 0x38)); 0x0040b5fa mov qword [rsp + 0x50], rax | *((rsp + 0x50)) = rax; 0x0040b5ff cmp qword [rsp + 0x30], 0 | | if (*((rsp + 0x30)) != 0) { 0x0040b605 je 0x40b621 | 0x0040b607 mov rax, qword [rsp + 0x30] | rax = *((rsp + 0x30)); 0x0040b60c mov rcx, qword [rsp + 0x28] | rcx = *((rsp + 0x28)); 0x0040b611 xor edx, edx | edx = 0; 0x0040b613 sub rdx, qword [rcx + 0x10] | rdx -= *((rcx + 0x10)); 0x0040b617 add rax, rdx | rax += rdx; 0x0040b61a mov qword [rsp + 0x50], rax | *((rsp + 0x50)) = rax; 0x0040b61f jmp 0x40b634 | | } else { 0x0040b621 mov rax, qword [rsp + 0x38] | rax = *((rsp + 0x38)); 0x0040b626 mov rcx, qword [rsp + 0x28] | rcx = *((rsp + 0x28)); 0x0040b62b add rax, qword [rcx + 0x10] | rax += *((rcx + 0x10)); 0x0040b62f mov qword [rsp + 0x58], rax | *((rsp + 0x58)) = rax; | } 0x0040b634 mov rsi, qword [rsp + 0x50] | 0x0040b639 mov rdx, qword [rsp + 0x58] | 0x0040b63e mov rax, qword [rsp + 0x28] | rax = *((rsp + 0x28)); 0x0040b643 mov rcx, qword [rax + 0x28] | 0x0040b647 mov r8, qword [rsp + 0x20] | 0x0040b64c mov rdi, r14 | 0x0040b64f call 0x40b710 | eax = BloombergLP::balst::StackTraceResolverImpl::resolveSegment(void*,void*,unsigned long,char const*) (r14, *((rsp + 0x50)), *((rsp + 0x58)), *((rax + 0x28)), *((rsp + 0x20))); 0x0040b654 jmp 0x40b656 | 0x0040b656 mov dword [rsp + 0x18], eax | *((rsp + 0x18)) = eax; 0x0040b65a cmp dword [rsp + 0x18], 0 | | if (*((rsp + 0x18)) != 0) { 0x0040b65f je 0x40b67e | 0x0040b661 mov dword [rsp + 8], 0xffffffff | *((rsp + 8)) = 0xffffffff; 0x0040b669 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; 0x0040b671 jmp 0x40b691 | | } else { 0x0040b67e mov eax, dword [rsp + 0x14] | eax = *((rsp + 0x14)); 0x0040b682 add eax, 1 | eax++; 0x0040b685 mov dword [rsp + 0x14], eax | *((rsp + 0x14)) = eax; 0x0040b689 mov dword [rsp + 4], 0 | *((rsp + 4)) = 0; | } 0x0040b691 cmp dword [rsp + 4], 0 | | if (*((rsp + 4)) != 0) { 0x0040b696 jne 0x40b6a2 | goto label_4; | } 0x0040b698 jmp 0x40b69a | | } 0x0040b69a mov dword [rsp + 4], 0 | *((rsp + 4)) = 0; | label_4: 0x0040b6a2 cmp dword [rsp + 4], 0 | | if (*((rsp + 4)) != 0) { 0x0040b6a7 jne 0x40b6bb | goto label_5; | } 0x0040b6a9 jmp 0x40b6ab | 0x0040b6ab mov eax, dword [rsp + 0xc] | eax = *((rsp + 0xc)); 0x0040b6af add eax, 1 | eax++; 0x0040b6b2 mov dword [rsp + 0xc], eax | *((rsp + 0xc)) = eax; 0x0040b6b6 jmp 0x40b5ac | | } while (1); | label_5: 0x0040b6bb jmp 0x40b6bd | | label_3: 0x0040b6bd cmp dword [rsp + 4], 4 | | if (*((rsp + 4)) == 4) { 0x0040b6c2 jne 0x40b6e0 | 0x0040b6c4 mov eax, dword [rsp + 0x14] | eax = *((rsp + 0x14)); 0x0040b6c8 xor ecx, ecx | ecx = 0; 0x0040b6ca mov edx, 0xffffffff | edx = 0xffffffff; 0x0040b6cf cmp ecx, eax | | if (ecx < eax) { 0x0040b6d1 cmovl edx, ecx | edx = ecx; | } 0x0040b6d4 mov dword [rsp + 8], edx | *((rsp + 8)) = edx; 0x0040b6d8 mov dword [rsp + 4], 1 | *((rsp + 4)) = 1; | } | label_2: 0x0040b6e0 lea rdi, [rsp + 0x10] | 0x0040b6e5 call 0x40d420 | BloombergLP::balst::StackTraceResolver_FileHelper::~StackTraceResolver_FileHelper() (rsp + 0x10); 0x0040b6ea jmp 0x40b6f8 | | label_1: 0x0040b6f8 mov eax, dword [rsp + 8] | eax = *((rsp + 8)); 0x0040b6fc add rsp, 0x78 | 0x0040b700 pop rbx | 0x0040b701 pop r14 | 0x0040b703 ret | return rax; | }