Function at 0x140031930
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x610
mov qword [rax - 0x5a0], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rax, qword [0x1400ada20]
xor rax, rsp
mov qword [rsp + 0x600], rax
mov rbx, rcx
mov r10d, 0x2000
movzx edx, word [rcx + 0x16]
movzx eax, word [rcx + 0x14]
imul edx, eax
movd xmm0, edx
cvtdq2ps xmm0, xmm0
mulss xmm0, dword [rcx + 0x14a0]
cvttss2si ecx, xmm0
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
mov r9d, eax
cmp word [rbx + 0x5d1a6], 0
cmove r9d, ecx
test dword [rbx + 0x1438], 0xfffffffd
jne 0x140031a20
cmp dword [rbx + 0x14a8], 0
jne 0x140031a20
xor esi, esi
mov r10d, esi
mov eax, dword [rbx + 0x21c]
test eax, eax
jle 0x140031a22
mov r11, qword [rbx + 0x5d1a8]
add r11, 0x7ffc
mov edi, eax
nop dword [rax]
mov ecx, esi
mov edx, 0x1fff
mov r8d, edx
mov rax, r11
nop dword [rax]
add ecx, dword [rax]
cmp ecx, r9d
jg 0x140031a07
dec r8d
dec rdx
sub rax, 4
cmp rdx, 0x20
jg 0x1400319f0
cmp r10d, r8d
cmovge r8d, r10d
mov r10d, r8d
add r11, 0x8000
sub rdi, 1
jne 0x1400319e0
jmp 0x140031a22
xor esi, esi
lea eax, [r10*8]
movd xmm0, eax
cvtdq2ps xmm0, xmm0
divss xmm0, dword [rbx + 0x1428]
cvttss2si eax, xmm0
mov dword [rsp + 0x20], eax
mov r9d, 2
movsd xmm2, qword [rbx + 0x13f0]
movsd xmm1, qword [rbx + 0x13e8]
mov rcx, rbx
call sym.EURawImg.exe_protected:_void___cdecl_LibRaw::gamma_curve_double__double__int__int____ptr64
movzx ecx, word [rbx + 0x14]
mov word [rbx + 0x1c], cx
movzx edx, word [rbx + 0x16]
mov word [rbx + 0x1e], dx
test byte [rbx + 0x30], 4
je 0x140031a89
mov word [rbx + 0x16], cx
movzx eax, cx
sub ax, cx
add ax, dx
mov word [rbx + 0x14], ax
movzx edx, cx
movzx eax, dx
imul eax, dword [rbx + 0x1470]
imul eax, dword [rbx + 0x21c]
cdq
and edx, 7
add eax, edx
sar eax, 3
movsxd rdx, eax
lea r8, [rsp + 0x70]
lea rcx, [rsp + 0x80]
call fcn.14000aa70
nop
mov r15, qword [rsp + 0x80]
mov edi, 1
cmp dword [rbx + 0x1474], 0
je 0x140031b35
mov r8d, edi
lea rdx, [rsp + 0xa0]
mov rcx, rbx
call sym.EURawImg.exe_protected:_void___cdecl_LibRaw::tiff_head_struct_tiff_hdr____ptr64__int____ptr64
mov r9, qword [rbx + 0x5d160]
mov r8d, edi
mov edx, 0x560
lea rcx, [rsp + 0xa0]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov rax, qword [rbx + 0x5d1b0]
test rax, rax
je 0x140031cf3
mov ecx, dword [rax]
call qword [sym.imp.WS2_32.dll_ntohl]
mov edx, eax
mov r9, qword [rbx + 0x5d160]
mov r8d, edi
mov rcx, qword [rbx + 0x5d1b0]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
jmp 0x140031cf3
mov r10d, dword [rbx + 0x21c]
mov eax, dword [rbx + 0x1478]
and eax, 1
mov ecx, dword [rbx + 0x1470]
movzx edx, word [rbx + 0x14]
movzx r8d, word [rbx + 0x16]
movzx r11d, dx
shl edi, cl
dec edi
cmp r10d, 3
jle 0x140031c2f
lea r9, [rbx + 0x26c]
movzx r8d, r8w
test eax, eax
je 0x140031c06
lea rax, [rbx + 0x10c]
lea rcx, [rbx + 0xcc]
movss xmm0, dword [rbx + 0x2efb4]
cvtps2pd xmm0, xmm0
movss xmm1, dword [rbx + 0x2efb0]
cvtps2pd xmm1, xmm1
cvttss2si edx, dword [rbx + 0x2efa8]
movss xmm2, dword [rbx + 0x2efac]
cvtps2pd xmm2, xmm2
mov qword [rsp + 0x68], r9
mov dword [rsp + 0x60], edi
mov dword [rsp + 0x58], r10d
mov dword [rsp + 0x50], r11d
mov dword [rsp + 0x48], r8d
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rcx
movsd qword [rsp + 0x30], xmm0
movsd qword [rsp + 0x28], xmm1
mov dword [rsp + 0x20], edx
mov r9d, dword [rbx + 0x2efb8]
movq r8, xmm2
lea rdx, str.P7_n_EXPTIME_0.5f_n_TIMESTAMP_d_n_ISOSPEED_d_n_APERTURE_0.1f_n_FOCALLEN_0.1f_n_MAKE_s_n_MODEL_s_nWIDTH__d_nHEIGHT__d_nDEPTH__d_nMAXVAL__d_nTUPLTYPE__s_nENDHDR_n
mov rcx, qword [rbx + 0x5d160]
call fcn.14000a570
jmp 0x140031cf3
mov qword [rsp + 0x30], r9
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], r10d
mov r9d, r11d
lea rdx, str.P7_nWIDTH__d_nHEIGHT__d_nDEPTH__d_nMAXVAL__d_nTUPLTYPE__s_nENDHDR_n
mov rcx, qword [rbx + 0x5d160]
call fcn.14000a570
jmp 0x140031cf3
movzx r14d, r8w
test eax, eax
mov eax, r10d
cdq
je 0x140031ccc
lea rcx, [rbx + 0x10c]
lea r8, [rbx + 0xcc]
movss xmm0, dword [rbx + 0x2efb4]
cvtps2pd xmm0, xmm0
movss xmm1, dword [rbx + 0x2efb0]
cvtps2pd xmm1, xmm1
cvttss2si r9d, dword [rbx + 0x2efa8]
movss xmm3, dword [rbx + 0x2efac]
cvtps2pd xmm3, xmm3
sub eax, edx
sar eax, 1
mov dword [rsp + 0x60], edi
mov dword [rsp + 0x58], r11d
mov dword [rsp + 0x50], r14d
mov qword [rsp + 0x48], rcx
mov qword [rsp + 0x40], r8
movsd qword [rsp + 0x38], xmm0
movsd qword [rsp + 0x30], xmm1
mov dword [rsp + 0x28], r9d
mov ecx, dword [rbx + 0x2efb8]
mov dword [rsp + 0x20], ecx
movq r9, xmm3
lea r8d, [rax + 5]
lea rdx, str.P_d_n_EXPTIME_0.5f_n_TIMESTAMP_d_n_ISOSPEED_d_n_APERTURE_0.1f_n_FOCALLEN_0.1f_n_MAKE_s_n_MODEL_s_n_d__d_n_d_n
mov rcx, qword [rbx + 0x5d160]
call fcn.14000a570
jmp 0x140031cf3
sub eax, edx
sar eax, 1
lea r8d, [rax + 5]
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], r11d
mov r9d, r14d
lea rdx, str.P_d_n_d__d_n_d_n
mov rcx, qword [rbx + 0x5d160]
call fcn.14000a570
mov edx, dword [rbx + 0x30]
mov r11d, edx
and r11d, 4
mov edi, edx
and edi, 2
mov eax, esi
je 0x140031d0c
movzx eax, word [rbx + 0x1c]
dec eax
and edx, 1
mov ecx, esi
je 0x140031d1e
movzx r8d, word [rbx + 0x1e]
lea ecx, [r8 - 1]
jmp 0x140031d23
movzx r8d, word [rbx + 0x1e]
movzx r10d, r8w
mov r14d, r10d
imul r14d, eax
add r14d, ecx
mov r8d, esi
test r11d, r11d
setne r8b
mov r9d, esi
test r11d, r11d
sete r9b
test edi, edi
je 0x140031d54
movzx eax, word [rbx + 0x1c]
sub eax, r8d
dec eax
jmp 0x140031d57
mov eax, r8d
mov ecx, r9d
test edx, edx
je 0x140031d66
mov ecx, r10d
sub ecx, r9d
dec ecx
mov r12d, r10d
imul r12d, eax
sub r12d, r14d
add r12d, ecx
test edi, edi
je 0x140031d84
movzx r13d, word [rbx + 0x1c]
sub r13d, r9d
dec r13d
jmp 0x140031d87
mov r13d, r9d
test edx, edx
je 0x140031d95
mov eax, r10d
sub eax, r8d
lea r8d, [rax - 1]
movzx eax, word [rbx + 0x16]
mov r9d, eax
test r11d, r11d
cmove r9d, esi
mov ecx, esi
cmove ecx, eax
test edi, edi
je 0x140031db7
movzx eax, word [rbx + 0x1c]
sub eax, r9d
lea r9d, [rax - 1]
test edx, edx
je 0x140031dc3
mov eax, r10d
sub eax, ecx
lea ecx, [rax - 1]
sub r13d, r9d
imul r13d, r10d
sub r13d, ecx
add r13d, r8d
mov dword [rsp + 0x78], r13d
mov edi, esi
mov dword [rsp + 0x74], esi
mov ecx, 0x55aa
movzx eax, word [rbx + 0x14]
cmp edi, eax
jge 0x140031f66
mov r11d, esi
cmp si, word [rbx + 0x16]
jae 0x140031ee8
movsxd rax, r14d
movsxd rcx, r12d
lea rdi, [rax*4]
lea r13, [rcx*4]
nop
mov eax, dword [rbx + 0x21c]
cmp dword [rbx + 0x1470], 8
jne 0x140031e7c
mov r10d, esi
mov r9, rsi
test eax, eax
jle 0x140031ec4
nop dword [rax]
cmp r9, 4
jge 0x140031ec4
lea rcx, [r9 + rdi]
mov rax, qword [rbx + 8]
movzx r8d, word [rax + rcx*2]
mov eax, dword [rbx + 0x21c]
imul eax, r11d
add eax, r10d
movsxd rdx, eax
movzx ecx, byte [rbx + r8*2 + 0x1511]
mov rax, qword [rsp + 0x80]
mov byte [rdx + rax], cl
inc r10d
inc r9
cmp r10d, dword [rbx + 0x21c]
jl 0x140031e30
jmp 0x140031ec4
mov r9d, esi
mov r8, rsi
test eax, eax
jle 0x140031ec4
cmp r8, 4
jge 0x140031ec4
lea rcx, [r8 + rdi]
mov rax, qword [rbx + 8]
movzx edx, word [rax + rcx*2]
mov eax, dword [rbx + 0x21c]
imul eax, r11d
add eax, r9d
movsxd rcx, eax
movzx eax, word [rbx + rdx*2 + 0x1510]
mov word [r15 + rcx*2], ax
inc r9d
inc r8
cmp r9d, dword [rbx + 0x21c]
jl 0x140031e86
inc r11d
add r14d, r12d
add rdi, r13
movzx eax, word [rbx + 0x16]
cmp r11d, eax
jl 0x140031e10
mov r13d, dword [rsp + 0x78]
mov edi, dword [rsp + 0x74]
mov ecx, 0x55aa
cmp dword [rbx + 0x1470], 0x10
jne 0x140031f25
cmp dword [rbx + 0x1474], 0
jne 0x140031f25
call qword [sym.imp.WS2_32.dll_htons]
mov ecx, 0x55aa
cmp ax, cx
je 0x140031f25
movzx eax, word [rbx + 0x16]
imul eax, dword [rbx + 0x21c]
add eax, eax
movsxd r8, eax
mov rdx, r15
mov rcx, rbx
call sym.EURawImg.exe_protected:_void___cdecl_LibRaw::libraw_swab_void____ptr64__unsigned_long_long_unsigned___int64_____ptr64
movzx r8d, word [rbx + 0x16]
mov eax, dword [rbx + 0x1470]
imul eax, dword [rbx + 0x21c]
cdq
and edx, 7
add eax, edx
sar eax, 3
movsxd rdx, eax
mov r9, qword [rbx + 0x5d160]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
inc edi
mov dword [rsp + 0x74], edi
add r14d, r13d
jmp 0x140031ddb
mov rcx, qword [rsp + 0x80]
test rcx, rcx
je 0x140031fac
mov rdx, qword [rsp + 0x90]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140031fa6
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140031fa6
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14007c570
nop
mov rcx, qword [rsp + 0x600]
xor rcx, rsp
call fcn.14007c510
lea r11, [rsp + 0x610]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret