Function at 0x409780
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [sym.imp.cygwin1.dll___stack_chk_guard]
mov dword [esp + 0x3c], eax
xor eax, eax
cmp dword [esp + 0x6c], 0xc
mov ebx, dword [esp + 0x60]
mov esi, dword [esp + 0x64]
jne 0x4099d7
lea edi, [ebx + 0x284]
mov dword [esp], esi
mov dword [esp + 8], edi
mov dword [esp + 4], pe_nt_image_headers32
call sub.cygcrypto_1.1.dll_AES_set_encrypt_key
lea eax, [ebx + 0x190]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], pe_nt_image_headers32
call sub.cygcrypto_1.1.dll_AES_set_decrypt_key
lea eax, [ebx + 0x20]
mov dword [ebx + 0x140], 0
mov dword [ebx + 0x144], 0
mov dword [ebx + 0x148], 0
mov dword [ebx + 0x14c], 0
mov dword [ebx + 0x160], 0
mov dword [ebx + 0x164], 0
mov dword [ebx + 0x168], 0
mov dword [ebx + 0x16c], 0
mov dword [ebx + 0x188], 0
mov dword [esp + 4], eax
lea eax, [ebx + 0x160]
mov dword [esp + 8], edi
mov dword [esp], eax
call sub.cygcrypto_1.1.dll_AES_encrypt
mov eax, dword [ebx + 0x20]
mov edx, dword [ebx + 0x24]
mov ecx, dword [ebx + 0x28]
mov ebp, dword [ebx + 0x2c]
bswap edx
bswap eax
mov esi, edx
mov edi, eax
mov eax, edx
bswap ecx
mov edx, edi
mov dword [esp + 0x1c], ecx
shr ecx, 0x1f
add eax, esi
shld edx, esi, 1
bswap ebp
xor ecx, eax
mov dword [esp + 0x18], ebp
mov eax, dword [esp + 0x18]
mov dword [esp + 0x20], ecx
mov ecx, edi
mov dword [esp + 0x2c], edx
sar ecx, 0x1f
mov ebp, dword [esp + 0x2c]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x1c]
and ecx, 0x87
bswap ebp
mov dword [ebx + 0x30], ebp
shld edx, eax, 1
add eax, eax
xor ecx, eax
mov dword [esp + 0x1c], edx
bswap edx
mov dword [esp + 0x18], ecx
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
mov dword [ebx + 0x38], edx
bswap eax
mov dword [ebx + 0x3c], eax
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
bswap ecx
mov dword [ebx + 0x34], ecx
mov ecx, dword [esp + 0x1c]
mov edi, eax
add edi, eax
mov ebp, edx
shr ecx, 0x1f
shld ebp, eax, 1
mov dword [esp + 0x28], edi
mov eax, edx
xor ecx, edi
mov edi, dword [esp + 0x1c]
sar eax, 0x1f
mov dword [esp + 0x2c], ebp
and eax, 0x87
mov dword [esp + 0x20], ecx
shld edi, esi, 1
add esi, esi
mov dword [esp + 0x24], ebp
lea ebp, [ebx + 0x140]
xor eax, esi
mov dword [esp + 0x1c], edi
mov edx, edi
mov dword [esp + 0x18], eax
mov eax, ecx
bswap edx
bswap eax
mov esi, eax
mov eax, dword [esp + 0x2c]
mov dword [ebx + 0x48], edx
mov dword [ebx + 0x44], esi
bswap eax
mov ecx, eax
mov eax, dword [esp + 0x18]
mov dword [ebx + 0x40], ecx
bswap eax
mov dword [ebx + 0x4c], eax
lea eax, [ebx + 0x50]
lea esi, [esi]
mov ebx, dword [esp + 0x20]
mov esi, dword [esp + 0x24]
add eax, 0x10
mov ecx, dword [esp + 0x1c]
mov edx, esi
shld esi, ebx, 1
add ebx, ebx
shr ecx, 0x1f
mov edi, esi
mov esi, ebx
sar edx, 0x1f
mov ebx, ecx
mov ecx, dword [esp + 0x18]
and edx, 0x87
mov dword [esp + 0x24], edi
xor ebx, esi
mov esi, edi
mov dword [esp + 0x20], ebx
mov ebx, dword [esp + 0x1c]
bswap esi
mov dword [eax - 0x10], esi
shld ebx, ecx, 1
add ecx, ecx
xor edx, ecx
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x2c], ebx
bswap ecx
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x2c]
bswap edx
mov dword [eax - 0xc], ecx
bswap ebx
mov dword [eax - 4], edx
mov dword [eax - 8], ebx
cmp ebp, eax
jne 0x409948
xor eax, eax
mov edx, dword [esp + 0x3c]
sub edx, dword [sym.imp.cygwin1.dll___stack_chk_guard]
jne 0x4099de
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0xfffffffe
jmp 0x4099c3
call sub.cygwin1.dll___stack_chk_fail
lea esi, [esi]
lea esi, [esi]