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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x433476
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x40a4
call fcn.00422200
mov eax, dword [0x43d76c]
xor eax, esp
mov dword [esp + 0x40a0], eax
push ebx
push esi
push edi
mov eax, dword [0x43d76c]
xor eax, esp
push eax
lea eax, [esp + 0x40b8]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
xor esi, esi
mov eax, 7
mov dword [esp + 0x64], eax
mov dword [esp + 0x80], eax
xor edx, edx
xor eax, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x60], esi
mov word [esp + 0x50], dx
mov dword [esp + 0x7c], esi
mov word [esp + 0x6c], ax
mov dword [esp + 0x84], esi
mov dword [esp + 0x94], esi
mov dword [esp + 0x98], esi
mov dword [esp + 0x9c], esi
mov dword [esp + 0xa0], esi
mov dword [esp + 0xa4], esi
mov dword [esp + 0xa8], esi
mov dword [esp + 0x88], esi
mov dword [esp + 0x8c], esi
push ecx
lea edx, [esp + 0x50]
mov ecx, edi
mov dword [esp + 0x40c4], esi
call fcn.00402850
test eax, eax
je 0x4027e5
push ebx
call fcn.00401e30
add esp, 4
mov dword [esp + 0x14], 0xffffffff
mov byte [esp + 0x40c0], 1
mov eax, dword [esp + 0x18]
mov ecx, edi
lea edi, [esp + 0x44]
call fcn.00402cf0
mov edi, dword [eax]
mov ecx, dword [eax + 4]
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], ecx
cmp edi, esi
je 0x4027e5
cmp edi, 0xffffffff
je 0x4027e5
test byte [esp + 0x84], 1
je 0x40269f
push ebx
mov eax, edi
call fcn.00408cd0
add esp, 4
test eax, eax
jne 0x4027e5
push esi
push esi
push 3
push esi
push 1
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x402812
lea edx, [esp + 0x88]
push edx
push esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402812
push esi
push esi
push 2
push esi
push esi
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edx, eax
mov dword [esp + 0x14], edx
cmp edx, 0xffffffff
je 0x4027e5
mov eax, dword [esp + 0xa0]
cmp eax, esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
jl 0x4027f8
mov ecx, dword [esp + 0x9c]
jg 0x4026f0
cmp ecx, esi
jbe 0x4027f8
jmp 0x4026f0
sub ecx, dword [esp + 0x1c]
mov dword [esp + 0x30], esi
sbb eax, dword [esp + 0x20]
mov dword [esp + 0x18], esi
js 0x402717
jg 0x40270c
cmp ecx, 0x2800
jbe 0x402717
mov ecx, 0x2800
mov dword [esp + 0x40], esi
jmp 0x40271b
mov dword [esp + 0x40], eax
push esi
lea eax, [esp + 0x2c]
push eax
push ecx
lea ecx, [esp + 0xb8]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4027dc
mov edi, dword [esp + 0x28]
xor ebx, ebx
mov edx, edi
or edx, ebx
je 0x4027dc
test ebx, ebx
jl 0x402791
jg 0x402753
test edi, edi
jbe 0x402791
mov edx, dword [esp + 0x14]
push 0
lea eax, [esp + 0x1c]
push eax
push edi
lea ecx, [esp + esi + 0xb8]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4027c4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4027c4
add esi, eax
mov eax, dword [esp + 0x30]
adc eax, 0
cmp eax, ebx
mov dword [esp + 0x30], eax
jl 0x402753
jg 0x402791
cmp esi, edi
jb 0x402753
add dword [esp + 0x1c], edi
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0xa0]
adc ecx, ebx
cmp ecx, eax
mov dword [esp + 0x20], ecx
jg 0x4027f2
mov ecx, dword [esp + 0x9c]
jl 0x4027b9
cmp dword [esp + 0x1c], ecx
jae 0x4027f2
mov edi, dword [esp + 0x34]
xor esi, esi
jmp 0x4026f0
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x4c]
call fcn.00402470
xor eax, eax
jmp 0x402820
lea esi, [esp + 0x14]
call fcn.00401900
lea ecx, [esp + 0x4c]
call fcn.00402470
xor eax, eax
jmp 0x402820
mov edx, dword [esp + 0x14]
xor esi, esi
lea ecx, [esp + 0x88]
push ecx
push esi
push esi
push edx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
lea esi, [esp + 0x14]
call fcn.00401900
lea ecx, [esp + 0x4c]
call fcn.00402470
mov eax, 1
mov ecx, dword [esp + 0x40b8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x40a0]
xor ecx, esp
call fcn.00421275
mov esp, ebp
pop ebp
ret 8