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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
movzx esi, byte [ebp + 0x14]
mov dword [ebp - 0x2c], 0
cmp byte [ebp + 0x10], 0
je 0x456192
mov dword [esp + 4], 0x7d0be0
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [edi + 8], eax
test eax, eax
jne 0x45611d
mov dword [esp + 4], 0x7d0be3
mov dword [esp], ebx
call fcn.00703078
mov dword [esp + 4], 0x7d0be0
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [edi + 8], eax
test eax, eax
je 0x456184
mov ebx, 0
mov al, byte [ebp + ebx - 0x2c]
mov byte [ebp - 0x25], al
mov eax, dword [edi + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
lea eax, [ebp - 0x25]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
je 0x456177
mov dword [edi + 4], 0xa
mov al, 1
jmp 0x45651d
inc ebx
cmp ebx, 4
jne 0x45613b
mov al, 1
jmp 0x45651d
mov dword [edi + 4], 3
mov al, 0
jmp 0x45651d
mov dword [esp + 4], 0x7d0be7
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [edi + 8], eax
test eax, eax
jne 0x4561bb
mov dword [esp + 4], 0x7d0be3
mov dword [esp], ebx
call fcn.00703078
mov dword [esp + 4], 0x7d0be7
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [edi + 8], eax
test eax, eax
je 0x456510
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 4
lea eax, [ebp - 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x456505
cmp dword [ebp - 0x2c], 0
je 0x456225
mov eax, dword [edi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [edi + 8], 0
mov dword [edi + 4], 1
mov al, 0
jmp 0x45651d
mov eax, esi
test al, al
je 0x4562a0
mov byte [edi + 0x18], 1
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword [edi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [edi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_ftell
mov ebx, eax
mov byte [edi + 0x18], 1
mov dword [ebp - 0x24], 0x2000
mov edx, 0x66666667
imul edx
sar edx, 3
sar ebx, 0x1f
sub edx, ebx
mov dword [ebp - 0x20], edx
cmp edx, 0x1fff
jle 0x456281
lea ebx, [ebp - 0x20]
jmp 0x456284
lea ebx, [ebp - 0x24]
mov dword [ebp - 0x1c], 0x8000
cmp dword [ebx], 0x7fff
jle 0x456296
lea ebx, [ebp - 0x1c]
mov eax, dword [ebx]
and eax, 0xffffe000
mov dword [edi + 0x1c], eax
cmp byte [edi + 0x18], 0
je 0x456312
mov ebx, dword [edi + 0x1c]
neg ebx
and ebx, 4
cmp dword [edi + 0x20], 0
je 0x4562c0
cmp ebx, dword [edi + 0x24]
jne 0x4562c0
mov ebx, 0
jmp 0x4562f6
cmp dword [edi + 0x30], 0
je 0x4562d2
cmp ebx, dword [edi + 0x34]
jne 0x4562d2
mov ebx, 1
jmp 0x4562f6
cmp dword [edi + 0x40], 0
je 0x4562dd
cmp ebx, dword [edi + 0x44]
je 0x4562f1
mov dword [esp + 4], 4
mov dword [esp], edi
call fcn.00454a12
mov ebx, eax
jmp 0x4562f6
mov ebx, 2
cmp ebx, 0xffffffff
je 0x45633c
mov dword [edi + 0x50], ebx
shl ebx, 4
mov eax, 4
sub eax, dword [edi + ebx + 0x24]
mov dword [edi + 0x54], eax
jmp 0x456525
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov eax, dword [edi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
test eax, eax
je 0x456525
mov dword [edi + 4], 5
mov dword [edi + 4], 8
mov al, 0
jmp 0x45651d
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 4]
mov dword [esp], 0x18
call fcn.0076790c
mov dword [eax], vtable.ream.0
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 0x14], 0
mov dword [eax + 0x10], 0
mov dword [edi + 0xc], eax
mov dword [eax + 4], 4
cmp byte [edi + 0x18], 0
je 0x456400
mov ebx, dword [edi + 0x1c]
neg ebx
and ebx, 4
cmp dword [edi + 0x20], 0
je 0x4563aa
cmp ebx, dword [edi + 0x24]
jne 0x4563aa
mov ebx, 0
jmp 0x4563e0
cmp dword [edi + 0x30], 0
je 0x4563bc
cmp ebx, dword [edi + 0x34]
jne 0x4563bc
mov ebx, 1
jmp 0x4563e0
cmp dword [edi + 0x40], 0
je 0x4563c7
cmp ebx, dword [edi + 0x44]
je 0x4563db
mov dword [esp + 4], 4
mov dword [esp], edi
call fcn.00454a12
mov ebx, eax
jmp 0x4563e0
mov ebx, 2
cmp ebx, 0xffffffff
je 0x45651b
mov dword [edi + 0x50], ebx
shl ebx, 4
mov eax, 4
sub eax, dword [edi + ebx + 0x24]
mov dword [edi + 0x54], eax
jmp 0x456535
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov eax, dword [edi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
test eax, eax
je 0x456535
mov dword [edi + 4], 5
mov al, 0
jmp 0x45651d
mov eax, dword [edi + 0x50]
cmp eax, 0xffffffff
jne 0x456447
mov dword [edi + 4], 0xb
mov al, 0
jmp 0x45651d
mov edx, dword [edi + 0x54]
mov ecx, eax
shl ecx, 4
cmp edx, dword [edi + ecx + 0x2c]
jb 0x4564c0
add edx, dword [edi + ecx + 0x24]
mov dword [ebp - 0x3c], edx
mov esi, dword [edi + 0x1c]
neg esi
and esi, edx
cmp dword [edi + 0x20], 0
je 0x456473
mov ebx, 0
cmp esi, dword [edi + 0x24]
je 0x4564a4
cmp dword [edi + 0x30], 0
je 0x456483
mov ebx, 1
cmp esi, dword [edi + 0x34]
je 0x4564a4
cmp dword [edi + 0x40], 0
je 0x456493
mov ebx, 2
cmp esi, dword [edi + 0x44]
je 0x4564a4
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.00454a12
mov ebx, eax
test ebx, ebx
js 0x45651b
mov dword [edi + 0x50], ebx
shl ebx, 4
lea eax, [ebx + edi + 0x20]
mov edx, dword [ebp - 0x3c]
sub edx, dword [eax + 4]
mov dword [edi + 0x54], edx
cmp edx, dword [eax + 0xc]
jae 0x45651b
mov eax, dword [edi + 0x54]
mov edx, dword [edi + 0x50]
shl edx, 4
mov edx, dword [edi + edx + 0x28]
movzx ebx, byte [edx + eax]
inc eax
mov dword [edi + 0x54], eax
jmp 0x456541
mov eax, dword [edi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fgetc
mov ebx, eax
cmp eax, 0xffffffff
jne 0x456541
mov dword [edi + 4], 4
mov al, 0
jmp 0x45651d
mov eax, dword [edi + 0xc]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.00455a20
jmp 0x45651d
mov dword [edi + 4], 4
mov al, 0
jmp 0x45651d
mov dword [edi + 4], 2
mov al, 0
jmp 0x45651d
mov al, 0
add esp, 0x4c
pop ebx
pop esi
pop edi
leave
ret
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x45634a
jmp 0x456352
cmp byte [edi + 0x18], 0
jne 0x456431
jmp 0x4564d7
cmp ebx, 0xfe
jne 0x45651b
jmp 0x4564f4