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

Disassembly:
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
sub esp, 0x440
push ebx
push ebp
push esi
mov esi, dword [esp + 0x458]
xor ebx, ebx
push edi
lea edx, [esp + 0x3c]
mov dword [eax], ebx
mov eax, dword [esp + 0x454]
push edx
push eax
or edi, 0xffffffff
mov dword [ecx], ebx
mov dword [esi], ebx
call fcn.00405e70
add esp, 8
cmp byte [esp + 0x3c], bl
mov ebp, eax
mov dword [esp + 0x454], ebp
jne 0x405f79
cmp dword [esp + 0x458], ebx
jg 0x405f79
push ebx
push 0x8000000
push 3
push ebx
push 1
push 0x80000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esi], eax
jmp 0x406342
push 0x41b848
mov dword [esp + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x41b974]
test esi, esi
je 0x405fce
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x405fac
mov ebx, esi
mov esi, dword [esi + 0x114]
test esi, esi
jne 0x405f92
jmp 0x405fce
test ebx, ebx
je 0x405fce
mov ecx, dword [esi + 0x114]
mov edx, dword [0x41b974]
mov dword [ebx + 0x114], ecx
mov dword [esi + 0x114], edx
mov dword [0x41b974], esi
push 0x41b848
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
jne 0x406160
cmp byte [ebp], 0
je 0x406005
push esi
push 0x8000000
push 3
push esi
push 1
push 0x80000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
jmp 0x40608e
push 0x104
lea eax, [esp + 0x350]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0x8000000
push 3
push 0
push 1
push 0x80000000
lea ecx, [esp + 0x364]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40635c
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 2
push 0
push 0xfffffffffffffffc
push edi
mov esi, eax
call ebx
push 0
lea edx, [esp + 0x1c]
push edx
push 4
lea eax, [esp + 0x1c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x10]
cmp eax, esi
jae 0x406082
sub esi, eax
mov dword [esp + 0x14], esi
mov ecx, dword [esp + 0x14]
push 0
push 0
push ecx
push edi
call ebx
cmp edi, 0xffffffff
je 0x40635c
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
lea edx, [esp + 0x14]
push edx
push 0x20
lea eax, [esp + 0x28]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x1c]
cmp eax, 0x32504444
jne 0x4061fe
mov ebx, 1
mov eax, dword [esp + 0x24]
mov ecx, dword [0x41b9ac]
add eax, 0x118
push eax
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
push ebp
lea edx, [esi + 0x118]
push esi
mov dword [esi + 0x104], edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [esp + 0x20]
push 0
mov dword [esi + 0x10c], eax
mov eax, dword [esp + 0x18]
push 0
push eax
push edi
mov dword [esi + 0x108], ebx
mov dword [esi + 0x110], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x24]
mov eax, dword [esi + 0x104]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x41b848
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x41b974]
push 0x41b848
mov dword [esi + 0x114], ecx
mov dword [0x41b974], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, byte [esp + 0x3c]
test al, al
je 0x40628a
cmp dword [esi + 0x108], 2
jne 0x406342
movsx eax, al
xor ebp, ebp
test eax, eax
lea ecx, [esp + 0x3c]
lea edx, [ebp + 1]
je 0x4061a5
lea esp, [esp]
imul eax, edx
add ecx, 1
xor ebp, eax
movsx eax, byte [ecx]
add edx, 0x1f3
test eax, eax
jne 0x406190
mov eax, ebp
shr eax, 0xb
xor eax, ebp
xor edx, edx
div dword [esi + 0x10c]
mov eax, dword [esi + 0x104]
lea ecx, [edx + edx + 8]
cmp dword [eax + ecx*4], 0
je 0x406342
mov ebx, dword [eax + ecx*4 + 4]
add ebx, eax
cmp byte [ebx], 0
je 0x406342
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcmpA]
lea ecx, [ecx]
lea edx, [ebx + 0x11]
push edx
lea eax, [esp + 0x40]
push eax
call ebp
test eax, eax
jle 0x406224
movzx ecx, byte [ebx]
add ebx, ecx
cmp byte [ebx], 0
jne 0x4061e0
jmp 0x406342
cmp eax, 0x33504444
jne 0x40620f
mov ebx, 2
jmp 0x4060c9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x440
ret
jne 0x40620f
mov edx, dword [esi + 0x110]
add edx, dword [ebx + 1]
cmp edi, 0xffffffff
mov eax, dword [esp + 0x464]
mov ecx, dword [ebx + 5]
mov dword [eax], edx
mov edx, dword [esp + 0x45c]
mov eax, dword [ebx + 9]
mov dword [edx], ecx
mov ecx, dword [esp + 0x460]
mov dword [ecx], eax
jne 0x406347
mov eax, dword [esp + 0x454]
cmp byte [eax], 0
jne 0x406327
push 0x104
lea edx, [esp + 0x148]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x144]
jmp 0x406327
mov ecx, dword [esp + 0x458]
test ecx, ecx
jle 0x406342
cmp dword [esi + 0x108], 1
jne 0x40620f
cmp ecx, dword [esi + 0x10c]
ja 0x40620f
mov eax, dword [esi + 0x104]
mov edx, dword [esi + 0x110]
mov esi, dword [esp + 0x464]
lea ecx, [ecx*4 + 4]
add edx, dword [eax + ecx*4]
cmp edi, 0xffffffff
mov dword [esi], edx
mov edx, dword [eax + ecx*4 + 4]
mov eax, dword [eax + ecx*4 + 8]
mov esi, dword [esp + 0x45c]
mov ecx, dword [esp + 0x460]
mov dword [esi], edx
mov dword [ecx], eax
jne 0x406347
cmp byte [ebp], 0
je 0x40630b
push 0
push 0x8000000
push 3
push 0
push 1
push 0x80000000
push ebp
jmp 0x40633a
push 0x104
lea edx, [esp + 0x24c]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x248]
push 0
push 0x8000000
push 3
push 0
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40635c
mov ecx, dword [esp + 0x464]
mov edx, dword [ecx]
push 0
push 0
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x440
ret