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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6f4
mov eax, dword [0x49d014]
xor eax, esp
mov dword [esp + 0x6f0], eax
push ebx
push esi
push edi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [0x49f5cc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, 0xffffffff
jne 0x40b5ce
lea eax, [ebx + 0x65]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.0045f34f
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.0040b370
mov esi, eax
cmp esi, 0xffffffff
jne 0x40b5e6
mov ebx, 0x65
jmp 0x40beae
push 0
push 0
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x34]
push 0
push eax
push 0x20
push 0x49f548
push ebx
call edi
test eax, eax
je 0x40be9b
mov eax, dword [esp + 0x34]
cmp eax, 0xffffffff
jne 0x40b624
mov ebx, 0x40000001
jmp 0x40beae
cmp eax, 0x20
je 0x40b633
mov ebx, 0x40000002
jmp 0x40beae
mov eax, dword [0x49f554]
xor ebx, ebx
test eax, eax
je 0x40b648
add eax, 0xffffffe0
add eax, esi
mov dword [0x49f554], eax
imul eax, dword [0x49f564], 0x104
push 2
add eax, 2
push eax
call fcn.00462e24
add esp, 8
mov dword [esp + 0x44], eax
mov dword [0x49f790], eax
test eax, eax
jne 0x40b675
lea ebx, [eax + 0x66]
jmp 0x40beae
xor ecx, ecx
mov dword [eax], ecx
mov dword [esp + 0x34], ecx
cmp dword [0x49f564], ecx
jle 0x40beae
mov eax, dword [esp + 0x20]
mov dword [esp + 0x4c], eax
mov ebx, dword [esp + 0x1c]
lea eax, [esp + 0x58]
push 0
push eax
push 2
lea eax, [esp + 0x34]
push eax
push ebx
call edi
test eax, eax
je 0x40be9b
mov eax, dword [esp + 0x58]
cmp eax, 0xffffffff
je 0x40b61a
cmp eax, 2
jne 0x40b629
mov ax, word [esp + 0x28]
test ax, ax
je 0x40b5dc
mov ecx, 0x104
cmp ax, cx
jae 0x40b5dc
movzx esi, ax
lea eax, [esp + 0x5c]
push 0
push eax
add esi, esi
lea eax, [esp + 0xe8]
push esi
push eax
push ebx
call edi
test eax, eax
je 0x40be9b
mov eax, dword [esp + 0x5c]
cmp eax, 0xffffffff
je 0x40b61a
cmp eax, esi
jne 0x40b629
movzx eax, word [esp + 0x28]
add eax, eax
cmp eax, 0x208
jae 0x40becf
xor ecx, ecx
mov word [esp + eax + 0xe0], cx
xor eax, eax
xor cl, cl
mov word [esp + 0x2e8], ax
call fcn.0040bee0
mov ecx, eax
test ecx, ecx
je 0x40b761
lea edx, [esp + 0x2e8]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40b751
lea edx, [esp + 0xe0]
mov esi, edx
nop word [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40b770
lea edi, [esp + 0x2e8]
sub edx, esi
add edi, 0xfffffffe
nop word [eax + eax]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40b790
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x44]
lea ecx, [esp + 0x2e8]
mov edx, esi
mov eax, ecx
sub edx, eax
nop dword [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40b7c0
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b7d5
sub ecx, edx
xor eax, eax
sar ecx, 1
lea edx, [esp + 0x68]
push 4
lea esi, [esi + ecx*2]
mov ecx, ebx
add esi, 2
mov dword [esp + 0x48], esi
mov word [esi], ax
call fcn.0040b290
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40beae
lea ecx, [esp + 0x2e8]
call fcn.0040b080
test eax, eax
jne 0x40be94
lea ecx, [esp + 0x2e8]
call fcn.0040b270
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, 0xffffffff
je 0x40be8d
lea eax, [esp + 0xe0]
push str.mmfs2.dll
push eax
call fcn.00463f78
mov esi, dword [esp + 0x24]
add esp, 8
mov ecx, esi
push 4
test eax, eax
jne 0x40bac9
lea edx, [esp + 0x34]
call fcn.0040b290
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40be84
push 1
push eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call eax
mov edi, eax
push 0x1e8480
mov dword [esp + 0x30], edi
call fcn.00464148
mov esi, eax
add esp, 4
mov dword [esp + 0x14], esi
test esi, esi
je 0x40baa4
push dword [esp + 0x30]
call fcn.00464148
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x40ba9b
push dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
mov edx, eax
call fcn.0040b290
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40ba8f
mov eax, dword [esp + 0x20]
mov ebx, 0x1e8480
push 0x1bcc
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x34]
push 1
push 0
mov dword [esp + 0x24], ebx
mov dword [esp + 0x7c], eax
mov dword [esp + 0x84], esi
mov dword [esp + 0x88], ebx
mov dword [esp + 0x90], 0
mov dword [esp + 0x98], fcn.0045ba40
mov dword [esp + 0xa0], 0
mov dword [esp + 0x9c], 0x45ba60
call fcn.0045ba40
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40b952
lea esi, [eax - 4]
jmp 0x40ba4c
mov dword [edi + 0x34], 0
lea ecx, [esp + 0x6c]
mov dword [esp + 0x88], edi
mov dword [edi + 8], 1
mov dword [edi + 0x24], 0xf
call fcn.0045c350
mov esi, eax
test esi, esi
je 0x40b9a2
push edi
push dword [esp + 0x98]
call dword [esp + 0x98]
add esp, 8
mov dword [esp + 0x88], 0
test esi, esi
jne 0x40ba50
lea ecx, [esp + 0x6c]
call fcn.0045c510
mov esi, eax
cmp esi, 1
je 0x40ba02
mov ebx, dword [esp + 0x88]
test ebx, ebx
je 0x40b9eb
mov edi, dword [esp + 0x90]
test edi, edi
je 0x40b9eb
mov ecx, dword [ebx + 0x34]
mov eax, dword [esp + 0x94]
test ecx, ecx
je 0x40b9e4
push ecx
push eax
call edi
mov eax, dword [esp + 0x9c]
add esp, 8
push ebx
push eax
call edi
add esp, 8
cmp esi, 2
je 0x40ba50
cmp esi, 0xfffffffb
jne 0x40b9fc
cmp dword [esp + 0x70], 0
je 0x40ba50
mov ebx, dword [esp + 0x18]
jmp 0x40ba4c
mov edi, dword [esp + 0x88]
mov ebx, dword [esp + 0x80]
mov dword [esp + 0x18], ebx
test edi, edi
je 0x40ba47
mov esi, dword [esp + 0x90]
test esi, esi
je 0x40ba47
mov eax, dword [edi + 0x34]
mov ebx, dword [esp + 0x94]
test eax, eax
je 0x40ba38
push eax
push ebx
call esi
add esp, 8
push edi
push ebx
call esi
mov ebx, dword [esp + 0x20]
add esp, 8
xor esi, esi
jmp 0x40ba4c
mov esi, 0xfffffffe
test esi, esi
je 0x40ba5b
mov esi, dword [esp + 0x14]
mov ebx, 0x65
jmp 0x40ba87
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x60]
mov edi, dword [esp + 0x10]
push 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40be71
cmp dword [esp + 0x60], ebx
jne 0x40be63
xor ebx, ebx
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x18], ebx
push dword [esp + 0x20]
call fcn.00462e3a
add esp, 4
push esi
call fcn.00462e3a
add esp, 4
mov eax, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add eax, edi
push 0
push 0
push eax
push dword [esp + 0x28]
call esi
mov edi, dword [esp + 0x10]
test ebx, ebx
jne 0x40be84
jmp 0x40bb1f
lea edx, [esp + 0x4c]
call fcn.0040b290
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40be84
push 1
push eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call eax
push dword [esp + 0x48]
mov esi, eax
push dword [esp + 0x20]
push edi
call dword [sym.imp.MMFS2.dll_Ordinal_766]
mov ebx, eax
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40be84
push eax
push eax
mov eax, dword [esp + 0x50]
add eax, esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push dword [esp + 0x28]
call esi
lea ecx, [esp + 0xe0]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bb30
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x40bd0e
lea eax, [esp + ecx*2 + 0xd8]
push str..mfx
push eax
call fcn.00463f78
add esp, 8
test eax, eax
jne 0x40bd0e
push eax
push eax
push eax
push edi
call esi
push 1
xorps xmm0, xmm0
lea eax, [esp + 0x54]
push eax
movlpd qword [esp + 0x28], xmm0
push dword [esp + 0x2c]
movlpd qword [esp + 0x5c], xmm0
push dword [esp + 0x2c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x40bb9e
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
jmp 0x40bbaf
xorps xmm0, xmm0
movlpd qword [esp + 0x38], xmm0
mov edi, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
push 2
xorps xmm0, xmm0
lea eax, [esp + 0x3c]
push eax
movlpd qword [esp + 0x28], xmm0
push dword [esp + 0x2c]
movlpd qword [esp + 0x44], xmm0
push dword [esp + 0x2c]
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x40bbeb
mov eax, dword [esp + 0x38]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x24], eax
push 0
lea eax, [esp + 0x24]
xorps xmm0, xmm0
push eax
push edi
mov edi, dword [esp + 0x1c]
push esi
push edi
movlpd qword [esp + 0x34], xmm0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 1
push 0x8000
xor esi, esi
call fcn.00462e24
mov ecx, eax
add esp, 8
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40bcdc
nop
mov edi, 0x8000
cmp eax, edi
push 0
cmovb edi, eax
lea eax, [esp + 0x68]
push eax
push edi
push ecx
push dword [esp + 0x20]
mov dword [esp + 0x34], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40bcce
mov eax, dword [esp + 0x64]
cmp eax, 0xffffffff
je 0x40bcd4
cmp eax, edi
jne 0x40bcd4
mov edx, dword [esp + 0x14]
shr edi, 2
test edi, edi
je 0x40bc84
nop dword [eax]
mov ecx, dword [edx]
mov eax, esi
shr eax, 0x1f
add edx, 4
add eax, ecx
lea esi, [eax + esi*2]
sub edi, 1
jne 0x40bc70
mov eax, dword [esp + 0x20]
mov edi, 0
and eax, 3
mov dword [esp + 0x50], eax
jbe 0x40bcb7
mov ebx, eax
nop dword [eax + eax]
movzx ecx, byte [edi + edx]
mov eax, esi
shr eax, 0x1f
inc edi
add eax, ecx
lea esi, [eax + esi*2]
cmp edi, ebx
jb 0x40bca0
mov ebx, dword [esp + 0x18]
mov eax, dword [esp + 0x2c]
sub eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x2c], eax
je 0x40bcd8
jmp 0x40bc30
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
push 0x8000
push 0
push ecx
call fcn.00460cc0
push dword [esp + 0x20]
call fcn.00462e3a
add esp, 0x10
mov eax, 0x65
cmp dword [esp + 0x68], esi
cmovne ebx, eax
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
jne 0x40beae
lea eax, [esp + 0xe0]
push str.FormattedText.dll
push eax
call fcn.00463f78
add esp, 8
test eax, eax
jne 0x40be47
push 0x8001
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push ebx
mov edi, eax
lea eax, [esp + 0x2ec]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [0x49f530], eax
test eax, eax
je 0x40be40
push str.getRunInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40be40
push 0x3c
lea eax, [esp + 0xa8]
push ebx
push eax
call fcn.00460cc0
add esp, 0xc
lea eax, [esp + 0xa4]
push eax
push 0x49f580
call esi
test eax, eax
jne 0x40be40
mov eax, dword [esp + 0xb4]
mov dword [0x49f77c], eax
mov eax, dword [esp + 0xac]
mov dword [0x49f780], eax
mov eax, dword [esp + 0xb0]
mov dword [0x49f784], eax
mov eax, dword [esp + 0xb8]
mov dword [0x49f788], eax
mov eax, dword [esp + 0xbc]
mov dword [fcn.0041f520], eax
mov eax, dword [esp + 0xc0]
mov dword [fcn.0041f520], eax
mov eax, dword [esp + 0xc4]
mov dword [fcn.0041f370], eax
mov eax, dword [esp + 0xcc]
mov dword [0x49e0bc], eax
mov eax, dword [esp + 0xc8]
mov dword [fcn.0041f520], eax
mov eax, dword [esp + 0xd0]
mov dword [0x49e02c], eax
mov eax, dword [esp + 0xd4]
mov dword [0x49ddec], eax
mov eax, dword [esp + 0xd8]
mov dword [0x49dbcc], eax
mov eax, dword [esp + 0xdc]
mov dword [0x49d9ac], eax
push edi
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
mov esi, dword [esp + 0x34]
inc esi
mov dword [esp + 0x34], esi
cmp esi, dword [0x49f564]
jge 0x40beae
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40b691
push edi
mov ebx, 0x40000004
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40beae
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebx, [eax - 0x70]
neg ebx
sbb ebx, ebx
add ebx, 0x40000004
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40beae
mov ebx, 0x68
jmp 0x40beae
mov ebx, 0x67
jmp 0x40beae
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebx, [eax - 0x26]
neg ebx
sbb ebx, ebx
add ebx, 0x40000002
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x6fc]
mov eax, ebx
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0045f34f
mov esp, ebp
pop ebp
ret
call fcn.0045f4bf
int3