Function at 0x4021ac
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x423a22
mov eax, dword fs:[0]
push eax
mov eax, 0x1ad0
call fcn.0041faf0
mov eax, dword [0x42d4b4]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x1ab8], edi
and dword [ebp - 4], 0
mov dword [0x42f79c], edi
call fcn.0040190b
test eax, eax
je 0x402204
cmp edi, 1
jne 0x402204
push edi
call fcn.00401a4e
call fcn.00401e68
cmp dword [0x42f7b0], 0
je 0x402296
mov esi, 0xa94
lea eax, [ebp - 0x1aac]
push esi
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x402296
xor eax, eax
push eax
mov dword [ebp - 0x1ad4], eax
mov dword [ebp - 0x1ac0], eax
lea eax, [ebp - 0x1ad4]
push eax
push esi
lea eax, [ebp - 0x1aac]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4022bc
and dword [ebp - 0x1ac4], eax
push eax
lea eax, [ebp - 0x1ac0]
push eax
push 4
lea eax, [ebp - 0x1ac4]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor esi, esi
lea ecx, [ebp + 8]
call fcn.00403cc2
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0041f870
leave
ret
and dword [ebp - 0x1acc], 0
lea edx, [ebp - 0x1acc]
xor esi, esi
mov ecx, edi
mov dword [ebp - 0x1ab4], esi
call fcn.00406dae
push 0x800
mov dword [ebp - 0x1ac4], eax
lea eax, [ebp - 0x1014]
push esi
push eax
call sub.msvcrt.dll_memset
and dword [ebp - 0x1abc], esi
add esp, 0xc
and dword [ebp - 0x1ad0], esi
cmp dword [ebp - 0x1acc], esi
jle 0x402569
mov esi, dword [ebp - 0x1ac4]
mov eax, dword [ebp - 0x101c]
mov dword [ebp - 0x1ac8], esi
cmp eax, 2
jne 0x40232c
push 0
lea edx, [ebp - 0x129c]
jmp 0x40234e
test eax, eax
jne 0x40233c
push eax
lea eax, [ebp - 0x1aac]
xor edx, edx
push eax
jmp 0x402350
cmp eax, 1
jne 0x4024be
lea eax, [ebp - 0x109c]
xor edx, edx
push eax
push 0
mov ecx, esi
call fcn.00401f55
pop ecx
pop ecx
test eax, eax
je 0x4024b8
push 0x800
lea eax, [ebp - 0x814]
push 0
push eax
call sub.msvcrt.dll_memset
and dword [ebp - 0x1ad8], 0
lea eax, [ebp - 0x1ad8]
add esp, 0xc
mov dword [ebp - 0x1adc], 0x400
push eax
lea eax, [ebp - 0x1adc]
push eax
lea eax, [ebp - 0x814]
push eax
lea eax, [esi + 0x14]
push eax
call dword [sym.imp.WS2_32.dll_WSCGetProviderPath]
call fcn.0040461c
push eax
lea ecx, [ebp - 0x1ab0]
call fcn.00403cdd
mov byte [ebp - 4], 1
call fcn.0040190b
test eax, eax
je 0x402460
cmp edi, 1
jne 0x402460
lea eax, [ebp - 0x814]
push eax
lea ecx, [ebp - 0x1ab0]
call fcn.00403aa3
lea ecx, [ebp - 0x1ab0]
call fcn.00403904
push str.windows_syswow64_
push str._system32_
lea ecx, [ebp - 0x1ab0]
call fcn.0040392c
mov esi, dword [ebp - 0x1ab0]
mov eax, dword [esi - 0xc]
mov dword [ebp - 0x1ab4], eax
cmp dword [esi - 4], edi
jle 0x402430
push eax
lea ecx, [ebp - 0x1ab0]
call fcn.00403c0a
mov esi, dword [ebp - 0x1ab0]
mov eax, dword [ebp - 0x1ab4]
add eax, eax
push eax
lea eax, [ebp - 0x814]
push esi
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
push dword [esi - 8]
push esi
call fcn.004182d0
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x1ab0]
call fcn.00403bdf
mov esi, dword [ebp - 0x1ac8]
mov edx, dword [esi + 0x24]
mov ecx, edi
call fcn.00405d18
xor ecx, ecx
test eax, eax
sete cl
mov dword [ebp - 0x1ab4], ecx
test eax, eax
jne 0x4024e5
inc eax
cmp dword [ebp - 0x1abc], eax
je 0x4024a9
mov ecx, 0x200
mov dword [ebp - 0x1abc], eax
lea esi, [ebp - 0x814]
lea edi, [ebp - 0x1014]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp - 0x1ab8]
mov esi, dword [ebp - 0x1ac8]
lea ecx, [ebp - 0x1ab0]
mov byte [ebp - 4], 0
call fcn.00403cc2
mov eax, dword [ebp - 0x101c]
mov ecx, dword [ebp - 0x1ad0]
add esi, 0x274
inc ecx
mov dword [ebp - 0x1ac8], esi
mov dword [ebp - 0x1ad0], ecx
cmp ecx, dword [ebp - 0x1acc]
jl 0x40231d
jmp 0x40251b
and dword [ebp - 0x1ab8], 0
lea eax, [ebp - 0x1ac0]
push 0
push eax
push 4
lea eax, [ebp - 0x1ab8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
and dword [ebp - 0x1abc], 0
lea ecx, [ebp - 0x1ab0]
mov byte [ebp - 4], 0
call fcn.00403cc2
cmp dword [ebp - 0x1abc], 0
je 0x402563
push 0
lea eax, [ebp - 0x1ac0]
mov dword [ebp - 0x1ab8], 1
push eax
push 4
lea eax, [ebp - 0x1ab8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x1ac0]
push eax
push 0x800
lea eax, [ebp - 0x1014]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [ebp - 0x1ab4]
mov ecx, dword [ebp - 0x1ac4]
call fcn.00406e58
test ebx, ebx
je 0x40257f
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.0040190b
test eax, eax
je 0x402298
cmp edi, 1
jne 0x402298
push 0
call fcn.00401a4e
jmp 0x402298