Function at 0x180045a90
Capabilities:
Write file on windows

Disassembly:
push rbp
push rdi
push r14
push r15
sub rsp, 0x98
mov rax, qword [0x1801b0238]
xor rax, rsp
mov qword [rsp + 0x78], rax
mov rbp, rdx
mov r15, r8
mov edi, 0x20
lea r8, [rsp + 0x48]
mov edx, edi
mov rcx, rbp
mov r14, r9
call qword [sym.imp.GDI32.dll_GetObjectW]
test eax, eax
je 0x180045cc5
movzx eax, word [rsp + 0x58]
movzx ecx, word [rsp + 0x5a]
mov qword [rsp + 0x90], rbx
mov qword [rsp + 0x88], rsi
mov esi, 1
imul ecx, eax
mov qword [rsp + 0x80], r12
cmp cx, si
jne 0x180045ce0
movzx edi, si
movzx ecx, dil
mov eax, esi
shl eax, cl
movsxd rdx, eax
lea rdx, [rdx*4 + 0x28]
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbx, rax
mov dword [rax], 0x28
mov eax, dword [rsp + 0x4c]
mov dword [rbx + 4], eax
mov eax, dword [rsp + 0x50]
mov dword [rbx + 8], eax
movzx eax, word [rsp + 0x58]
mov word [rbx + 0xc], ax
movzx eax, word [rsp + 0x5a]
mov word [rbx + 0xe], ax
cmp di, 0x18
jae 0x180045b5f
movzx ecx, dil
shl esi, cl
mov dword [rbx + 0x20], esi
mov eax, dword [rbx + 4]
xor r12d, r12d
movzx ecx, di
add eax, 7
cdq
mov dword [rbx + 0x10], r12d
and edx, 7
mov dword [rbx + 0x24], r12d
add edx, eax
sar edx, 3
imul edx, ecx
xor ecx, ecx
imul edx, dword [rbx + 8]
mov dword [rbx + 0x14], edx
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov rsi, rax
test rax, rax
je 0x180045cad
movzx r9d, word [rbx + 8]
xor r8d, r8d
mov dword [rsp + 0x30], r12d
mov rdx, rbp
mov qword [rsp + 0x28], rbx
mov rcx, r15
mov qword [rsp + 0x20], rax
call qword [sym.imp.GDI32.dll_GetDIBits]
test eax, eax
je 0x180045cad
mov qword [rsp + 0x30], r12
xor r9d, r9d
mov dword [rsp + 0x28], 0x80
xor r8d, r8d
mov edx, 0xc0000000
mov dword [rsp + 0x20], 2
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x180045cad
mov eax, 0x4d42
mov qword [rsp + 0x20], r12
mov word [rsp + 0x68], ax
lea r9, [rsp + 0x40]
mov edx, dword [rbx + 0x20]
lea r8d, [rdx*4 + 0xe]
mov edx, dword [rbx]
add r8d, dword [rbx + 0x14]
add edx, r8d
mov dword [rsp + 0x6e], r12d
mov dword [rsp + 0x6a], edx
lea r8d, [r12 + 0xe]
mov ecx, dword [rbx + 0x20]
lea rdx, [rsp + 0x68]
lea ecx, [rcx*4 + 0xe]
add ecx, dword [rbx]
mov dword [rsp + 0x72], ecx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180045cad
mov r8d, dword [rbx + 0x20]
lea r9, [rsp + 0x40]
mov rdx, rbx
mov qword [rsp + 0x20], r12
mov rcx, rdi
lea r8d, [r8*4 + 0x28]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180045cad
mov r8d, dword [rbx + 0x14]
lea r9, [rsp + 0x40]
mov rdx, rsi
mov qword [rsp + 0x20], r12
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180045cad
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x180045cad
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GlobalFree]
mov rsi, qword [rsp + 0x88]
mov rbx, qword [rsp + 0x90]
mov r12, qword [rsp + 0x80]
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.1800e5f40
add rsp, 0x98
pop r15
pop r14
pop rdi
pop rbp
ret
cmp cx, 4
ja 0x180045cf0
mov edi, 4
jmp 0x180045b09
cmp cx, 8
ja 0x180045d00
mov edi, 8
jmp 0x180045b09
cmp cx, 0x10
ja 0x180045d10
mov edi, 0x10
jmp 0x180045b09
cmp cx, 0x18
ja 0x180045b09
mov edi, 0x18
lea edx, [rdi + 0x10]
jmp 0x180045b1c