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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x120c
call fcn.100aa1e0
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi], 0
je 0x10032005
push dword [ebp + 0xc]
lea ecx, [edi + 8]
push dword [ebp + 8]
push dword [edi + 0x9c]
call fcn.10019260
mov esi, eax
mov dword [esp + 0x18], esi
test esi, esi
je 0x10032005
mov edx, dword [edi + 0x9c]
mov ebx, dword [edi + 0xa0]
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], ebx
jmp 0x10031da0
mov ecx, dword [edi + 0xa8]
mov eax, 0x2000
sub eax, ecx
mov dword [esp + 0x10], eax
cmp esi, eax
jb 0x10031fe4
lea esi, [eax*8]
mov eax, dword [edi + 0xa0]
push esi
push edx
lea eax, [eax + ecx*8]
push eax
call fcn.100a8ab0
mov eax, dword [esp + 0x24]
add esp, 0xc
sub eax, dword [esp + 0x10]
add dword [esp + 0x14], esi
mov dword [edi + 0xa8], 0
mov ecx, dword [edi + 4]
push 0x2000
push dword [edi + 0xa0]
mov dword [esp + 0x20], eax
mov eax, dword [ecx]
push ebx
call dword [eax + 0x10]
xor esi, esi
jmp 0x10031e10
fld dword [ebx + esi*4]
fmul dword [0x100b9274]
call fcn.100a1180
mov word [ebx + esi*2], ax
inc esi
cmp esi, 0x2000
jb 0x10031e10
movzx eax, byte [edi + 0x1290]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov byte [esp + 0x20], al
movzx eax, byte [edi + 0x1288]
mov byte [esp + 0x21], al
movzx eax, byte [edi + 0x128c]
push 0
mov byte [esp + 0x26], al
lea eax, [esp + 0x2c]
push eax
push 7
lea eax, [esp + 0x2c]
mov byte [edi + 0x1290], 0
push eax
push dword [edi + 0x90]
mov dword [esp + 0x37], 0x2000
call esi
test eax, eax
je 0x10031fd1
push 0
lea eax, [esp + 0x34]
push eax
push 0x4000
push ebx
push dword [edi + 0x90]
call esi
test eax, eax
je 0x10031fd1
push 0
lea eax, [esp + 0x38]
push eax
push 0x11e0
lea eax, [esp + 0x44]
push eax
push dword [edi + 0x94]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10031fd1
cmp dword [esp + 0x38], 0
jne 0x10031fb8
cmp dword [esp + 0x40], 1
jne 0x10031eec
push 0x11d8
lea eax, [esp + 0x44]
push eax
lea eax, [edi + 0xb0]
push eax
call fcn.100a8ab0
add esp, 0xc
mov ebx, dword [esp + 0x3c]
test ebx, ebx
je 0x10031fb4
cmp dword [edi + 0xac], ebx
jae 0x10031f3d
mov eax, dword [edi + 0xa4]
test eax, eax
je 0x10031f17
push eax
call fcn.1009d16a
mov ebx, dword [esp + 0x40]
add esp, 4
lea eax, [ebx*8]
push 0x20
push eax
call fcn.1009d182
add esp, 8
mov dword [edi + 0xa4], eax
test eax, eax
je 0x10032005
mov dword [edi + 0xac], ebx
mov esi, dword [edi + 0xa4]
lea ecx, [esp + 0x2c]
push 0
push ecx
lea eax, [ebx*4]
push eax
push esi
push dword [edi + 0x94]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10032005
mov eax, dword [esp + 0x3c]
lea ecx, [eax - 1]
test ecx, ecx
js 0x10031fa5
fld dword [0x100b8f34]
movsx eax, word [esi + ecx*4 + 2]
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
fmul st(1)
fstp dword [esi + ecx*8 + 4]
movsx eax, word [esi + ecx*4]
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
fmul st(1)
fstp dword [esi + ecx*8]
dec ecx
jns 0x10031f78
mov eax, dword [esp + 0x3c]
fstp st(0)
mov ecx, dword [edi + 0x98]
push eax
push esi
mov ecx, dword [ecx]
call fcn.100175c0
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
test esi, esi
jne 0x10031da0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov dword [edi + 0xb0], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea eax, [esi*8]
push eax
mov eax, dword [edi + 0xa0]
push edx
lea eax, [eax + ecx*8]
push eax
call fcn.100a8ab0
add esp, 0xc
add dword [edi + 0xa8], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8