Function at 0x401290
Capabilities:
Encode data using xor
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x28
push ebx
mov ebx, dword [esp + 0x14]
push ebp
push esi
push edi
mov edi, dword [0x40d940]
mov dword [esp + 0x24], edi
mov ebp, dword [esp + 0x24]
mov esi, 1
lea eax, [esi - 1]
cmp eax, 0x63
ja case.0x4012c3.3
movzx eax, byte [eax + 0x4014dc]
jmp dword [eax*4 + 0x4014c4]
push 0
lea ecx, [esp + 0x20]
push ecx
mov esi, 4
push esi
lea edx, [esp + 0x20]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401304
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x4012fa
cmp dword [esp + 0x1c], esi
je 0x40130a
mov ebp, 1
lea esi, [ebp + 0x63]
jmp case.0x4012c3.3
cmp dword [esp + 0x1c], esi
jne 0x4012fa
xor eax, eax
cmp dword [esp + 0x14], eax
je 0x4012fa
lea esi, [eax + 2]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
jmp case.0x4012c3.3
mov eax, dword [esp + 0x14]
mov ecx, dword [0x40d944]
push eax
push 8
push ecx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x4014b5
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x14]
push edx
call fcn.00401540
add esp, 4
test eax, eax
jne 0x401388
lea eax, [esp + 0x10]
xor ebx, ebx
push eax
lea edx, [esp + 0x24]
mov ecx, edi
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
call fcn.00401590
add esp, 4
test eax, eax
jne 0x4014b5
lea esi, [ebx + 0xa]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x20]
jmp 0x401390
mov ebp, 2
lea esi, [ebp + 0x62]
mov ecx, dword [0x40d944]
push edi
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [esp + 0x24]
jmp case.0x4012c3.3
push 0
lea edx, [esp + 0x1c]
push edx
push 4
lea eax, [esp + 0x1c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4013dd
cmp dword [esp + 0x18], 4
jne 0x4013dd
xor eax, eax
mov esi, 0xb
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
jmp case.0x4012c3.3
mov esi, 0x64
lea ebp, [esi - 0x5a]
jmp case.0x4012c3.3
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebx + 0xc], eax
mov edx, dword [esp + 0x10]
mov ecx, 0x10
cmp edx, ecx
jbe 0x40140c
xor byte [ecx + ebx], al
mov edx, dword [esp + 0x10]
inc ecx
cmp ecx, edx
jb 0x401400
xor esi, esi
push esi
lea ecx, [esp + 0x1c]
push ecx
push edx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401446
mov edx, dword [esp + 0x18]
cmp edx, dword [esp + 0x10]
jne 0x401446
mov eax, dword [0x40d944]
push ebx
push esi
push eax
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], esi
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4012af
mov esi, 0x64
lea ebp, [esi - 0x59]
jmp case.0x4012c3.3
mov eax, dword [esp + 0x28]
or eax, dword [esp + 0x2c]
jne 0x401479
lea ecx, [esp + 0x28]
push ecx
call fcn.00402c54
add esp, 4
push 0x32
mov esi, ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp case.0x4012c3.3
lea edx, [esp + 0x30]
push edx
call fcn.00402c54
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x38]
add esp, 4
add ecx, 0xa
adc eax, 0
cmp edx, eax
jg 0x4014bc
jl 0x4014a6
mov eax, dword [esp + 0x30]
cmp eax, ecx
ja 0x4014bc
push 0x32
mov esi, ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp case.0x4012c3.3
push 1
call fcn.00402f45
push 2
call fcn.00402f45
nop
retf 0x4012