Function at 0x406750
Capabilities:
Encode data using xor
Get file size
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x46b691
mov eax, dword fs:[0]
push eax
sub esp, 0x174
mov eax, dword [0x4854a0]
xor eax, esp
mov dword [esp + 0x170], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4854a0]
xor eax, esp
push eax
lea eax, [esp + 0x188]
mov dword fs:[0], eax
mov esi, ecx
mov ecx, dword [esi]
xor ebp, ebp
push ebp
lea eax, [esp + 0x28]
push eax
mov eax, dword [esi + 0x30]
mov dword [esp + 0x2c], ebp
mov edx, dword [ecx + 0x10]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 0x30]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebp
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x28]
push edx
push eax
mov dword [esp + 0x30], ebp
call ebx
test eax, eax
je 0x4068a0
cmp dword [esp + 0x18], 4
jne 0x4068a0
cmp dword [esp + 0x1c], ebp
je 0x406a58
cmp dword [esi + 0x38], 1
jle 0x406822
mov eax, dword [esi + 0x30]
push ebp
lea ecx, [esp + 0x1c]
push ecx
push 0x20
lea edx, [esp + 0x40]
push edx
push eax
call ebx
test eax, eax
je 0x4068a0
xor eax, eax
cmp dword [esp + 0x18], 0x20
jne 0x406a5d
mov byte [esp + 0x54], al
xor byte [esp + eax + 0x34], 0xa4
add eax, 1
cmp eax, 0x20
jl 0x406815
mov ecx, dword [esi + 0x30]
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [esi]
mov edi, eax
mov eax, 0xfffffffc
sub eax, dword [edx + 0x10]
add edi, eax
cmp dword [esi + 0x38], 1
jle 0x406844
sub edi, 0x20
cmp edi, ebp
jbe 0x4068a0
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0041bf8c
add esp, 4
mov dword [esp + 0x14], eax
push edi
mov dword [esp + 0x194], ebp
call fcn.0041bf8c
mov ebp, eax
add esp, 4
mov dword [esp + 0x30], ebp
push 0
lea edx, [esp + 0x1c]
push edx
push edi
mov byte [esp + 0x19c], 1
mov eax, dword [esi + 0x30]
push ebp
push eax
call ebx
test eax, eax
jne 0x4068a7
push ebp
call fcn.0041bf87
mov ecx, dword [esp + 0x18]
add esp, 4
push ecx
call fcn.0041bf87
add esp, 4
xor eax, eax
jmp 0x406a5d
cmp dword [esp + 0x18], edi
je 0x4068ca
push ebp
call fcn.0041bf87
mov edx, dword [esp + 0x18]
add esp, 4
push edx
call fcn.0041bf87
add esp, 4
xor eax, eax
jmp 0x406a5d
mov eax, dword [esi + 0x38]
cmp eax, 1
jle 0x406945
cmp eax, 2
jle 0x4068ff
cmp dword [esi + 0x13c], 0
jbe 0x4068ff
xor ecx, ecx
test edi, edi
jbe 0x4068ff
mov eax, ecx
xor edx, edx
div dword [esi + 0x13c]
add ecx, 1
mov al, byte [edx + esi + 0x3c]
xor byte [ecx + ebp - 1], al
cmp ecx, edi
jb 0x4068e6
lea ecx, [esp + 0x58]
push ecx
mov ecx, edi
mov edx, ebp
call fcn.00405e70
add esp, 4
lea ecx, [esp + 0x34]
lea eax, [esp + 0x58]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x406938
test dl, dl
je 0x406934
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x406938
add eax, 2
add ecx, 2
test dl, dl
jne 0x406918
xor eax, eax
jmp 0x40693d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4068ad
mov ecx, dword [esp + 0x14]
push edi
push ebp
lea eax, [esp + 0x24]
push eax
push ecx
call fcn.00417950
add esi, 4
add esp, 0x10
mov ebx, esi
mov dword [esp + 0x20], esi
call fcn.0040e290
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
lea eax, [esi + edx]
cmp esi, eax
mov edi, esi
mov dword [esp + 0x2c], eax
jae 0x406a46
push 0x28
call fcn.0041bf5c
add esp, 4
test eax, eax
je 0x4069a4
mov dword [eax + 0x18], 0xf
mov dword [eax + 0x14], 0
mov byte [eax + 4], 0
mov ebx, eax
jmp 0x4069a6
xor ebx, ebx
test ebx, ebx
mov dword [esp + 0x28], ebx
je 0x406a85
mov esi, dword [edi]
push esi
add edi, 4
lea eax, [esp + 0x80]
push edi
push eax
call fcn.00442ae0
add esp, 0xc
lea ecx, [esp + 0x7c]
push ecx
lea ecx, [esp + 0x5c]
mov byte [esp + esi + 0x80], 0
add edi, esi
call fcn.00402480
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
mov byte [esp + 0x19c], 2
call fcn.00402f60
mov byte [esp + 0x190], 1
cmp dword [esp + 0x70], 0x10
jb 0x406a11
mov edx, dword [esp + 0x5c]
push edx
call fcn.0041bf87
add esp, 4
mov eax, dword [edi]
mov esi, dword [esp + 0x20]
mov dword [ebx + 0x1c], eax
mov ecx, dword [edi + 4]
add edi, 4
mov dword [ebx + 0x20], ecx
mov edx, dword [edi + 4]
add edi, 4
mov dword [ebx + 0x24], edx
lea ebx, [esp + 0x28]
add edi, 4
call fcn.0040e230
cmp edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x14]
jb 0x406980
push ebp
call fcn.0041bf87
add esp, 4
push esi
call fcn.0041bf87
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x188]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x170]
xor ecx, esp
call fcn.00436f5b
add esp, 0x180
ret
push ebp
call fcn.0041bf87
add esp, 4
push esi
call fcn.0041bf87
add esp, 4
xor eax, eax
jmp 0x406a5d