Function at 0x404506
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [ecx + 4]
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x30], edx
push edi
push 7
mov edx, dword [esi + 4]
pop ebx
mov dword [ebp - 0x14], ecx
lea eax, [eax + edx*2]
imul eax, dword [esi]
mov dword [ebp - 0x20], eax
add eax, 7
cdq
and edx, ebx
add eax, edx
sar eax, 3
push eax
call fcn.004ebd99
mov dword [ebp - 0xc], eax
pop ecx
test eax, eax
jne 0x40454b
or eax, 0xffffffff
jmp 0x404840
sub esp, 0x14
call fcn.00509c1f
mov esi, eax
add esp, 0x14
mov dword [ebp - 8], esi
test esi, esi
jne 0x404582
push str.Failed_to_initialize_PNG_writer._n
push str.writePNG
push 0x47
push str.srcliblibsm2qr2png.c
push 0x55ed0c
push ebx
push 0
call fcn.004e8a0a
add esp, 0x1c
jmp 0x404543
mov ecx, esi
call fcn.0050ab36
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x40459e
push str.Failed_to_initialize_PNG_write._n
push str.writePNG
push 0x4d
jmp 0x40456b
push ecx
mov ecx, esi
call fcn.0050a7cc
pop ecx
xor esi, esi
push esi
push eax
call fcn.0054ed20
pop ecx
pop ecx
test eax, eax
je 0x4045db
lea edx, [ebp - 0x10]
lea ecx, [ebp - 8]
call fcn.0050a02d
push str.Failed_to_write_PNG_image._n
push str.writePNG
push 0x53
push str.srcliblibsm2qr2png.c
push 0x55ed0c
push ebx
push esi
jmp 0x404578
push 6
call fcn.004ebd99
pop ecx
mov ecx, eax
mov dword [ebp - 0x38], ecx
test ecx, ecx
jne 0x4045fa
push str.Failed_to_allocate_memory._n
push str.writePNG
push 0x59
jmp 0x4045cd
mov edi, dword [ebp + 8]
mov ebx, dword [ebp - 0x10]
mov edx, ebx
push 2
push ecx
mov al, byte [edi + 0xc]
mov byte [ecx], al
mov al, byte [edi + 0x10]
mov byte [ecx + 1], al
mov al, byte [edi + 0x14]
mov byte [ecx + 2], al
mov al, byte [edi + 0x1c]
mov byte [ecx + 3], al
mov al, byte [edi + 0x20]
mov byte [ecx + 4], al
mov al, byte [edi + 0x24]
mov byte [ecx + 5], al
mov al, byte [edi + 0x18]
mov ecx, dword [ebp - 8]
mov byte [ebp - 4], al
mov al, byte [edi + 0x28]
mov byte [ebp - 3], al
call fcn.0050a12d
mov ecx, dword [ebp - 8]
lea eax, [ebp - 4]
push esi
push 2
push eax
mov edx, ebx
call fcn.0050a209
mov edx, dword [ebp - 0x30]
add esp, 0x14
mov ecx, dword [ebp - 8]
push esi
push 0x4044c4
call fcn.0050b32d
mov eax, dword [ebp - 0x20]
mov edx, ebx
mov ecx, dword [ebp - 8]
push esi
push esi
push esi
push 3
push 1
push eax
push eax
call fcn.0050a058
movd xmm0, dword [edi + 8]
add esp, 0x24
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [0x5b2048]
call fcn.0054ebd0
cmp dword [ebp - 8], esi
je 0x4046b3
test ebx, ebx
je 0x4046b3
or dword [ebx + 8], 0x80
mov dword [ebx + 0xc0], eax
mov dword [ebx + 0xc4], eax
mov byte [ebx + 0xc8], 1
mov ecx, dword [ebp - 8]
mov edx, ebx
call fcn.005097de
mov eax, dword [ebp - 0x20]
lea eax, [eax + 7]
cdq
and edx, 7
add eax, edx
sar eax, 3
push eax
push 0xff
push dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
call fcn.0051c010
mov eax, dword [edi]
add esp, 0xc
imul eax, dword [edi + 4]
test eax, eax
jle 0x404707
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov edx, ebx
call fcn.00509d4d
mov eax, dword [edi]
inc esi
imul eax, dword [edi + 4]
cmp esi, eax
jl 0x4046ed
mov ebx, dword [ebp - 0x10]
xor esi, esi
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x28], esi
mov ecx, dword [eax + 8]
mov dword [ebp - 0x18], ecx
cmp dword [eax + 4], esi
jle 0x4047e1
mov ebx, dword [ebp - 0xc]
push dword [ebp - 0x2c]
push 0xff
push ebx
call fcn.0051c010
mov eax, dword [edi + 4]
add esp, 0xc
mov ecx, dword [edi]
imul eax, ecx
mov dword [ebp - 0x24], 8
push 7
mov dword [ebp - 0x1c], esi
cdq
idiv dword [ebp - 0x24]
add eax, ebx
mov dword [ebp - 0x34], eax
pop eax
sub eax, edx
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x24], eax
cmp dword [edx + 4], esi
jle 0x4047b3
mov ebx, dword [ebp - 0x34]
mov eax, ecx
mov dword [ebp - 0x34], esi
mov ecx, eax
test eax, eax
jle 0x40479d
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x18]
mov ecx, edx
push 7
mov al, byte [eax]
and al, 1
shl al, cl
xor byte [ebx], al
sub edx, 1
mov ecx, edx
pop eax
cmovs edx, eax
test ecx, ecx
mov ecx, dword [edi]
lea eax, [ebx + 1]
cmovns eax, ebx
inc esi
mov ebx, eax
cmp esi, ecx
jl 0x40476c
mov dword [ebp - 0x24], edx
xor esi, esi
mov edx, dword [ebp - 0x14]
inc dword [ebp - 0x18]
mov eax, ecx
inc dword [ebp - 0x1c]
mov edi, dword [ebp - 0x1c]
cmp edi, dword [edx + 4]
mov edi, dword [ebp + 8]
jl 0x404760
mov ebx, dword [ebp - 0xc]
mov dword [ebp - 0x34], esi
test ecx, ecx
jle 0x4047ce
mov ecx, dword [ebp - 8]
mov edx, ebx
call fcn.00509d4d
inc esi
cmp esi, dword [edi]
jl 0x4047ba
mov edx, dword [ebp - 0x14]
xor esi, esi
mov eax, dword [ebp - 0x28]
inc eax
mov dword [ebp - 0x28], eax
cmp eax, dword [edx + 4]
jl 0x40471f
mov ebx, dword [ebp - 0x10]
push dword [ebp - 0x2c]
push 0xff
push dword [ebp - 0xc]
call fcn.0051c010
mov eax, dword [edi + 4]
add esp, 0xc
imul eax, dword [edi]
test eax, eax
jle 0x404819
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov edx, ebx
call fcn.00509d4d
mov eax, dword [edi]
inc esi
imul eax, dword [edi + 4]
cmp esi, eax
jl 0x404801
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 8]
mov edx, ebx
call fcn.00509ab4
lea edx, [ebp - 0x10]
lea ecx, [ebp - 8]
call fcn.0050a02d
mov ecx, dword [ebp - 0xc]
call fcn.004ebe45
mov ecx, dword [ebp - 0x38]
call fcn.004ebe45
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret