Function at 0x409f00
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47ca4d
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x4b41e0]
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 eax, dword [edi]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x18], ebx
cmp eax, 0xffffffff
je 0x409f4b
test eax, eax
je 0x409f4b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0xffffffff
mov eax, dword [ebp + 0xc]
mov dword [edi + 4], eax
test al, 8
je 0x40a11e
xorps xmm0, xmm0
mov dword [ebp - 0x24], 0
xor esi, esi
movq qword [ebp - 0x2c], xmm0
test ebx, ebx
je 0x409f7b
cmp word [ebx], si
je 0x409f7b
inc esi
cmp word [ebx + esi*2], 0
jne 0x409f73
xor ecx, ecx
mov dword [ebp - 0x28], esi
lea eax, [esi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046a22b
add esp, 4
mov dword [ebp - 0x2c], eax
test esi, esi
jle 0x409fc6
mov ecx, eax
sub ebx, eax
mov edx, esi
nop word [eax + eax]
mov ax, word [ebx + ecx]
lea ecx, [ecx + 2]
mov word [ecx - 2], ax
sub edx, 1
jne 0x409fb0
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov byte [ebp - 0x24], 1
mov word [eax + esi*2], cx
push ecx
push 1
push 1
push ecx
mov dword [ebp - 4], ecx
lea ecx, [ebp - 0x2c]
push 0x49eab0
call fcn.00402320
mov esi, dword [ebp - 0x2c]
test eax, eax
je 0x40a10a
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x40a00e
test esi, esi
je 0x40a009
cmp word [esi], ax
je 0x40a009
inc eax
cmp word [esi + eax*2], 0
jne 0x40a001
mov dword [ebp - 0x28], eax
test eax, eax
setg byte [ebp - 0x24]
test eax, eax
jle 0x40a03d
lea ecx, [eax*2 - 2]
nop dword [eax]
cmp word [esi + ecx], 0x5c
lea edx, [esi + ecx]
jne 0x40a03a
dec eax
xor ebx, ebx
sub ecx, 2
mov dword [ebp - 0x28], eax
mov word [edx], bx
test eax, eax
jne 0x40a020
mov ebx, dword [ebp - 0x18]
push 0
push 1
push 0xffffffffffffffff
push 1
push 0x49eab0
lea ecx, [ebp - 0x2c]
call fcn.00402320
mov esi, dword [ebp - 0x2c]
cmp eax, 2
jle 0x40a093
lea ecx, [eax - 1]
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x40a07b
test esi, esi
je 0x40a078
cmp word [esi], ax
je 0x40a078
nop dword [eax]
inc eax
cmp word [esi + eax*2], 0
jne 0x40a070
mov dword [ebp - 0x28], eax
cmp eax, ecx
setge byte [ebp - 0x24]
jl 0x40a096
cmovl ecx, eax
mov eax, ecx
xor ecx, ecx
mov dword [ebp - 0x28], eax
mov word [esi + eax*2], cx
jmp 0x40a096
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x40a0ae
test esi, esi
je 0x40a0ab
cmp word [esi], ax
je 0x40a0ab
inc eax
cmp word [esi + eax*2], 0
jne 0x40a0a3
mov dword [ebp - 0x28], eax
cmp eax, 2
jle 0x40a10a
test esi, esi
jne 0x40a0ce
push 2
call fcn.0046a22b
mov esi, eax
add esp, 4
xor eax, eax
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x28], eax
mov word [esi], ax
mov ecx, esi
mov byte [ebp - 0x24], 1
call fcn.0040bc70
test al, al
jne 0x40a10a
test esi, esi
je 0x40a0ea
push esi
call fcn.00469e73
add esp, 4
xor eax, eax
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.00469e65
mov esp, ebp
pop ebp
ret 0xc
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x40a11e
push esi
call fcn.00469e73
add esp, 4
mov eax, dword [edi + 4]
mov edx, SysReAllocString
mov esi, eax
mov dword [ebp - 0x18], 0xc0000000
shr esi, 2
mov ecx, eax
not esi
mov dword [ebp - 0x38], 0
and esi, 1
test eax, 3
push 0
cmovne edx, dword [ebp - 0x18]
test al, 2
mov eax, 0
mov dword [ebp - 0x18], 3
sete al
test ecx, 3
push 0
lea eax, [eax*2 + 2]
cmove eax, dword [ebp - 0x18]
push eax
push 0
push esi
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a18f
test eax, eax
je 0x40a18f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], esi
test esi, esi
jne 0x40a1a0
mov dword [edi], 0xffffffff
jmp 0x40a0ea
cmp esi, 0xffffffff
je 0x40a0ea
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0
push eax
push esi
mov dword [ebp - 0x30], 0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40a1ce
xorps xmm0, xmm0
movlpd qword [ebp - 0x34], xmm0
mov ebx, dword [edi + 4]
mov eax, dword [ebp - 0x34]
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
test bl, 0x10
je 0x40a1f6
test bl, 1
je 0x40a1ef
push 0
push esi
push eax
mov ecx, edi
call fcn.0040a910
mov eax, dword [edi]
jmp 0x40a0ec
test eax, eax
jne 0x40a2ad
test esi, esi
jne 0x40a2ad
test bl, 0xe0
setne cl
test bl, 3
setne al
test al, cl
je 0x40a1ef
and ebx, 0x80
or ebx, 0x100
shr ebx, 7
push ebx
call fcn.0046a22b
mov esi, eax
add esp, 4
mov eax, dword [edi + 4]
test al, al
jns 0x40a242
mov word [esi], 0xbbef
mov byte [esi + 2], 0xbf
jmp 0x40a256
test al, 0x20
je 0x40a24d
mov word [esi], 0xfeff
jmp 0x40a256
test al, 0x40
je 0x40a256
mov word [esi], 0xfffe
push 0
lea eax, [ebp - 0x38]
push eax
push ebx
push esi
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a29b
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a289
test eax, eax
je 0x40a289
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0xffffffff
mov dword [edi + 4], 0
push esi
xor edi, edi
call fcn.00469e73
add esp, 4
mov eax, edi
jmp 0x40a0ec
mov edi, dword [edi]
push esi
call fcn.00469e73
add esp, 4
mov eax, edi
jmp 0x40a0ec
test bl, 2
jne 0x40a1ef
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x38]
push 0
push eax
push 3
lea eax, [ebp - 0x1c]
mov word [ebp - 0x1c], 0
push eax
push dword [edi]
mov byte [ebp - 0x1a], 0
call ebx
test eax, eax
je 0x40a1ef
mov al, byte [ebp - 0x1c]
xor ecx, ecx
cmp al, 0xff
jne 0x40a2ff
cmp byte [ebp - 0x1b], 0xfe
jne 0x40a340
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe3f
or eax, 0x20
jmp 0x40a33d
cmp al, 0xfe
jne 0x40a31b
cmp byte [ebp - 0x1b], 0xff
jne 0x40a340
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe5f
or eax, 0x40
jmp 0x40a33d
cmp al, 0xef
jne 0x40a340
cmp byte [ebp - 0x1b], 0xbb
jne 0x40a340
cmp byte [ebp - 0x1a], 0xbf
jne 0x40a340
mov eax, dword [edi + 4]
mov ecx, 3
and eax, 0xfffffe9f
or eax, 0x80
mov dword [edi + 4], eax
mov eax, dword [edi + 4]
test al, 1
je 0x40a3ef
test al, 0x60
mov ecx, edi
mov eax, dword [ebp - 0x18]
push 0
je 0x40a3ae
sub eax, 2
sbb esi, 0
push esi
push eax
call fcn.0040a910
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a39a
test eax, eax
je 0x40a39a
push 0
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x18], 0xffff
push ecx
push 2
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x30], 0
push ecx
push eax
call ebx
mov eax, 0xffff
cmp ax, word [ebp - 0x18]
jne 0x40a1ef
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
mov ecx, edi
call fcn.0040a910
mov eax, dword [edi]
jmp 0x40a0ec
sub eax, 1
sbb esi, 0
push esi
push eax
call fcn.0040a910
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a1ef
test eax, eax
je 0x40a1ef
push 0
lea ecx, [ebp - 0x30]
mov byte [ebp - 0x1d], 0xff
push ecx
push 1
lea ecx, [ebp - 0x1d]
mov dword [ebp - 0x30], 0
push ecx
push eax
call ebx
mov eax, dword [edi]
jmp 0x40a0ec
cmp ecx, dword [ebp - 0x38]
je 0x40a1ef
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a1ef
test eax, eax
je 0x40a1ef
push 0
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [edi]
jmp 0x40a0ec