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

Disassembly:
sub esp, 0x668
mov eax, dword [0x42610c]
xor eax, esp
mov dword [esp + 0x664], eax
mov eax, dword [esp + 0x674]
push ebp
mov ebp, dword [esp + 0x688]
push esi
mov esi, dword [esp + 0x678]
push edi
mov edi, dword [esp + 0x678]
push 0x5c
push esi
mov dword [esp + 0x14], edi
mov dword [esp + 0x24], eax
mov dword [0x42808c], ebp
call fcn.004137d0
add esp, 8
test eax, eax
jne 0x409a02
or ebp, 1
push ebp
push 0x191
push esi
push 0x7d1
push edi
call fcn.004062d0
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x664]
xor ecx, esp
call fcn.00411e16
add esp, 0x668
ret
push 0x5c
push esi
call fcn.004137d0
inc eax
mov edx, 0x428260
add esp, 8
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x409a15
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x409a75
or ebp, 3
push ebp
push 0x192
push 0x428260
push 0x7d9
push edi
call fcn.004062d0
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x664]
xor ecx, esp
call fcn.00411e16
add esp, 0x668
ret
push ebx
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, 0xffffffff
jne 0x409ab4
or ebp, 3
push ebp
push 0x193
push 0x428260
push 0x7da
push edi
call fcn.004062d0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x40a09f
push ebx
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x428374], eax
test eax, eax
jne 0x409aec
or ebp, 2
push ebp
push 0x194
push eax
push 0x7d8
push edi
call fcn.004062d0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x40a09f
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edi, eax
mov dword [esp + 0x18], edi
test edi, edi
jne 0x409b34
mov ecx, dword [esp + 0x10]
or ebp, 2
push ebp
push 0x195
push eax
push 0x7d6
push ecx
call fcn.004062d0
mov edx, dword [0x428374]
add esp, 0x14
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x40a09f
push 0
lea eax, [esp + 0x30]
push eax
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x409b65
mov ecx, dword [esp + 0x10]
or ebp, 3
push ebp
push 0x196
push 0x428260
push 0x7db
push ecx
jmp 0x409fd8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push str.bbP34.ngk
push edi
call fcn.00402ef0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x409bbd
mov ecx, dword [esp + 0x10]
or ebp, 1
push ebp
push 0x1e5
push 0x428260
push 0x42
push ecx
call fcn.004062d0
mov edx, dword [0x428374]
add esp, 0x14
push edx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [0x428374]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40a09f
mov esi, dword [esp + 0x20]
lea ebx, [eax + edi - 0x182]
mov eax, dword [ebx]
add eax, ebx
lea ecx, [esp + 0x368]
push ecx
lea edx, [esp + 0x268]
push edx
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x474]
push eax
lea ecx, [esp + 0x57c]
push ecx
push esi
mov dword [esp + 0x28], ebx
call fcn.00413268
add esp, 0x14
cmp byte [esp + 0x264], 0
jne 0x409c43
mov edx, dword [esp + 0x10]
or ebp, 1
push ebp
push 0x1bc
push esi
push 0x7d1
push edx
call fcn.004062d0
mov eax, dword [0x428374]
add esp, 0x14
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, dword [0x428374]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40a09f
mov eax, dword [esp + 0x690]
cmp byte [eax], 0
je 0x409c61
lea edx, [esp + 0x60]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x409c55
jmp 0x409cc2
xor eax, eax
mov cl, byte [esp + eax + 0x264]
mov byte [esp + eax + 0x60], cl
inc eax
test cl, cl
jne 0x409c63
lea eax, [esp + 0x368]
mov edx, eax
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409c80
lea edi, [esp + 0x60]
sub eax, edx
dec edi
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409c90
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
cmp byte [0x428e20], 0
rep movsb byte es:[edi], byte [esi]
je 0x409cc2
xor eax, eax
mov cl, byte [eax + 0x428e20]
mov byte [esp + eax + 0x60], cl
inc eax
test cl, cl
jne 0x409cb3
mov edi, dword [esp + 0x68c]
sub ebx, edi
mov eax, edi
lea edx, [ebx + 0x1c5]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409cd3
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x688]
mov edx, esi
sub edx, ebx
mov eax, ebx
add edx, 0x1cc
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409cf4
lea eax, [esp + 0x60]
mov ecx, eax
sub esi, ecx
lea edx, [esi + 0x1dd]
lea esp, [esp]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409d10
mov esi, dword [esp + 0x24]
mov edx, esi
sub edx, edi
mov eax, edi
add edx, 4
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409d27
mov ecx, esi
sub ecx, ebx
mov eax, ebx
lea edx, [ecx + 0xb]
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409d40
lea eax, [esp + 0x60]
mov edx, eax
sub esi, edx
lea edx, [esi + 0x1c]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409d55
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x14]
and eax, 0xfffffff7
or eax, 0x20
mov dword [ecx + 0x14], eax
cmp dword [0x42745c], 0
je 0x409d80
or eax, 0x4000000
mov dword [ecx + 0x14], eax
push ecx
call fcn.00404b20
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push eax
push str.K89l7g_QR1
push ecx
call fcn.00402ef0
add esp, 0x10
cmp eax, 0xffffffff
je 0x409efc
mov edx, dword [esp + 0x18]
lea esi, [eax + edx + 0xa]
mov ecx, esi
sub ecx, edi
mov eax, edi
lea edx, [ecx + 0xc]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409db7
mov edx, esi
sub edx, ebx
mov eax, ebx
add edx, 0x13
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409dd0
lea eax, [esp + 0x60]
mov edx, eax
mov ecx, esi
sub ecx, edx
lea edx, [ecx + 0x24]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x409de7
mov dword [esi + 8], 1
cmp dword [0x42745c], 0
je 0x409e08
mov dword [esi + 8], 0x4000001
mov dword [esp + 0x14], 0
mov ecx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x14]
mov eax, dword [ebx*4 + 0x426058]
mov edi, dword [esp + 0x18]
push ecx
push eax
push edi
call fcn.00402ef0
mov esi, eax
add esp, 0xc
cmp esi, 0xffffffff
je 0x409f6d
mov edx, dword [esp + 0x1c]
mov eax, dword [ebx*4 + 0x426084]
push edx
push eax
push edi
call fcn.00402ef0
mov edi, eax
add esp, 0xc
cmp edi, 0xffffffff
je 0x409f60
mov eax, dword [ebx*4 + 0x426058]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409e64
mov ecx, dword [esp + 0x18]
sub eax, edx
add eax, ecx
mov bl, byte [esi + eax]
add esi, eax
add edi, ecx
cmp bl, 2
jbe 0x409ebd
mov ecx, dword [esp + 0x14]
push ecx
push 0x602
lea edx, [esp + 0x16c]
push str.__d_07__d_
push edx
call fcn.0041246c
mov edx, dword [esp + 0x20]
mov eax, ebp
or eax, 1
push eax
push 0x602
lea ecx, [esp + 0x17c]
push ecx
push 0x42
push edx
call fcn.004062d0
add esp, 0x24
inc esi
cmp esi, edi
jge 0x409eea
movzx ecx, bl
shl ecx, 4
xor eax, eax
lea ebx, [ebx]
mov edx, eax
and edx, 0xf
mov dl, byte [edx + ecx + 0x4260a8]
xor dl, byte [esi]
inc esi
xor dl, 0x29
mov byte [esi - 1], dl
inc eax
cmp esi, edi
jl 0x409ed0
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cmp eax, 0xb
jb 0x409e10
mov edi, dword [esp + 0x20]
mov ebx, dword [esp + 0x10]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x409fac
or ebp, 3
push ebp
push 0x1a8
push edi
push 0x7d9
push ebx
call fcn.004062d0
mov eax, dword [0x428374]
add esp, 0x14
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, dword [0x428374]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40a09f
push ebx
push 0x602
push str.__d_08__d_
jmp 0x409f78
push ebx
push 0x602
push str.__d_09__d_
lea eax, [esp + 0x170]
push eax
call fcn.0041246c
mov edx, dword [esp + 0x20]
or ebp, 1
push ebp
push 0x602
lea ecx, [esp + 0x17c]
push ecx
push 0x42
push edx
call fcn.004062d0
add esp, 0x24
xor eax, eax
jmp 0x40a09f
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
push 0
lea edx, [esp + 0x2c]
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a007
or ebp, 3
push ebp
push 0x1a9
push edi
push 0x7d7
push ebx
call fcn.004062d0
mov edx, dword [0x428374]
add esp, 0x14
push edx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [0x428374]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x40a09f
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x30
lea ecx, [esp + 0x34]
push 0
push ecx
call fcn.004122b0
add esp, 0xc
push 0
push 0
lea edx, [esp + 0x38]
push edx
push 0
push edi
call dword [sym.imp.imagehlp.dll_MapAndLoad]
test eax, eax
jne 0x40a055
or ebp, 3
push ebp
push 0x1aa
push 0x428260
push 0x7d9
push ebx
call fcn.004062d0
add esp, 0x14
xor eax, eax
jmp 0x40a09f
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.imagehlp.dll_UnMapAndLoad]
test eax, eax
jne 0x40a080
or ebp, 3
push ebp
push 0x1ac
push edi
push 0x7d7
push ebx
call fcn.004062d0
add esp, 0x14
xor eax, eax
jmp 0x40a09f
mov ecx, dword [0x428374]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov edx, dword [0x428374]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 1
mov ecx, dword [esp + 0x674]
pop ebx
pop edi
pop esi
pop ebp
xor ecx, esp
call fcn.00411e16
add esp, 0x668
ret