Function at 0x402c4b
Capabilities:
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x340
push ebx
push esi
xor ebx, ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push ebx
mov esi, ecx
push 0x80
push 3
push ebx
lea eax, [esi + 0x20]
push 1
push 0x80000000
push eax
mov dword [ebp - 0x18], esi
call edi
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x403169
cmp eax, 0xffffffff
je 0x403169
lea eax, [ebp - 0x23c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp - 0x23c]
push 0x4170dc
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push ebx
push 0x80
push 2
push ebx
push ebx
lea eax, [ebp - 0x23c]
push 0x40000000
push eax
call edi
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x402cd6
cmp eax, 0xffffffff
jne 0x402d0f
lea eax, [ebp - 0x23c]
push eax
call fcn.0040ae43
pop ecx
lea eax, [ebp - 0x23c]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push eax
call edi
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x403136
cmp eax, 0xffffffff
je 0x403136
push ebx
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0x100000
mov dword [ebp - 0x14], eax
call fcn.0040aec3
mov edi, eax
pop ecx
cmp edi, ebx
jne 0x402d3d
push ebx
push 0x41709c
push 0x4172f4
jmp 0x40318f
mov ecx, dword [ebp - 0x14]
mov eax, 0x100000
cmp ecx, eax
mov dword [ebp - 0xc], eax
ja 0x402d4f
mov dword [ebp - 0xc], ecx
lea eax, [ebp - 0xc]
push ebx
push eax
push dword [ebp - 0xc]
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402da7
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040ae7b
lea eax, [esi + 0x20]
push eax
lea eax, [ebp - 0x138]
push 0x4172dc
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x138]
push ebx
push 0x41709c
jmp 0x40318e
movzx eax, byte [edi]
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x24]
push ebx
push eax
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff8
push eax
lea eax, [edi + 8]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402e0f
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040ae7b
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x138]
push 0x4172c0
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x138]
push ebx
push 0x41709c
jmp 0x40318e
mov eax, dword [ebp - 0x14]
lea ecx, [eax - 8]
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff8
mov dword [ebp - 0x14], ecx
cmp eax, ecx
mov dword [ebp - 0x10], eax
jae 0x402e79
mov ecx, dword [ebp - 0x14]
mov eax, 0x100000
sub ecx, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
cmp ecx, eax
ja 0x402e3a
mov dword [ebp - 0xc], ecx
add dword [ebp - 0x10], eax
lea eax, [ebp - 0xc]
push ebx
push eax
push dword [ebp - 0xc]
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x402ef7
lea eax, [ebp - 0x24]
push ebx
push eax
push dword [ebp - 0xc]
push edi
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402f39
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0x10], eax
jb 0x402e25
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push edi
call fcn.0040ae7b
mov eax, dword [ebp - 0x1c]
pop ecx
cmp eax, ebx
jbe 0x403081
dec eax
mov dword [ebp - 0x14], ebx
cmp eax, ebx
mov dword [ebp - 0x28], eax
jbe 0x403081
mov dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x18]
add eax, 0x20
push eax
lea eax, [ebp - 0x138]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x138]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
dec eax
cmp eax, ebx
jle 0x402ee3
cmp byte [ebp + eax - 0x138], 0x2e
jne 0x402ecd
mov byte [ebp + eax - 0x138], bl
cmp dword [ebp - 0x10], 0xa
jae 0x402f7e
push str..wp00
jmp 0x402f90
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040ae7b
lea eax, [esi + 0x20]
push eax
lea eax, [ebp - 0x138]
push 0x4172dc
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x138]
push ebx
push 0x41709c
jmp 0x40318e
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040ae7b
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x138]
push 0x4172c0
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x138]
push ebx
push 0x41709c
jmp 0x40318e
cmp dword [ebp - 0x10], 0x64
jae 0x402f8b
push str..wp0
jmp 0x402f90
push 0x4170c8
lea eax, [ebp - 0x138]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x34]
push 0xa
push eax
push dword [ebp - 0x10]
call fcn.00414264
add esp, 0xc
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x138]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push ebx
push 0x80
push 3
push ebx
push 1
lea eax, [ebp - 0x138]
push 0x80000000
push eax
call edi
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
jne 0x403019
lea eax, [ebp - 0x138]
push eax
mov eax, dword [ebp - 0x18]
mov ecx, dword [eax + 0x1c]
call fcn.00402162
test eax, eax
je 0x4030a8
push ebx
push 0x80
push 3
push ebx
push 1
lea eax, [ebp - 0x138]
push 0x80000000
push eax
jmp 0x402fdc
push ebx
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
mov dword [ebp - 0x1c], eax
call fcn.0040aec3
mov edi, eax
pop ecx
cmp edi, ebx
push ebx
je 0x4030b2
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x1c]
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 4]
test eax, eax
je 0x4030be
call esi
lea eax, [ebp - 0x20]
push ebx
push eax
push dword [ebp - 0x1c]
push edi
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4030f5
push edi
call fcn.0040ae7b
inc dword [ebp - 0x14]
inc dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
pop ecx
cmp eax, dword [ebp - 0x28]
jb 0x402eac
push dword [ebp - 8]
call esi
lea eax, [ebp - 0x23c]
push eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1c]
add eax, 0x32c
push eax
call fcn.0040a8e0
pop ecx
pop ecx
push 1
pop eax
jmp 0x40319a
push dword [ebp - 8]
call esi
jmp 0x403198
push 0x41709c
push 0x417284
jmp 0x40312e
call esi
push dword [ebp - 8]
call esi
push edi
call fcn.0040ae7b
lea eax, [ebp - 0x138]
push eax
lea eax, [ebp - 0x340]
push 0x4172dc
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x340]
push ebx
push 0x41709c
jmp 0x40312d
push dword [ebp - 4]
call esi
push dword [ebp - 8]
call esi
push edi
call fcn.0040ae7b
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x340]
push 0x4172c0
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x340]
push ebx
push 0x41709c
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 4]
jmp 0x403192
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x340]
push 0x417264
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x340]
push ebx
push 0x41709c
jmp 0x40318e
lea eax, [esi + 0x20]
push eax
lea eax, [ebp - 0x340]
push 0x417084
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x340]
push ebx
push 0x41709c
push eax
push dword [esi + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret