Function at 0x10012d70
Capabilities:
Encode data using xor
Encrypt or decrypt via wincrypt
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x54
mov eax, dword [0x100bb084]
xor eax, esp
mov dword [esp + 0x50], eax
push ebx
push esi
mov esi, dword [0x100c4200]
push edi
mov edi, 0x100c4204
cmp dword [esi + 0x10], 0
je 0x10013031
cmp dword [0x100c4218], 0x10
mov eax, edi
cmovae eax, dword [0x100c4204]
cmp dword [esi + 0x14], 0x10
jb 0x10012db6
mov ecx, dword [esi]
jmp 0x10012db8
mov ecx, esi
push dword [0x100c4214]
mov edx, dword [esi + 0x10]
push eax
call fcn.10012ba0
add esp, 8
test eax, eax
je 0x10013031
mov ah, 0x3f
mov byte [esp + 0x11], 0
mov bl, 0x11
mov byte [esp + 0xc], ah
mov al, 0x5b
mov byte [esp + 0x11], 0
mov cl, 0x4c
mov dl, 0x4b
xor bl, ah
xor al, ah
xor cl, ah
mov byte [esp + 0xd], bl
xor dl, ah
mov byte [esp + 0xe], al
mov byte [esp + 0xf], cl
mov byte [esp + 0x10], dl
test bl, bl
jne 0x10012e0a
xor ecx, ecx
jmp 0x10012e1a
lea ecx, [esp + 0xd]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10012e11
sub ecx, edx
push ecx
push ecx
lea eax, [esp + 0x15]
mov ecx, esi
push eax
call fcn.100129f0
cmp eax, 0xffffffff
je 0x1001302b
movaps xmm0, xmmword [0x100afb60]
xor ecx, ecx
push dword [0x100bfeac]
movups xmmword [esp + 0x1c], xmm0
mov dword [esp + 0x2c], 0xf0c0c5d
mov dword [esp + 0x30], 0x12581963
mov dword [esp + 0x34], 0x48485b
nop dword [eax]
mov al, byte [esp + 0x1c]
xor byte [esp + ecx + 0x1d], al
inc ecx
cmp ecx, 0x1a
jb 0x10012e60
sub esp, 0x18
mov byte [esp + 0x4f], 0
lea eax, [esp + 0x35]
mov ecx, esp
push eax
call fcn.10004b40
lea eax, [esp + 0x50]
push eax
call fcn.100043b0
add esp, 0x20
mov ecx, edi
push eax
call fcn.1000f870
mov eax, dword [esp + 0x48]
cmp eax, 0x10
jb 0x10012eaf
inc eax
lea ecx, [esp + 0x34]
push eax
push dword [esp + 0x38]
call fcn.100048f0
mov eax, dword [0x100c4200]
cmp dword [eax + 0x14], 0x10
jb 0x10012ebc
mov eax, dword [eax]
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
push eax
call esi
cmp dword [0x100c4218], 0x10
mov edi, eax
push 0
push 0x80
push 2
push 0
push 2
mov eax, 0x100c4204
mov dword [esp + 0x20], edi
cmovae eax, dword [0x100c4204]
push 0x40000000
push eax
call esi
mov ebx, eax
mov dword [esp + 0x14], ebx
cmp edi, 0xffffffff
je 0x10013005
cmp ebx, 0xffffffff
je 0x10013005
lea eax, [esp + 0x50]
xor bl, bl
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov eax, dword [esp + 0x54]
xor ecx, ecx
or ecx, dword [esp + 0x50]
and cl, 1
cdq
movzx edi, cl
neg edi
sbb edi, edi
add edi, 0x20
push edi
call fcn.1006519d
mov esi, eax
add esp, 4
test esi, esi
je 0x10012ffd
push 0
lea eax, [esp + 0x50]
push eax
push 4
push esi
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10012f84
push 0
lea eax, [esp + 0x50]
push eax
push dword [esp + 0x54]
push esi
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
push 0
push esi
call fcn.10060920
add esp, 0xc
mov dword [esp + 0x4c], 0
push 0
lea eax, [esp + 0x50]
push eax
push edi
push esi
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10012ff0
cmp dword [esp + 0x4c], edi
mov eax, 1
movzx ebx, bl
cmovb ebx, eax
lea eax, [esp + 0x4c]
push eax
push esi
push 0
push 1
push 0
push dword [0x100bfeb0]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x10012ff0
push 0
lea eax, [esp + 0x50]
push eax
push dword [esp + 0x54]
push esi
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test bl, bl
je 0x10012f98
push esi
call fcn.10064c0e
add esp, 4
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x10013012
push edi
call esi
test ebx, ebx
je 0x10013045
push ebx
call esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x50]
xor ecx, esp
call fcn.1005baa0
mov esp, ebp
pop ebp
ret
mov esi, dword [0x100c4200]
cmp esi, 0x100c4204
je 0x10013045
push 0xffffffffffffffff
push 0
push esi
mov ecx, edi
call fcn.100045d0
mov ecx, dword [esp + 0x5c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.1005baa0
mov esp, ebp
pop ebp
ret