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

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
push edi
mov eax, dword [esi + 0x4550]
mov ecx, dword [esi + 0x4554]
mov edx, eax
mov edi, ecx
sub edx, 1
sbb edi, 0
mov dword [esi + 0x4550], edx
test ecx, ecx
mov dword [esi + 0x4554], edi
jg 0x46d681
jl 0x46d677
test eax, eax
ja 0x46d681
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 0x14f98]
test eax, eax
jne 0x46dac5
mov eax, dword [esi + 0x54]
test eax, eax
je 0x46d7d8
mov eax, dword [esi + 0x5c]
mov byte [esi + 0x14fa4], 0
test eax, eax
je 0x46d6c2
xor edi, edi
xor ecx, ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x10], ecx
mov dword [esi], ecx
mov byte [esi + 0x14fa4], 1
jmp switch.0x0046d75a
mov eax, dword [esi + 0xa0]
mov edx, dword [esi + 0x60]
mov ebx, dword [esi + 0x14f90]
mov ebp, dword [esi + 0x64]
xor edi, edi
mov ecx, 3
test eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], edx
jbe 0x46d751
cmp ecx, 3
jne 0x46d751
mov ecx, dword [esi + 0x4584]
mov edx, dword [esi + 0x6c]
sub eax, edi
mov dword [esp + 0x28], eax
lea eax, [esp + 0x10]
push eax
mov eax, dword [esi + 0x68]
push ecx
mov ecx, 0x20
call fcn.004b56a0
mov edx, dword [esi + 0x68]
mov ecx, dword [esp + 0x20]
push eax
push edx
push ebp
lea edx, [esp + 0x3c]
push ecx
mov eax, ebp
push edx
push ebx
sar eax, 0x1f
push 0
call dword [esi + 0x4580]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x18]
add edi, eax
add ebx, eax
add ecx, eax
mov eax, dword [esp + 0x14]
adc ebp, 0
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x10]
cmp edi, eax
jb 0x46d6eb
cmp ecx, 3
mov dword [esp + 0x28], edi
ja case.default.0x46d75a
jmp dword [ecx*4 + 0x46db00]
mov eax, edi
and eax, 0xffff
mov dword [esi + 0x14f98], eax
je 0x46d798
mov ebx, dword [esi + 0x60]
add ebx, eax
mov dword [esi + 0x60], ebx
mov edi, dword [esi + 0x64]
adc edi, 0
xor eax, eax
test ecx, ecx
sete al
test ecx, ecx
sete cl
mov dword [esi + 0x64], edi
mov dword [esi + 0x5c], eax
mov byte [esi + 0x14fa4], cl
jmp case.default.0x46d75a
mov dword [esi + 0x5c], 1
jmp 0x46d7ab
mov dword [esi + 0x14f98], 0xffffffff
mov byte [esi + 0x14fa4], 1
mov eax, dword [esi + 0x14f98]
test eax, eax
ja 0x46d981
mov eax, dword [esi + 0x5c]
test eax, eax
jne 0x46d7ce
mov byte [esi + 0x14fa4], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 0xa0]
mov ecx, dword [esi + 0x14f90]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea edx, [esp + 0x28]
push 0
push edx
mov edx, dword [esi + 0x14fa8]
push eax
push ecx
push edx
call ebx
cmp eax, 1
jne 0x46d812
mov eax, dword [esp + 0x28]
and eax, 0xffff
mov dword [esi + 0x14f98], eax
jmp 0x46d81c
mov dword [esi + 0x14f98], 0xffffffff
mov eax, dword [esi + 0x14f98]
test eax, eax
mov eax, dword [esi + 0x4ee4]
ja 0x46d841
test eax, eax
jne 0x46d849
mov byte [esi + 0x14fa4], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
test eax, eax
je 0x46d981
mov eax, dword [esi + 0x14f98]
test eax, eax
ja 0x46d981
mov eax, dword [esi + 0x4e3a]
cmp eax, 0xffffffff
je 0x46d871
mov ecx, dword [esi + 0x4ee8]
inc ecx
cmp ecx, eax
jg 0x46da50
call fcn.00465070
mov eax, dword [esi + 0x4e3a]
cmp eax, 0xffffffff
jne 0x46d8b2
mov eax, dword [esi + 0x40]
test eax, eax
je 0x46d89f
mov edx, dword [esi + 0x4ee8]
push esi
add edx, 2
push 0
push edx
call fcn.0046b9e0
add esp, 0xc
jmp 0x46d8ed
mov eax, dword [esi + 0x4ee8]
push 0x526974
add eax, 2
push 0
push eax
jmp 0x46d8e1
mov ecx, dword [esi + 0x40]
test ecx, ecx
je 0x46d8d0
mov ecx, dword [esi + 0x4ee8]
inc eax
push esi
add ecx, 2
push eax
push ecx
call fcn.0046b9e0
add esp, 0xc
jmp 0x46d8ed
mov edx, dword [esi + 0x4ee8]
inc eax
push 0x526974
add edx, 2
push eax
push edx
push 1
push 0
call fcn.00469480
add esp, 0x14
cmp eax, 1
jne 0x46d9c5
mov eax, dword [esi + 0x4ee8]
lea edi, [esi + 0x14fac]
add eax, 2
push eax
push edi
call fcn.0046e630
add esp, 8
test eax, eax
je 0x46d973
push edi
call fcn.00465000
add esp, 4
test eax, eax
jne 0x46d973
mov edx, dword [esi + 0xa0]
lea ecx, [esp + 0x28]
push eax
mov eax, dword [esi + 0x14f90]
push ecx
mov ecx, dword [esi + 0x14fa8]
push edx
push eax
push ecx
call ebx
cmp eax, 1
jne 0x46d964
mov eax, dword [esp + 0x28]
test eax, eax
jbe 0x46d964
and eax, 0xffff
mov dword [esi + 0x14f98], eax
mov eax, dword [esi + 0x4ee8]
inc eax
mov dword [esi + 0x4ee8], eax
jmp 0x46d973
call fcn.00465070
mov dword [esi + 0x14f98], 0
mov eax, dword [esi + 0x4ee4]
test eax, eax
jne 0x46d849
mov eax, dword [esi + 0x58]
test eax, eax
je 0x46da5a
mov edi, dword [esi + 0x14f98]
test edi, edi
jbe 0x46da5a
mov ecx, dword [esi + 0x4550]
mov eax, dword [esi + 0x4554]
add ecx, 1
adc eax, 0
xor edx, edx
cmp edx, eax
jl 0x46d9de
jg 0x46d9b8
cmp edi, ecx
jbe 0x46d9de
mov edx, dword [esi + 0x4550]
inc edx
mov dword [esp + 0x14], edx
jmp 0x46d9e2
cmp eax, 2
jne 0x46da50
mov dword [esi], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov dword [esp + 0x14], edi
mov ecx, dword [esi + 0x4584]
mov edx, dword [esi + 0x6c]
mov ebx, dword [esi + 0x60]
mov edi, dword [esi + 0x64]
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 3
push eax
mov eax, dword [esi + 0x68]
push ecx
mov ecx, 0x20
call fcn.004b56a0
mov edx, dword [esi + 0x68]
push eax
push edx
mov edx, dword [esi + 0x14f90]
push edi
lea ecx, [esp + 0x28]
push ebx
mov eax, edi
push ecx
push edx
sar eax, 0x1f
push 2
call dword [esi + 0x4580]
mov eax, dword [esp + 0x10]
test eax, eax
jl 0x46da5a
cmp eax, 2
jg 0x46da5a
mov dword [esi + 0x14f98], 0xffffffff
mov byte [esi + 0x14fa4], 1
mov dword [esi], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 0x4eec]
mov edi, dword [esi + 0x14f90]
test eax, eax
mov dword [esi + 0x14f94], edi
je 0x46dac5
mov ecx, dword [esi + 0x4550]
mov eax, dword [esi + 0x4554]
mov ebx, dword [esi + 0x14f98]
add ecx, 1
adc eax, 0
xor edx, edx
cmp edx, eax
jl 0x46da9d
jg 0x46da94
cmp ebx, ecx
jbe 0x46da9d
mov eax, dword [esi + 0x4550]
inc eax
jmp 0x46da9f
mov eax, ebx
mov ecx, eax
dec eax
test ecx, ecx
je 0x46dac5
lea ebp, [eax + 1]
call fcn.0046eb60
xor edx, edx
mov ebx, eax
mov dl, byte [edi]
xor ebx, edx
push ebx
call fcn.0046eb90
add esp, 4
mov byte [edi], bl
inc edi
dec ebp
jne 0x46daa9
mov eax, dword [esi + 0x14f94]
mov edx, dword [esp + 0x24]
pop edi
movzx cx, byte [eax]
mov word [edx], cx
mov ecx, dword [esi + 0x14f94]
mov eax, dword [esi + 0x14f98]
inc ecx
dec eax
mov dword [esi + 0x14f94], ecx
mov dword [esi + 0x14f98], eax
pop esi
pop ebp
mov eax, 8
pop ebx
add esp, 0x10
ret