Function at 0x518ba0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x820
mov eax, dword [0x613ad0]
xor eax, esp
mov dword [esp + 0x81c], eax
mov eax, dword [esp + 0x828]
push ebp
xor ebp, ebp
push esi
mov esi, dword [esp + 0x82c]
cmp dword [esi + 0x99ac], ebp
mov dword [esp + 0x38], eax
mov dword [esp + 8], ebp
mov dword [esp + 0x14], ebp
mov dword [esp + 0x40], ebp
mov dword [esp + 0x30], ebp
je 0x518bfc
pop esi
lea eax, [ebp + 1]
pop ebp
mov ecx, dword [esp + 0x81c]
xor ecx, esp
call fcn.005aac48
add esp, 0x820
ret
cmp dword [esp + 0x834], ebp
je 0x518c2e
cmp byte [esi + 0x4c], 0x46
je 0x518c2e
mov eax, dword [esi + 0xd0]
cmp eax, ebp
mov byte [esi + 0x4c], 0x46
je 0x518c22
push eax
call fcn.005ac656
add esp, 4
mov dword [esi + 0xd0], ebp
mov dword [esi + 0xd4], ebp
push ebx
push edi
push esi
call fcn.004aec90
add esp, 4
cmp dword [esi + 0x9980], ebp
je 0x518c92
xor edi, edi
cmp dword [esi + 0x5e4], edi
jle 0x518c92
mov ebx, 0xfffffdff
mov ecx, dword [esi + 0x138]
mov eax, dword [ecx + edi*4]
test dword [eax + 0x3c], 0x200
je 0x518c87
mov eax, dword [eax + 0xc]
test eax, eax
jle 0x518c87
push 0x44
push 1
add eax, 0xffffffff
push eax
push edi
push esi
call fcn.004ef770
mov edx, dword [esi + 0x138]
mov eax, dword [edx + edi*4]
add esp, 0x14
and dword [eax + 0x3c], ebx
add edi, 1
cmp edi, dword [esi + 0x5e4]
jl 0x518c50
mov eax, dword [esi + 0xdc]
cmp eax, 4
jne 0x518ca3
mov eax, dword [esi + 0x9b14]
cmp eax, 1
mov dword [esp + 0x18], eax
je 0x518cb5
cmp eax, 2
mov dword [esp + 0x20], ebp
jne 0x518cbd
mov dword [esp + 0x20], 1
cmp byte [esi + 0x4c], 0x42
jne 0x518e85
mov eax, dword [esp + 0x18]
cmp eax, 3
jne 0x518ce2
push 0
push 1
push esi
call fcn.005330a0
add esp, 0xc
jmp 0x51969d
cmp eax, 5
jne 0x518cf9
lea eax, [esi + 0x4d]
push eax
push esi
call fcn.0055b1e0
add esp, 8
jmp 0x51969d
push esi
call fcn.004c8920
mov ecx, dword [esi + 0xd4]
add esp, 4
cmp byte [esi + 0xd8], 0xd
mov dword [esp + 0x44], ecx
mov dword [esi + 0xd4], ebp
je 0x518d21
mov dword [esi + 0x9990], ebp
mov ebp, dword [esp + 0x18]
cmp ebp, 6
jne 0x518d72
xor eax, eax
cmp dword [esi + 0x5e4], eax
mov dword [esi + 0xd4], 4
jle 0x518e0d
mov ecx, dword [esi + 0x138]
jmp 0x518d50
mov edx, dword [ecx]
mov edx, dword [edx + 0xc]
lea edx, [edx + edx + 2]
add dword [esi + 0xd4], edx
add eax, 1
add ecx, 4
cmp eax, dword [esi + 0x5e4]
jl 0x518d50
jmp 0x518e0d
mov edi, dword [esi + 0x5e4]
xor edx, edx
test edi, edi
jle 0x518dbd
mov ecx, dword [esi + 0x138]
cmp dword [esp + 0x20], 0
je 0x518d9e
cmp dword [esi + 0x6a4], 0
je 0x518d9e
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
add eax, 1
jmp 0x518da0
xor eax, eax
mov ebx, dword [ecx]
mov ebx, dword [ebx + 0xc]
lea eax, [ebx + eax + 1]
add dword [esi + 0xd4], eax
add edx, 1
add ecx, 4
cmp edx, dword [esi + 0x5e4]
jl 0x518d84
cmp dword [esi + 0x9990], 0
je 0x518dcc
add dword [esi + 0xd4], edi
test ebp, ebp
jne 0x518e0d
push esi
call fcn.005170c0
mov edi, eax
add esp, 4
test edi, edi
jle 0x518e0d
lea ecx, [esi + 0xbb8]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea edx, [eax + edi + 1]
add dword [esi + 0xd4], edx
cmp dword [esi + 0x9990], ebp
mov eax, dword [esi + 0xd4]
je 0x518e0d
add eax, 1
mov dword [esi + 0xd4], eax
mov eax, dword [esp + 0x44]
cmp eax, dword [esi + 0xd4]
je 0x518e5e
mov eax, dword [esi + 0xd0]
test eax, eax
je 0x518e2c
push eax
call fcn.005ac656
add esp, 4
mov ecx, dword [esi + 0xd4]
push ecx
call fcn.004e2870
add esp, 4
test eax, eax
mov dword [esi + 0xd0], eax
jne 0x518e5e
push 0x32
push 0x833
call fcn.00494c70
add esp, 4
push eax
push esi
call fcn.004e7a10
add esp, 0xc
mov ebp, dword [esi + 0xd0]
test ebp, ebp
mov dword [esp + 0x1c], ebp
jne 0x518e85
push 0x33
push 0x833
call fcn.00494c70
add esp, 4
push eax
push esi
call fcn.004e7a10
add esp, 0xc
test dword [esi + 0xa15c], 0x200
jne 0x518ea8
cmp byte [esi + 0x4c], 0x46
jne 0x518ea8
mov edx, dword [esi + 0x404]
push edx
call dword [sym.imp.USER32.dll_SetCursor]
mov dword [esp + 0x48], eax
mov edi, dword [esp + 0x18]
cmp edi, 2
jne 0x518ebd
mov eax, dword [esi + 0x39c]
push eax
call fcn.00496210
cmp dword [esp + 0x20], 0
je 0x518ede
cmp dword [esi + 0x6a4], 0
je 0x518ede
push 0x7d4
call fcn.004e27e0
add esp, 4
mov dword [esp + 0x38], eax
cmp edi, 6
jne 0x518eff
mov ecx, dword [esi + 0xd4]
push ecx
push 0xffffffffffffffff
push ebp
push esi
call fcn.00517c20
add esp, 0x10
mov dword [esp + 0x10], eax
jmp 0x51959c
cmp dword [esi + 0x5e4], 0
mov dword [esp + 0x2c], 0
jle 0x519473
xor ebx, ebx
mov dword [esp + 0x44], ebx
lea ebx, [ebx]
mov edx, dword [esi + 0x138]
mov ecx, dword [ebx + edx]
mov eax, dword [esp + 0x20]
mov edx, dword [ecx]
mov ebp, dword [esp + 0x10]
xor edi, edi
cmp eax, edi
mov dword [esp + 0x3c], edx
mov dword [esp + 0x14], edi
mov dword [esp + 0x30], edi
je 0x5190fb
cmp dword [esi + 0x6a4], edi
je 0x518f5f
mov eax, dword [esp + 0x2c]
push eax
push esi
call fcn.004abee0
add esp, 8
cmp dword [esi + 0x6a4], 0
je 0x518fbd
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
cmp dword [edx + 4], 0
je 0x518fbd
mov eax, dword [esp + 0x2c]
push eax
push esi
call fcn.004abf50
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
mov ecx, dword [edx + 0xc]
mov edx, dword [esp + 0x44]
add esp, 8
push ecx
mov ecx, dword [esi + 0x39c]
push eax
mov eax, dword [esp + 0x40]
push edx
push eax
push ecx
call fcn.004f23c0
mov edx, dword [esp + 0x2c]
push edx
push esi
mov dword [esp + 0x38], eax
call fcn.004abee0
jmp 0x5190f4
mov eax, dword [esp + 0x2c]
push eax
push esi
call fcn.004ad140
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
mov ecx, dword [edx + 0xc]
mov dword [esp + 0x54], eax
add esp, 8
xor eax, eax
test ecx, ecx
jle 0x51901f
mov edx, dword [esi + 0x3434]
jmp 0x518ff0
mov ebp, dword [esp + 0x4c]
movzx ebp, word [ebp + eax*2]
imul ebp, ebp, 0x170
cmp word [edx + ebp + 0x160], 0
ja 0x51901b
mov ebp, dword [esi + 0x138]
mov ebp, dword [ebx + ebp]
add eax, 1
cmp eax, dword [ebp + 0xc]
jl 0x518ff0
mov ebp, dword [esp + 0x10]
cmp eax, ecx
jge 0x5190e9
lea eax, [ecx + ecx + 1]
push eax
call fcn.004e2930
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
xor ebp, ebp
add esp, 4
xor edi, edi
cmp dword [edx + 0xc], ebp
mov dword [esp + 0x14], eax
jle 0x5190dd
mov edi, edi
mov eax, dword [esp + 0x4c]
movzx eax, word [eax + ebp*2]
mov edx, dword [esi + 0x3434]
mov ecx, eax
imul ecx, ecx, 0x170
movzx ecx, word [ecx + edx + 0x160]
test cx, cx
je 0x5190b7
push eax
lea eax, [esp + 0x2f]
push eax
mov eax, dword [esp + 0x44]
lea edx, [esp + 0x2e]
push edx
movzx edx, byte [eax + ebp]
push edx
push ecx
push esi
call fcn.004b00e0
add esp, 0xc
push eax
push esi
call fcn.0053cc60
add esp, 0x14
test eax, eax
je 0x5190b7
mov al, byte [esp + 0x26]
test al, al
je 0x5190b1
mov ecx, dword [esp + 0x14]
mov byte [edi + ecx], al
add edi, 1
mov dl, byte [esp + 0x2b]
jmp 0x5190be
mov ecx, dword [esp + 0x3c]
mov dl, byte [ecx + ebp]
mov eax, dword [esp + 0x14]
mov byte [edi + eax], dl
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
add ebp, 1
add edi, 1
cmp ebp, dword [edx + 0xc]
jl 0x519050
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
mov byte [edi + eax], 0
mov ecx, dword [esp + 0x2c]
push ecx
push esi
call fcn.004ad1d0
mov eax, dword [esp + 0x28]
add esp, 8
cmp byte [esi + 0x4c], 0x42
jne 0x5192ce
test eax, eax
je 0x51915c
cmp dword [esp + 0x14], 0
je 0x51912c
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
push edi
add edx, ebp
push edx
push eax
call fcn.004e29c0
add esp, 0xc
add ebp, edi
jmp 0x5191b7
cmp dword [esi + 0x6a4], 0
je 0x51915c
cmp dword [esp + 0x30], 0
jle 0x51915c
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x38]
push ecx
lea edx, [edi + ebp]
push edx
push eax
call fcn.004e29c0
add esp, 0xc
add ebp, dword [esp + 0x30]
jmp 0x5191bb
mov edx, dword [esi + 0x138]
mov ecx, dword [esp + 0x1c]
mov eax, dword [edx + ebx]
mov edx, dword [esp + 0x3c]
lea edi, [ecx + ebp]
mov ecx, dword [eax + 0xc]
push ecx
push edi
push edx
call fcn.004e29c0
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
xor eax, eax
add esp, 0xc
cmp dword [edx + 0xc], eax
jle 0x5191ab
mov edi, edi
cmp byte [edi + eax], 0
jne 0x51919a
mov byte [edi + eax], 1
mov ecx, dword [esi + 0x138]
mov edx, dword [ecx + ebx]
add eax, 1
cmp eax, dword [edx + 0xc]
jl 0x519190
mov eax, dword [esi + 0x138]
mov ecx, dword [eax + ebx]
add ebp, dword [ecx + 0xc]
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
cmp eax, 2
mov dword [esp + 0x10], ebp
jne 0x519247
cmp dword [esi + 0x14], 0
je 0x51921a
mov edx, dword [esi + 0x138]
mov eax, dword [edx + ebx]
cmp dword [eax + 0xc], 0
jle 0x51921a
mov bl, byte [edi + ebp - 1]
cmp bl, byte [esi + 0xb50]
mov byte [esp + 0x27], bl
je 0x519217
cmp bl, byte [esi + 0x58b4]
je 0x519217
cmp bl, 0xf
je 0x519217
mov ecx, dword [esp + 0x27]
push ecx
lea edx, [esi + 0x99c5]
push edx
call fcn.004e1ee0
add esp, 8
test eax, eax
je 0x51921a
cmp bl, 0xc
je 0x51921a
sub ebp, 1
mov dl, byte [esi + 0xd8]
mov byte [edi + ebp], dl
add ebp, 1
cmp dword [esi + 0x9990], 0
mov dword [esp + 0x10], ebp
je 0x519438
mov byte [edi + ebp], 0xa
add ebp, 1
mov dword [esp + 0x10], ebp
jmp 0x519438
cmp eax, 1
jne 0x51921a
cmp dword [esi + 0x14], 0
je 0x51921a
mov eax, dword [esi + 0x138]
mov ecx, dword [eax + ebx]
cmp dword [ecx + 0xc], 0
jle 0x519438
mov bl, byte [edi + ebp - 1]
cmp bl, byte [esi + 0xb50]
mov byte [esp + 0x27], bl
je 0x5192a7
cmp bl, 0xf
je 0x5192a7
cmp bl, byte [esi + 0x58b4]
je 0x5192a7
mov edx, dword [esp + 0x27]
push edx
lea eax, [esi + 0x99c5]
push eax
call fcn.004e1ee0
add esp, 8
test eax, eax
je 0x519438
cmp bl, 0xc
je 0x519438
mov cl, byte [esi + 0xd8]
mov byte [edi + ebp - 1], cl
cmp dword [esi + 0x9990], 0
je 0x519438
mov byte [edi + ebp], 0xa
add ebp, 1
mov dword [esp + 0x10], ebp
jmp 0x519438
test eax, eax
je 0x5192df
cmp dword [esp + 0x14], 0
je 0x5192df
mov ebp, dword [esp + 0x14]
jmp 0x519345
cmp dword [esi + 0x6a4], 0
je 0x5192fd
test eax, eax
je 0x5192fd
cmp dword [esp + 0x30], 0
jle 0x5192fd
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x38]
jmp 0x519345
mov eax, dword [esi + 0x138]
mov ecx, dword [eax + ebx]
mov edx, dword [ecx + 0xc]
mov ecx, dword [esp + 0x3c]
push edx
lea eax, [esp + 0x58]
push eax
push ecx
call fcn.004e29c0
mov edx, dword [esi + 0x138]
mov eax, dword [edx + ebx]
mov edi, dword [eax + 0xc]
add esp, 0xc
xor eax, eax
test edi, edi
lea ebp, [esp + 0x54]
jle 0x519345
cmp byte [esp + eax + 0x54], 0
jne 0x51933e
mov byte [esp + eax + 0x54], 1
add eax, 1
cmp eax, edi
jl 0x519332
cmp dword [esp + 0x18], 2
jne 0x519393
cmp dword [esi + 0x14], 0
je 0x519393
test edi, edi
jle 0x519393
mov bl, byte [edi + ebp - 1]
cmp bl, byte [esi + 0xb50]
mov byte [esp + 0x27], bl
je 0x519390
cmp bl, byte [esi + 0x58b4]
je 0x519390
cmp bl, 0xf
je 0x519390
mov ecx, dword [esp + 0x27]
push ecx
lea edx, [esi + 0x99c5]
push edx
call fcn.004e1ee0
add esp, 8
test eax, eax
je 0x519393
cmp bl, 0xc
je 0x519393
sub edi, 1
mov byte [edi + ebp], 0
cmp dword [esi + 0x14], 0
je 0x5193fe
cmp dword [esp + 0x18], 1
jne 0x5193fe
test edi, edi
jle 0x519418
mov bl, byte [edi + ebp - 1]
cmp bl, byte [esi + 0xb50]
mov byte [esp + 0x27], bl
je 0x5193e2
cmp bl, 0xf
je 0x5193e2
cmp bl, byte [esi + 0x58b4]
je 0x5193e2
mov eax, dword [esp + 0x27]
push eax
lea ecx, [esi + 0x99c5]
push ecx
call fcn.004e1ee0
add esp, 8
test eax, eax
je 0x519418
cmp bl, 0xc
je 0x519418
mov edx, dword [esp + 0x34]
lea eax, [edx + edi + 1]
mov byte [edi + ebp - 1], 0xd
mov byte [edi + ebp], 0xa
mov byte [edi + ebp + 1], 0
mov dword [esp + 0x34], eax
jmp 0x519418
mov ecx, dword [esp + 0x34]
lea edx, [ecx + edi + 2]
mov byte [edi + ebp], 0xd
mov byte [edi + ebp + 1], 0xa
mov byte [edi + ebp + 2], 0
mov dword [esp + 0x34], edx
push 0
lea eax, [esp + 0x54]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push ebp
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5194d9
mov eax, dword [esp + 0x14]
test eax, eax
je 0x519449
push eax
call fcn.004e2910
add esp, 4
mov eax, dword [esp + 0x2c]
mov ebx, dword [esp + 0x44]
add eax, 1
add ebx, 4
cmp eax, dword [esi + 0x5e4]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x44], ebx
jl 0x518f20
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
test edi, edi
jne 0x51959c
lea ebx, [esi + 0xbb8]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp byte [esi + 0x4c], 0x42
mov edi, eax
push edi
jne 0x51953c
mov eax, dword [esp + 0x14]
lea ecx, [eax + ebp]
push ecx
push ebx
call fcn.004e29c0
mov eax, dword [esp + 0x1c]
mov dl, byte [esi + 0xd8]
add eax, edi
mov byte [eax + ebp], dl
add eax, 1
add esp, 0xc
cmp dword [esi + 0x9990], 0
mov dword [esp + 0x10], eax
je 0x51959c
mov byte [eax + ebp], 0xa
add eax, 1
mov dword [esp + 0x10], eax
jmp 0x51959c
push str.TerSave
push 0x1f
push esi
call fcn.004e26e0
add esp, 0xc
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x40]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ecx
lea edi, [esi + 0xac25]
push edi
call ebx
lea edx, [esp + 0x440]
push edx
add esi, 0xb00e
push esi
call ebx
push edi
call fcn.005cb5ec
push esi
push edi
call fcn.005b0cea
mov eax, dword [esp + 0x54]
add esp, 0xc
test eax, eax
je 0x519535
push eax
call dword [sym.imp.USER32.dll_SetCursor]
xor eax, eax
jmp 0x51969d
lea ebp, [esi + 0xac25]
push ebp
push ebx
call fcn.004e29c0
mov eax, ebp
add esp, 0xc
mov byte [esi + edi + 0xac25], 0xd
mov byte [esi + edi + 0xac26], 0xa
mov byte [esi + edi + 0xac27], 0
lea ecx, [eax + 1]
lea esp, [esp]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x519570
push 0
sub eax, ecx
lea ecx, [esp + 0x54]
push ecx
push eax
push ebp
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x34]
mov ebp, dword [esp + 0x1c]
lea eax, [edx + edi + 2]
mov dword [esp + 0x34], eax
cmp byte [esi + 0x4c], 0x46
jne 0x5195aa
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
cmp dword [esi + 0x5e4], ebx
jne 0x5195c8
push ebx
push esi
call fcn.004effd0
add esp, 8
mov dword [esi + 0x5e4], 1
mov edi, dword [esp + 0x18]
cmp edi, ebx
jne 0x519603
cmp byte [esi + 0x4c], 0x46
jne 0x5195e5
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x40]
push 0x46
push ecx
push ebp
push edx
jmp 0x5195f2
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x40]
push 0x42
push eax
push ebp
push ecx
push esi
call fcn.004a0e60
add esp, 0x14
cmp eax, ebx
je 0x519535
cmp byte [esi + 0x4c], 0x42
mov dword [esi + 0x39f4], ebx
mov dword [esi + 0x114], ebx
mov dword [esi + 0x620], ebx
jne 0x519659
cmp edi, ebx
je 0x519629
mov edx, dword [esp + 0x10]
mov dword [esi + 0xd4], edx
cmp dword [esi + 0xd4], ebx
jne 0x519687
mov al, byte [esi + 0xd8]
mov byte [ebp], al
cmp dword [esi + 0x9990], ebx
mov eax, 1
mov dword [esi + 0xd4], eax
je 0x519687
mov byte [ebp + 1], 0xa
add dword [esi + 0xd4], eax
jmp 0x519687
cmp dword [esi + 0x343c], 1
jle 0x519666
cmp edi, ebx
jne 0x519678
mov ecx, dword [esp + 0x40]
mov edx, dword [esi + 0x39c]
push ecx
push edx
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov eax, dword [esp + 0x48]
cmp eax, ebx
je 0x519687
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov eax, dword [esp + 0x38]
cmp eax, ebx
je 0x519698
push eax
call fcn.004e2860
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x82c]
pop edi
pop ebx
pop esi
pop ebp
xor ecx, esp
call fcn.005aac48
add esp, 0x820
ret