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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x406a82
mov eax, dword fs:[0]
push eax
mov eax, 0x40224
call fcn.00405330
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x40228], eax
xor ebx, ebx
push ebx
lea eax, [ebp - 0x4022c]
push eax
mov esi, 0x200
push esi
lea eax, [ebp - 0x40214]
push eax
push dword [edi]
mov byte [ebp - 0x40215], 1
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, ebx
je 0x40336a
cmp dword [ebp - 0x4022c], esi
jne 0x40336a
push 4
lea eax, [ebp - 0x40113]
push 0x407420
push eax
call sub.msvcrt.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x4032e6
mov eax, dword [ebp - 0x40228]
mov byte [eax], 1
mov al, 1
jmp 0x40336c
push 5
lea eax, [ebp - 0x40113]
push 0x407418
push eax
call sub.msvcrt.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x40336a
mov eax, dword [edi + 4]
sub eax, 0x10
call fcn.00402d8d
add eax, 0x10
mov dword [ebp - 0x4021c], eax
push 0x4074bc
lea eax, [ebp - 0x4021c]
push eax
mov dword [ebp - 4], ebx
call fcn.004034ad
lea eax, [ebp - 0x40214]
push eax
lea eax, [ebp - 0x4021c]
push eax
call fcn.004034ad
mov esi, dword [ebp - 0x4021c]
push ebx
push 0x100
push 2
push ebx
push ebx
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x40228], eax
jne 0x403387
lea eax, [esi - 0x10]
call fcn.00401143
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00405310
leave
ret 4
push 8
lea eax, [ebp - 0x40198]
push ebx
push eax
call sub.msvcrt.dll_strtol
add esp, 0xc
push 1
push ebx
push ebx
push dword [edi]
mov esi, eax
mov dword [ebp - 0x40220], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
add eax, dword [ebp - 0x40220]
neg esi
and esi, 0x1ff
add esi, eax
cmp dword [ebp - 0x40220], ebx
mov dword [ebp - 0x40230], esi
jbe 0x403442
mov ecx, dword [ebp - 0x40220]
mov eax, 0x40000
cmp ecx, eax
mov dword [ebp - 0x40224], eax
jae 0x4033e6
mov dword [ebp - 0x40224], ecx
push ebx
lea eax, [ebp - 0x4022c]
push eax
push dword [ebp - 0x40224]
lea eax, [ebp - 0x40014]
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40343c
push ebx
lea eax, [ebp - 0x4022c]
push eax
push dword [ebp - 0x40224]
lea eax, [ebp - 0x40014]
push eax
push dword [ebp - 0x40228]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40343c
mov eax, dword [ebp - 0x40224]
sub dword [ebp - 0x40220], eax
jne 0x4033cb
jmp 0x403442
mov byte [ebp - 0x40215], bl
push dword [ebp - 0x40228]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x40215], bl
je 0x403484
cmp byte [edi + 8], bl
je 0x403470
lea eax, [ebp - 0x4021c]
push eax
lea esi, [edi + 0xc]
call fcn.0040280f
mov esi, dword [ebp - 0x40230]
mov eax, dword [edi + 0x18]
cmp eax, ebx
je 0x403484
push dword [ebp - 0x4021c]
push dword [edi + 0x1c]
call eax
pop ecx
pop ecx
cmp esi, 0xffffffff
je 0x403494
push ebx
push ebx
push esi
push dword [edi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp - 0x4021c]
add eax, 0xfffffff0
call fcn.00401143
mov al, byte [ebp - 0x40215]
jmp 0x40336c